EKOS
EKOS / AI Knowledge Layer for Enterprise Systems

AI Knowledge Layer for Enterprise Systems

An open-source knowledge layer for AI agents: EKOS compiles code, SQL, docs and Git history into evidence-backed knowledge agents query over MCP.

AI agents are good at reasoning and bad at remembering. Every session they rediscover your systems from scratch: they grep the repository, open files, guess which table is the real one, and forget all of it when the session ends. An AI knowledge layer sits between your systems and your agents. It holds what is already known about those systems, in a form an agent can query directly, and it says where each fact came from.

EKOS is an open-source knowledge layer built as a knowledge compiler. It reads your systems, compiles what it finds into structured, traceable knowledge, and serves it to agents over the Model Context Protocol (MCP).

Why retrieval over raw text is not enough

Retrieval-augmented generation (RAG) indexes chunks of text and hands the closest ones to a model. That works for prose. It fits enterprise systems poorly, for three reasons:

  • Structure is lost. A foreign key, a call from one function to another, or a view that reads three tables is a relationship. A text chunk is not one.
  • Nothing is checkable. A retrieved chunk is evidence, not a conclusion, and an answer stitched from chunks rarely says which line it rests on.
  • The work is repeated. Every question re-reads source code that was already read last time.

EKOS does the reading once. It compiles source code into objects, relationships and evidence, and agents query that result.

What EKOS compiles

Source What becomes knowledge
Source code — Rust, Python, JavaScript/TypeScript, Elixir, Perl, Java modules, symbols, signatures; a call graph for Rust; SQL built in Java methods, linked to the tables it reads and writes
SQL — PostgreSQL, MySQL, SQL Server, Snowflake, Databricks, ClickHouse, Trino, Oracle; PL/pgSQL and PL/SQL tables, columns, keys, views, stored procedures, triggers, column-level lineage, schema history from migration scripts
Live databases — Oracle, PostgreSQL, ClickHouse the catalog, read in a read-only session, compared with what the code and scripts claim
ETL and analytics — dbt, Pentaho models, transformations, filters, data lineage
Git and GitHub history, authorship, co-change, issues and pull requests
Documentation — Markdown, PDF, DOCX, HTML, Confluence sections, glossaries, links from docs to the code they describe

The whole list, with configuration, is in Knowledge Sources.

Every answer carries its evidence

Each compiled fact keeps the evidence it came from: a file, a line and the fragment itself. Knowledge is stored in an append-only ledger, so nothing is overwritten. You can ask what a fact looked like last month, and which run wrote it. When EKOS is unsure, for example whether two similarly named tables are the same thing, it records an unconfirmed claim for a person to review. It never merges them silently. Before anything is built on the model, a person can sign it off, subject by subject; a sign-off stops counting as soon as a fact under it changes. See Provenance and Human Review.

How it works

  1. Observe: connectors read code, schemas, history and documents without interpreting them. Secrets and personal data are redacted before anything is stored.
  2. Compile: deterministic passes recover structure: tables, calls, lineage, documentation links.
  3. Resolve: the same thing seen in several places becomes one object.
  4. Commit: the result goes into the append-only knowledge ledger.
  5. Query: agents read it over MCP, read-only.

More detail: How EKOS Works and System Overview.

Connect an agent

curl -fsSL https://raw.githubusercontent.com/alexeyban/EKOS/main/install.sh | sh
cd /path/to/project && ekos init --detect
ekos build && ekos recover && ekos resolve && ekos compile && ekos commit
claude mcp add ekos -- ekos --config "$PWD/ekos.toml" mcp serve --workspace "$PWD"

The same server works with VS Code / GitHub Copilot, Visual Studio and ChatGPT over HTTP: see MCP server for enterprise knowledge.

Other ways to build a knowledge layer

A knowledge layer can also be a modelled knowledge graph or a governed metadata catalog. Which one fits depends on what is hard in your organization: the domain model, governance, or knowing what the systems actually do. See Enterprise knowledge layer: three approaches compared. For code alone, see codebase-memory-mcp vs EKOS.

Frequently asked questions

What is an AI knowledge layer?

A layer between an organization's systems and its AI agents that holds what is already known about those systems, in a form an agent can query directly, with the source of each fact. Agents ask it instead of re-reading code, schemas and documents in every session.

How is a knowledge layer different from RAG?

RAG retrieves chunks of text that resemble a question. A knowledge layer holds structured facts: tables and their keys, which function calls which, which view reads which table. Each fact carries its evidence, so an answer can follow relationships and be checked against the source.

Is EKOS open source?

Yes. EKOS is open source under the MIT license, written in Rust, and runs on your own machine or server. Agents connect to it over the Model Context Protocol (MCP).

Which AI agents can use EKOS?

Any MCP client. Claude Code and desktop clients connect over stdio. VS Code with GitHub Copilot, Visual Studio and ChatGPT connect over Streamable HTTP.

Does EKOS send my code to a language model?

Not to compile it. Compilation is deterministic and needs no model. Language-model features, such as generated descriptions or ekos ask, are opt-in and can run on a local Ollama model. Each pipeline run writes a log that ends with the number of model calls it made. Secrets and personal data are redacted before anything is stored.

Quickstart → Documentation → GitHub →