Architecture Overview
How Linear Canal builds and maintains codebase intelligence.
The 6-Layer Pipeline
Linear Canal processes your codebase through six sequential engines. Each layer enriches the data produced by the previous one.
- Scout Engine — walks the file system, respects
.gitignore/.lcignore, extracts symbols and git history metadata, and assigns a priority score to every file. - Knowledge Graph Engine — builds a directed graph of files, functions, classes, and their relationships (imports, calls, implements, extends).
- Vector Indexer — chunks code and generates embeddings via a local sentence-transformers model. Stored in a global LanceDB store.
- Context Compiler — assembles
.ctxfiles (structured summaries) per module. These are what the MCP server reads. - MCP Server — exposes the compiled context to any AI tool that speaks the Model Context Protocol, over stdio or SSE.
- Web Dashboard — a React UI for browsing the graph, ctx files, and metrics without leaving the browser.
Data Directory Layout
bash