Skip to main content
Back

Open-Source lat.md Replaces AGENTS.md With a Smarter Knowledge Graph

lat.md replaces flat AGENTS.md files with a bidirectional knowledge graph that agents keep in sync, so context survives across sessions.

Pro

Repo, Full Access
  • lat.md replaces flat AGENTS.md files with a bidirectional knowledge graph of interconnected markdown files living in a lat.md/ directory.
  • Source code links back to the graph via // @lat: [[section-id]] comments; lat check enforces referential integrity and catches drift.
  • Agents use lat search (semantic vector search via embeddings) and lat section to navigate context without grepping the entire codebase.
  • Knowledge is persisted across sessions: agents update the graph as they work, so future sessions start with full context instead of rediscovering it.
  • Test specs can be marked require-code-mention: true, enforcing that every spec has a backlink in test code -- tracked by lat check.
  • Free, MIT-licensed, installable via npm install -g lat.md; v0.11 adds support for Codex, OpenCode, and Cursor. GitHub

AGENTS.md was a good idea that doesn't survive contact with a real codebase. Drop a single flat file into a growing project, and within weeks it becomes a graveyard of outdated decisions, buried constraints, and context that AI agents either miss or hallucinate around. lat.md is an open-source tool that replaces that single file with a structured, bidirectional knowledge graph, written entirely in plain markdown.

The problem it's solving

One of the core limitations of LLM-based coding agents is that they lack persistent memory. Across sessions they lose coherence, forget project conventions, and often repeat the same mistakes. This is one reason developers started introducing files like AGENTS.md or CLAUDE.md: a small set of instructions that every agent run loads before starting work.

For small repositories this works surprisingly well. But once a codebase grows, a single file becomes too limited. Architectural intent, subsystem behavior, and failure modes simply do not fit into one document. One developer on Hacker News described the experience perfectly: they had lots of .md files, custom skills for consistency checks, a test-audit skill for coverage gaps, a code-truth skill that worked backwards from code to documentation. All untethered from the actual code. Nothing connected a design decision in auth-flow.md to the function implementing it. Nothing told them when a renamed method made the docs fiction. So they became the binding, personally running consistency checks, running reconciliation, constantly worrying about drift. It didn't scale.

A graph, not a file