AGENTS.md Doesn't Scale — A Wiki-Linked Knowledge Graph That Does
The lat check integrity gate solves the same drift problem joelclaw faces keeping 52 skills and a sprawling AGENTS.md honest across 110+ functions.
Joel’s own AGENTS.md is a sprawling single file trying to describe an architecture that spans 52 skills, 110+ Inngest functions, and a dozen packages. lat.md by Yury Selivanov names the problem directly: a flat file can describe a small project, but as a codebase grows, key decisions get buried and agents hallucinate context they should be able to look up.
The solution is a lat.md/ directory at the root of your project — a set of interconnected markdown files linked with [[wiki links]] syntax. Identical to what Obsidian uses. Source files reference back with // @lat: [[section-id]] comments, tying implementation to the concept being described. Then lat check validates that every link resolves and every required code reference exists. Documentation that drifts gets caught. That’s the integrity gate.
What makes this sharp is lat prompt "fix [[OAuth Flow]]" — it expands references inline, pulling the relevant sections from the graph into a prompt for agents. You’re not just describing your codebase, you’re making it queryable. lat search "how do we auth?" runs vector search across all sections. Exact match, fuzzy, and semantic — all wired together.
Selivanov is the creator of uvloop and EdgeDB. He’s not a note-taking person — he’s an infrastructure person. When someone who thinks at that level builds tooling around codebase documentation, it’s worth paying attention to.
Key Ideas
lat checkas a validation gate — catches dead links and missing code references before they become hallucination fuel for agents// @lat:code comments as bidirectional links — source files reference back to the knowledge graph, keeping implementation and docs connected[[wiki link]]syntax is Obsidian-compatible — the same format Joel already uses in the Vault, readable in any editor without toolinglat promptexpands refs into agent-ready context — compose prompts that pull live graph sections rather than copying stale docs- Semantic search over the full knowledge graph via OpenAI embeddings or Vercel AI Gateway
- Scales with the codebase — split knowledge across as many files as needed; wiki links keep navigation coherent
- The
lat.md/directory lives in git alongside code — knowledge graph is versioned with the system it describes - MCP server included — agents can query the graph directly via Model Context Protocol
Links
- lat.md repo
- Yury Selivanov on GitHub
- EdgeDB — Selivanov’s main project
- uvloop — his high-performance Python event loop
- lat.md on npm
- Obsidian — uses the same
[[wiki link]]syntax - joelclaw AGENTS.md — the flat-file problem this solves
- joelclaw skills directory — 52 skills that could map to a lat graph