Give your coding agent a memory it can query.
Stop re-explaining your architecture every session. Typed Graph gives Claude Code, Cursor and any MCP client a typed graph of your design docs and code, an ontology that tells it what every type, link and block in your docs means, and a check that stops it from finishing with broken references.
See it work
tg output on an example checkout API with requirements, @tg: annotations and an OpenSpec change folder. A query finds the requirement with no implementation; one typed comment closes it; a typo fails the check.Claude Code in one command
tg is a CLI your agent can call directly. tg init asks which coding agents you use and what to set up, then writes the files; --dry-run prints the diff instead.
npm install -g @typedgraph/cli tg init # CLAUDE.md block, hooks, .mcp.json, seven skills tg check # does the documentation still match the code?
Other agents get the same setup: --agent codex, cursor, github-copilot, opencode, kilocode, pi, oh-my-pi or agents for any agent that reads AGENTS.md, several at once with commas.
What the agent gets
- Learn the vocabulary:
tg ontologyexplains every type, edge and the blocks each kind of document holds, so the agent writes an<option>or a<rule>the way your team means it. - Search first: a prompt hook reminds it to search, expands
[[refs]]in your prompt and adds the top lexical hits. It needs no model, key or network. - Query the graph:
tg cypherover sections and code symbols, or the ten tools oftg mcp. - Finish honestly: a stop hook blocks completion while
tg checkfails, or when several code lines changed with little change in the docs.
Memory engineering, not a pile of notes
Typed edges are memory an agent can traverse. Everything stays plain Markdown a human can review.
// @tg: implements:: [[auth#Token expiry]] {since: 2}
// @tg: -contradicts:: [[design#Stateless sessions]]
function legacyCheck() {}
$ tg cypher "MATCH (c:CodeSymbol)-[:implements]->(s:Section)
RETURN s.title, count(c)"
One space with the humans
Your team edits the same files in Obsidian or an editor. What the agent learns is a diff you can read and review.
Checked, not hoped for
Links, symbols, section rules and test-spec coverage are validated in CI and by the agent hook.
Search that runs anywhere
Lexical search works in a fresh clone. Add Ollama or an OpenAI-compatible endpoint for hybrid search and cited GraphRAG.
Compatible with lat.md
It reads the same lat.md/ folders and agrees with lat check, then adds typed edges, Cypher and a visual graph. Compared in detail.
Docs that explain themselves to the agent
An agent that guesses what a tag or a link means writes plausible nonsense. In Typed Graph the ontology says it in plain words, down to the blocks inside a document: a decision's options, a requirement's rules, a runbook's rollback. The agent reads the meaning, writes the part, and code can point at exactly that part.
What it reads before writing
$ tg ontology
Decision (Types/code-types.md)
A choice that was made, with its reason and
the alternatives rejected. An ADR is one.
...
elements:
<option> — An alternative that was considered,
and why it won or lost. Give it an id when code
or a later decision must point at it.
attributes:
id (text) — Stable address, unique in the
file, linked as file#^id.
outcome (text, chosen|rejected|deferred) —
What happened to this option.
What it writes, and what catches a slip
<option id="jwt-rotation" outcome="chosen">
Stateless JWTs with rotating refresh tokens.
</option>
// @tg: implements:: [[decisions#^jwt-rotation]]
export function rotateRefreshToken(old: string) {}
$ tg check
- src/tokens.ts:1: @tg: [[decisions#^jwt-rotaton]]
— no element with that id — did you mean
'[[lat.md/decisions#^jwt-rotation]]'?
Which options did we weigh, and what implements them?
$ tg cypher 'MATCH (d:Decision)-[:contains]->(o:Element {tag: "option"})
OPTIONAL MATCH (c:CodeSymbol)-[:implements]->(o)
RETURN o.element, o.outcome, c.symbol'
o.element | o.outcome | c.symbol
---------------------------------+-----------+-------------------
lat.md/decisions#^redis-sessions | rejected | null
lat.md/decisions#^jwt-rotation | chosen | rotateRefreshToken
Knows what to write
Every type, property, edge and block has a description. The tg skills tell the agent to read tg ontology first, and to mark a part only when something will point at it.
Points at the exact part
An element with an id is a node: code implements one option or one rule, and a typo fails tg check with the nearest id as a suggestion.
Corrected with reasons
tg ontology check reports a missing, repeated or mistyped block together with its description, so the agent learns what the part is for while it fixes it.
In your AI editor
The extension shows typed backlinks and the graph for Markdown and annotated code, and offers to run tg init for you.
code --install-extension pavlyshyn.typegraph-vscode
VS Code Marketplace · Open VSX (Cursor, Windsurf, VSCodium, Gitpod)
Use an Obsidian vault as memory
Run the sidecar next to your vault to serve Cypher, vector search and cited GraphRAG over MCP.
claude mcp add typed-graph \ -e OBSIGRAPH_VAULT=/path/to/vault \ -e OBSIGRAPH_DATA=/path/to/data \ -- node packages/sidecar/dist/server.mjs --stdio