AI Codebase Understanding for Large Repositories
Give AI coding agents a persistent, evidence-backed understanding of a large codebase: call graphs, schemas, lineage and impact analysis over MCP.
AI coding agents read code well and remember it badly. On a large repository they spend most of a session finding things: which of thirty files mentioning customer defines it, who calls this function, which views read this table. Then the session ends and the next one starts over.
EKOS gives an agent a persistent understanding of the codebase. It compiles the repository once into structured knowledge, updates it incrementally as the code changes, and serves it over MCP.
What the agent gets
- Structure, not text. Modules, functions and their signatures, classes and inheritance, and, for Rust and SQL routines, a call graph.
- The database side too. Tables, columns, keys, views, stored procedures and triggers, plus which code reads and writes which table. A live Oracle, PostgreSQL or ClickHouse catalog can be read too, and where it disagrees with the code, EKOS records a conflict.
- Broken references.
ekos check refsreports names that resolve to nothing or to several objects, with file and line, as a table, JSON or SARIF for code scanning. - Lineage and impact.
ekos_impactfollows dependencies several hops out, so the agent can answer "what breaks if I rename this column?" before it renames it. - Evidence on every fact.
path:lineand the source fragment, so the agent can open the right file directly instead of searching for it. - History. Git authorship and co-change ("these files always change together"), and point-in-time queries over the knowledge itself.
Languages and sources
Rust, Python (including SQLAlchemy models and PySpark), JavaScript and TypeScript, Elixir, Perl and Java. Eight SQL dialects, plus PL/pgSQL, PL/SQL, dbt and Pentaho. Git and GitHub history, and documentation. Compiled .NET and JVM binaries are supported through a separately licensed extension. See Indexing a Repository and Indexing a Database.
Built for large, old systems
EKOS was tested on LedgerSMB, a twenty-year-old accounting system in PostgreSQL, PL/pgSQL and Perl. The schema's 212 stored routines, its views and triggers were all recovered from source, linked to the tables they read and write, and documented from the schema's own comments. The LedgerSMB demo goes further and recovers business meaning: what entity_class = 2 means, which filters define an "open order". It exports the result as a LinkML schema.
It was also tested on iDempiere, an Oracle-backed Java ERP. All 4,542 Java files of release-13 parsed, and the generated model classes became 763 application tables with 16,660 columns. All 61 PL/SQL routines in db/oracle were recovered, 60 of them completely. Of 62,251 statements in the Oracle migration scripts, 9 were rejected. No language model was called.
Fewer tokens, measured
Answering real questions about a 2,022-file repository from the compiled ledger cost 67–93% fewer tokens than searching raw source. Compiling that repository from cold took 34 seconds. Methodology and the one case where grep wins: benchmarks.
Try it on your repository
curl -fsSL https://raw.githubusercontent.com/alexeyban/EKOS/main/install.sh | sh
cd /path/to/repo && ekos init --detect
ekos build && ekos recover && ekos resolve && ekos compile && ekos commit
ekos coverage # which input kinds compiled, and which produced nothing
Then connect your agent. Comparing code knowledge-graph servers? See codebase-memory-mcp vs EKOS.
Frequently asked questions
How do AI coding agents understand a large codebase?
Without help, by searching: grep, open files, guess, and forget it all when the session ends. With a knowledge layer such as EKOS, the repository is compiled once into modules, symbols, a call graph, database objects and lineage. The agent queries that over MCP and gets path:line evidence it can open directly.
Does EKOS work with legacy databases and stored procedures?
Yes. It recovers tables, keys, views, stored procedures and triggers from SQL source in eight dialects plus PL/pgSQL and PL/SQL, and links each procedure to the tables it reads and writes. It can also read a live Oracle, PostgreSQL or ClickHouse catalog. On LedgerSMB it recovered all 212 stored routines from source.
How does EKOS stay current as the code changes?
You rerun the pipeline. It is incremental: unchanged inputs are cached. ekos status reports when the source has changed since the last commit, and agents see the same note on their results.
How many tokens does it save?
On a 2,022-file repository, answering realistic questions from the compiled ledger took 67–93% fewer tokens than searching raw source. When the agent already knows the exact line, a plain grep is cheaper, and that result is published too.