vercel-labs/lat.md

Agent Lattice: a knowledge graph for your codebase, written in markdown.

What it solves

It addresses the scalability issues of using single flat files (like AGENTS.md) to document codebases for AI agents. As projects grow, monolithic documents become impractical, leading to buried design decisions, undocumented business logic, and agent hallucinations due to missing context.

How it works

The tool creates a knowledge graph consisting of interconnected markdown files stored in a lat.md/ directory. It uses a specific linking system where markdown sections link to each other and to specific source code symbols using [[wiki links]]. Conversely, source code files link back to the knowledge graph using // @lat: comments. A CLI tool provides utilities to initialize the graph, validate referential consistency (lat check), and perform semantic searches using either a local WebAssembly-based embedding model or hosted providers like OpenAI.

Who it’s for

It is designed for developers and AI coding agents who need a structured, maintainable way to track architecture, business logic, and test specifications within a codebase to ensure context is preserved across sessions.

Highlights

  • Bidirectional Linking: Connects high-level documentation directly to implementation details in the source code.
  • Enforced Consistency: The lat check command flags broken links or missing code references for required test specs.
  • Offline Semantic Search: Includes a bundled local embedding model (all-MiniLM-L6-v2) for search without requiring an API key.
  • Agent-Optimized Workflow: Provides CLI commands like lat expand to help agents resolve references in prompts and an MCP server for editor integration.

Related

  • Project
  • Project
  • Project
  • Project
  • Project