SpandrelA framework that turns markdown file trees into governed knowledge graphs — philosophy, spec, and reference implementation

Storage

The GraphStore interface — backend-agnostic contract between compiler and server

Storage

The storage layer sits between the compiler (which produces the graph) and the GraphQL server (which queries it). Any backend that satisfies the GraphStore interface works.

The reference implementation ships an in-memory backend for local development. Production deployments typically use a Postgres-compatible backend (e.g. managed Postgres with pgvector), though SQLite, flat files, or any other backend that implements the interface will work.

The storage interface is deliberately minimal: the compiler writes nodes and edges, the GraphQL resolvers read them. The contract is defined in src/storage/design.md.

Key read methods: getNode, getNodes, getAllNodes, getChildren, getEdges, getEdgesBatch, getWarnings, getLinkTypes, plus nodeCount / edgeCount. getLinkTypes() returns the graph's declared link-type vocabulary (/linkTypes/* nodes keyed by filename stem) — used by the GraphQL layer to decorate edges with linkTypeDescription and by the MCP server to enumerate vocabulary in its instructions.