Sources: the hydra-db/selfgraph repository README (Apache-2.0, early stage), as shared by André Lindenberg on LinkedIn, 2026-11-19.
What it is
SelfGraph is a Python and TypeScript SDK, with a CLI and an MCP server, that turns text or structured facts into a knowledge graph an agent can query. It sits over several graph databases behind one API: Neo4j, Memgraph and other Bolt engines, FalkorDB, HydraDB, and embedded Kuzu. Its pitch is three things most agent memory stores leave out:
Time. Every change is versioned. A newer fact retires an older one, and nothing is deleted.
Ontology. Types, synonyms and certified definitions give the graph a vocabulary.
Answerability. An LLM-free check tells the agent which terms in a question the graph cannot ground, before it answers.
Retrieval needs no vector store. It seeds from keyword matches (BM25 plus schema synonyms), walks the graph, and returns the source passages. Embeddings are optional.
Architecture
text / facts --> extraction (regex | spaCy | LLM)
--> entity resolution (ids | name+alias | LLM-confirmed)
--> contradiction rules (schema | LLM-judged)
--> versioned store (Neo4j, Memgraph, FalkorDB, HydraDB, Kuzu)
question --> check_answerable: ground terms via types, synonyms, definitions
-> report.missing lists ungroundable terms
--> retrieve: BM25 + synonyms seeds -> BFS / PageRank walk
-> source passages, as_of (event time) or as known then
Every capability is a ladder of tiers set by one level option:
lightuses regex and BFS.balanced, the default, is the strongest free and deterministic tier (spaCy, alias matching).maxturns on LLM extraction, resolution and contradiction judging, plus embeddings and PageRank.
Higher tiers run the lower ones first and only escalate undecided cases, so LLM cost follows the hard cases. Every tier writes the same ids, so changing tier needs no migration. Each result reports which tiers produced it.
The temporal model
There are two time axes. as_of asks what was true at a date: Ann worked at Acme in 2021 even though she now works at Globex. The LinkedIn summary describes a second, as-known-then view: the graph as it stood on a date, so a correction recorded today with a backdated event time does not rewrite an answer the agent already gave. This is bitemporal modelling, familiar from finance and audit systems, applied to agent memory. Retired relations keep their history and record what replaced them, and diff(since, until) lists what changed.
Tradeoffs
Deterministic by default vs extraction quality. Regex and spaCy extraction are free and reproducible but miss what an LLM would catch. The tier ladder makes that a per-capability choice rather than all-or-nothing.
No vector store vs fuzzy recall. Keyword seeds plus synonyms are explainable and cheap. Paraphrased questions with no shared terms will miss unless embeddings are turned on.
Schema-first answerability vs schema maintenance. The answerability check is only as good as the synonyms and definitions someone curates.
Schema.from_tablesdrafts one from table metadata, which helps for structured sources.Many backends vs lowest common denominator. One API over five stores means backend-specific features (indexes, algorithms) may not be reachable through it.
Failure modes to watch
Entity resolution merges two different people or splits one, and every later fact inherits the error.
Contradiction rules retire a fact that was actually still true (two jobs at once), silently changing answers.
The answerability check passes because a term matched a synonym, but the data for it is thin or stale.
Agents ignore
report.missingand answer anyway. The check only helps if the harness enforces it.Early-stage repo: API and storage encoding may change.
Review checklist before using it for agent memory
Decide which questions must be answerable "as known then" (audit, support history) and test that path explicitly.
Make the harness refuse or ask when
check_answerablereports missing terms.Review contradiction rules per relation type. Default to keeping both facts where exclusivity isn't real.
Log
result.tiersso you know when LLM tiers fired and what they cost.Pin the version, and keep the source passages so the graph can be rebuilt if extraction improves.
Related entries
R106 txtai: vectors, SQL and a graph in one local index.
R127 GraphRAG Zero: graph-guided retrieval with no LLM calls at index time.
R147 Anthropic's components of agent memory.
R057 SoMem: agents organizing their own memory as linked documents.
R134 CodeGraph: a local code graph agents query over MCP.