Living Knowledge: One Graph to Query, Export and Build On
ForkTex Engineering · November 27, 2026 · 2 min
A knowledge graph is a set of facts stored as typed records joined by named links: a rule and the document that owns it, a service and the library it depends on, a note and the source it cites. forktex-data is our open-source Python library that loads such records into one graph in memory and answers questions over it.
Records are JSON files, each naming its type and its id. Types are declared in JSON too, so the graph describes itself and no code of yours is needed to read it.
Any kind of knowledge
Nothing in it belongs to one field. The same mechanism holds:
- a company's rules, procedures and decisions;
- a software project's architecture: services, libraries and what depends on what;
- a personal or research knowledge base: notes, sources and the links between them.
Our own engineering handbook is built this way: every document, every rule it states and every link between them is one JSON record.
Declare, load, ask
types.declare_all([
{"$type": "TypeDeclaration", "name": "Note", "role": "Node",
"fields": {"title": {"type": "string"}, "body": {"type": ["string", "null"]}}},
{"$type": "TypeDeclaration", "name": "cites", "role": "Edge"},
])
ASK = Pipeline(steps=(
TextIndex(fields={"title": 3, "body": 1}),
LexicalSeeds(limit=2),
ConstrainedWalk(moves=Moves(follow={"cites": 1.0}), hops=2),
Pack(budget_tokens=200, levels=("brief", "full")),
))
result = await ASK.run(graph, "why does the sea rise")A question runs through a pipeline: find the best text matches with BM25, the ranking behind most keyword search, walk the links outward from them, then pack the results into a fixed budget of tokens. Each item comes back with the path that led to it, so the answer shows why it is there.
Export, publish, serve
- Markdown: records are plain data, so a page is a function of them. Our handbook renders every document to Markdown from its records.
- One file: a knowledge base publishes as a single versioned bundle, with its types, records, search index and named pipelines, that a reader opens without your code.
- Agents:
forktex-data-mcpserves a bundle to Claude, or to any MCP client, offline, through read-only tools. - Specialised agents and skills: a pipeline is itself a JSON document, so the retrieval an agent runs is stored, reviewed and versioned like any other file. Our coding agents' instructions are composed from the handbook's rules.
What it is not
It is working memory, not storage. A graph lives in one process, is built once and never changes, and nothing is written back. Durable, shared data belongs in a database: see Working Memory. The library is also young: before 1.0, a minor version may change its public surface.
Try it
pip install forktex-data # the library
pip install "forktex-data[mcp]" # and the bundle serverforktex-data is open source, on GitHub and PyPI, under AGPL-3.0-or-later or a commercial licence. It needs Python 3.14 and no service of any kind.