Repository navigation
feat: typed records and relations (knowledge base, sub-project 1) - #10
Merged
Merged
Conversation
qdequele
added this pull request to stack #11
October 9, 2026 08:08
…ore writing - Crawler consults every entity: an agent's non-project entity blocks its id for repositories; stubs and path-less agent projects are adopted (the latter get their path); a moved repository reclaims its id; a failed entity fetch aborts the scan instead of disabling the protection. - save_entity validates kind and name before any write; relate rejects self-relations and empty predicates before stubbing either end. - A deduplicated save_memory still adds the entity links it asked for. - memd context no longer injects entities as memories. - update_memory's description no longer promises an automatic project link.
qdequele
force-pushed
the
qdequele/knowledge-graph
branch
from
October 9, 2026 08:08
e63b087 to
f815d76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
memd stored only flat text. This adds structured knowledge: the companies, teams, people, projects, products, services, customers and concepts in the user's world, plus typed relations between them, so any agent can ask "what is Lumen, what depends on it, who owns it?" and get one structured answer. memd stays model-free: agents supply names and relations; the crawler adds one project entity per git repository.
Stacked on #9 (base
qdequele/memory-quality); retarget tomainonce #9 merges.Spec:
docs/superpowers/specs/2026-10-08-typed-records-and-relations-design.md· Plan:docs/superpowers/plans/2026-10-09-typed-records-and-relations.mdWhat changed
type = entityand flattened, filterable knowledge fields (name,aliases,kind_of,owner,status,entities, …). Ids areentity_<slug>; saving under a name or an alias updates one record (passed fields overwrite, absent ones are kept, aliases/tags union).memory_relationsindex, one document per directed edge. Unknown names become stub entities so an edge always lands.save_entity,explore(entity + relations both ways + related entities + mentioning memories, depth ≤ 2),forget_relation;save_memory/update_memoryacceptentitiesandrelations;get_memory/list_memoriesfilter byentity,status,kind_of. Vocabularies come from one set of constants.memd entity,memd entity add,memd relate,memd unrelate,search --entity --status --kind-of;memd contextopens with one line about the current project;doctor --fixback-fills project links.Departures from the spec (engine constraints)
entity_, notentity:— Meilisearch ids allow onlyA-Za-z0-9-_.content.summaryfield.idis filterable soexplorefetches neighbours in one request.Verification
cargo fmt --check,cargo clippy --all-targets -D warnings,cargo test— 141 passed.exploredepth 2, entity-linked memory with automatic project link, project entity output,doctor --fixback-fill; test records removed afterwards. Re-crawl after the fix pass: 0 indexed, 0 deleted, 0 errors (ids stable).Deferred minors: relation
created_atlost on fetch error; id-shaped unknown names; raw content edits on entities;--resetcan swap colliding project ids;stats/historydescriptions;docs/cli.mdx/crawler.mdxcoverage; two escaping helpers; watcher re-links only on reconcile.🤖 Generated with Claude Code