lat.md: A Markdown-Based Knowledge Graph for Codebases
Key point
lat.md is a tool that manages codebase context through a markdown-based knowledge graph, enhancing AI agent performance.
Details
The existing single-document approach (e.g., AGENTS.md) becomes difficult to maintain as a codebase grows, and key design decisions or business logic can be omitted, causing AI agents to infer incorrect context.
lat.md compresses a codebase's domain knowledge into a Knowledge Graph by generating interconnected markdown files in a lat.md/ directory at the project root. It links documents together via wiki-links ([[link]]) and adds // @lat: comments within source code to directly connect implementations to concepts.
This tool provides the following benefits:
- Faster agent work: Agents explore the knowledge graph instead of simple search (
grep) to quickly grasp design decisions and constraints. - Improved developer workflow: Before reviewing code changes, developers can first check the semantic changes recorded in
lat.md/to easily understand the intent behind the changes. - Knowledge retention and preservation: By recording context acquired by agents during work into the graph, the full context is preserved for the next session without needing to relearn everything from scratch.
- Enforced test specifications: Test cases are described in markdown and linked to code, allowing the
lat checkcommand to verify consistency between implementation and specification.
Through the lat CLI, you can initialize the environment (lat init), perform embedding-based semantic search (lat search), and run an MCP (Model Context Protocol) server to integrate with editors.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.