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.

  1. Scout Engine — walks the file system, respects .gitignore / .lcignore, extracts symbols and git history metadata, and assigns a priority score to every file.
  2. Knowledge Graph Engine — builds a directed graph of files, functions, classes, and their relationships (imports, calls, implements, extends).
  3. Vector Indexer — chunks code and generates embeddings via a local sentence-transformers model. Stored in a global LanceDB store.
  4. Context Compiler — assembles .ctx files (structured summaries) per module. These are what the MCP server reads.
  5. MCP Server — exposes the compiled context to any AI tool that speaks the Model Context Protocol, over stdio or SSE.
  6. Web Dashboard — a React UI for browsing the graph, ctx files, and metrics without leaving the browser.

Data Directory Layout

bash
.linear_canal_data/
└── <project-id>/
    ├── graph.db          ← SQLite knowledge graph
    ├── scores.json       ← file priority scores
    ├── ctx/              ← compiled .ctx files (one per module)
    ├── branches/         ← branch-scoped indexes
    └── manifest.json     ← project metadata
Architecture Overview | Linear Canal Docs | Linear Canal