R159 · Agent architecture › Memory and context

SelfGraph: versioned knowledge graphs that tell an agent what they can't answer

Read the original

Authors André Lindenberg (shared)

agent-memorygraph-databaseknowledge-managementmcpopen-source

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:

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:

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

Failure modes to watch

Review checklist before using it for agent memory

Cited in field guides

Connections

See R159 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.