An agent's answer is only as good as what it knows about your data
EKOS reads your schemas, stored procedures, ETL jobs, application code and documents, and compiles them into one semantic model: what each table and code value means, how tables join, where every fact was read, and which meanings a person has confirmed. Agents query it over MCP. No model call is needed to build it.
Six things an agent has to know before it writes a query
A schema dump answers the second of them. EKOS compiles all six, and marks the difference between what a source states and what was inferred from it.
| Question | In EKOS | Where it comes from |
|---|---|---|
| What does it mean? | Concept, code meaning | Table and column comments, CHECK constraints, seed rows, filters in views, procedures and ETL steps, glossaries, an imported Ossie or LinkML model |
| Where is it? | Table, column | DDL files, migration scripts, live catalogs of PostgreSQL, Oracle and ClickHouse, ORM models |
| What is connected? | Relationship | Declared foreign keys, plus candidate keys found in the data that stay candidates until a person accepts them |
| How is it calculated? | Metric, transformation | Metrics from an imported Ossie model, and the logic recovered from views, stored procedures, dbt, Pentaho and Talend jobs |
| Where does it come from? | Evidence, lineage | Every object keeps the file and line, statement or commit it was read from; column lineage through SQL and ETL |
| Can I rely on it? | Status, conflict, sign-off | A meaning is a hypothesis until a person confirms it. Where two sources disagree, both claims are kept and the answer is marked disputed |
Compiled by parsers, reviewed by people, read by agents
The model is the output of deterministic passes, so the same sources give the same model. A language model is optional and only ever adds text that cites what it read.
Observe
Connectors read SQL files, live catalogs, code, ETL jobs, documents and Git history as they are. Secrets are redacted on the way in.
no modelCompile
Parsers recover tables, keys, routines, lineage and the meaning carried by constraints, comments and filters.
no modelProfile
Optional read-only queries count values and test candidate keys. Counts and code values leave the database, row data does not.
optionalReview
People confirm or reject meanings, settle conflicts and sign off the model. An agent cannot do this over MCP.
people onlyServe
Agents read the ledger over MCP, the CLI or Python. The same model exports to Apache Ossie, LinkML and dbt.
read-onlyA graph you can open, with the source of each fact beside it
This is LedgerSMB, an open-source accounting system, compiled from its repository:
12,058 objects, among them 184 tables and 556 stored routines. The table acc_trans
is selected. Its panel shows the statements it was read from, with file and line.
acc_trans: the CREATE TABLE statement and three COMMENT ON statements in sql/Pg-database.sql, lines 1142 and 1146 among them.
acc_trans: 135 relationships to the routines that read and write it, the tables it references and the meanings attached to it.
When two sources disagree, EKOS says so
LedgerSMB labels order class 1 as sales_order in one place,
customer in another and Sales Order in a third. EKOS keeps all three
claims with their evidence and picks none. An answer that depends on a disputed fact carries
disputed: true, so the agent can say so too.
Same model, same question. One query knew what the column holds.
Across laboratory records with PLT > 400 for female patients whose patient profile lists an SLE diagnosis, what is the average ALB value rounded to four decimal places?
Raw schema in the prompt
SELECT ROUND(AVG(L.ALB), 4) FROM Laboratory AS L JOIN Patient AS P ON L.ID = P.ID WHERE P.SEX = 'F' AND P.Diagnosis = 'SLE' AND L.PLT > 400
Wrong result. The diagnosis column holds lists such as SLE, APS, so an equality test drops most of the patients.
EKOS context in the prompt
SELECT ROUND(AVG(L.ALB), 4) AS avg_alb FROM Laboratory AS L JOIN Patient AS P ON L.ID = P.ID WHERE P.SEX = 'F' AND P.Diagnosis LIKE '%SLE%' AND L.PLT > 400
Correct result. The context names the stored values that match SLE, so the model writes the filter the data needs.
Question 383 of the BIRD Mini-Dev hold-out split, database thrombosis_prediction, Claude Haiku 5.5 on both sides. Both queries and all 302 questions are in the full report. Benchmark © the BIRD team, CC BY-SA 4.0.
Each layer of knowledge and checking adds accuracy
Execution accuracy on the BIRD Mini-Dev hold-out split: 302 questions that were not used for tuning, 11 databases, one model throughout (Claude Haiku 5.5). Only what the model is given changes.
| Comparison | Difference | 95% interval | McNemar p | Cost of the run |
|---|---|---|---|---|
| EKOS context vs raw schema | +10.6 points | +4.3 to +16.9 | 0.0014 | $0.30 vs $0.20 |
| Agent with checks vs context with descriptions | +4.6 points | 0.0 to +9.3 | 0.06 | $0.78 vs $0.35 |
| Agent with checks vs raw schema | +22.9 points | $0.78 vs $0.20 |
The last step is not significant at the 5% level on this split, and the report says so. On the full BIRD dev set (1,534 questions, one answer per question, no fine-tuning) the same setup scores 66.2% with Claude Haiku 5.5 for $3.20, and 74.3% with Claude Sonnet 5.5 on a 300-question sample. Method, per-database results and every failed question: BIRD Mini-Dev report, how a question is answered, reproduction repository.
Apache Ossie in, Apache Ossie out
EKOS exports the compiled model as an Apache Ossie
semantic model and reads Ossie models others wrote (guide). A table is exported as an observed fact.
A meaning is exported with its review status, so nobody downstream mistakes a hypothesis for
a definition. Edit statuses in the file and ekos import ossie turns the edits into
review decisions.
ekos export ossie, LedgerSMB, excerpt
- name: account_link_description source: account_link_description primary_key: - description description: |- This is a lookup table which provide basic information as to categories and dropdowns of accounts. ... ai_context: instructions: 'Business concept "AccountLinkDescriptionSummary" (hypothesis, unreviewed): account_link_description.summary IS TRUE' fields: - name: summary expression: { sql: summary } datatype: Boolean custom_extensions: - vendor_name: EKOS data: '{"kind":"Table","status":"observed", "evidence":["sql/Pg-database.sql:128"], ...}'
- Exports are checked against Apache Ossie's own
validate.pyin CI. - An imported model's synonyms, declared joins and metrics feed text-to-SQL,
ekos askand the dbt semantic-layer export. A metric is never invented. - Where an imported model names a column the schema lacks, that is reported as a conflict.
- The same meanings export to LinkML for teams that keep their vocabulary there.
MCP, command line or Python, all read-only
| Job | MCP tools |
|---|---|
| Find | ekos_search, ekos_ekl, ekos_state: objects by text, meaning or a typed query, with evidence |
| Meaning | ekos_semantics_lookup, ekos_semantics_gaps: what a term or code means, with its review status in words |
| Connections | ekos_neighborhood, ekos_dependents, ekos_impact, ekos_relationships |
| Trust | ekos_conflicts, ekos_signoff_status, ekos_audit |
| Answers | ekos_query, ekos_retrieve: a compiled answer and the evidence set behind it, no model call |
| SQL | ekos_sql_check: lint a query against the schema, keys and stored values before it runs |
| Exchange | ekos_ossie_export |
Any MCP client
ekos mcp serve --workspace .
# or over HTTP for URL-only clients
ekos mcp serve --workspace . --http 127.0.0.1:7410
Any MCP client connects to it, over stdio, TCP or HTTP. MCP guide
Python, in-process
pip install ekos import ekos kb = ekos.open(".") hit = kb.search("acc_trans")[0] print(kb.get(hit.id).evidence)
Reads a compiled ledger without a server. Python guide
It pays off when the data is larger than the prompt
Use it when
- The schema has hundreds of tables and the names do not explain themselves.
- Meaning lives in code: procedures, ETL jobs, constraints, seed data.
- Several systems describe the same thing differently.
- Answers must show where they came from.
You may not need it when
- There is one small, well-named schema and a fixed set of questions.
- A maintained semantic model already covers every question asked.
What it does not do
- It does not confirm a definition for you. That is a person's decision.
- It does not invent a metric or a join. What no source states stays a gap.
- It does not send your data anywhere. It runs on your machine.
The semantic layer is one use of the compiled knowledge
Generates a PostgreSQL or Oracle to Apache Iceberg pipeline, with dbt models and marts, from the signed-off model.
Legacy ETL to dbtPentaho and Talend jobs recovered step by step and translated to dbt, with what could not be translated listed.
Codebase understandingThe same graph over application code: calls, modules, dependencies, and what breaks if something changes.
Compile your own schema in a few minutes
One binary, open source, MIT licence. Point it at a repository or a database and open the graph.