R028 · Agent architecture › Memory and context

auto-ontology-mcp: a checked semantic layer and typed memory for any MCP client

Read the original

agent-memoryknowledge-managementretrievalagent-harnessagent-governancesemantic-layer

TL;DR

auto-ontology-mcp (Apache-2.0, an early personal project, not affiliated with NVIDIA; surfaced by André Lindenberg) ports NVIDIA Auto Ontology's semantic layer into an MCP server. Its design choice is the interesting part: every language step (naming business terms, reviewing joins, extracting facts, writing SQL) is done by the model in your MCP client, and the server keeps only deterministic work: scanning, profiling, key inference, validation, storage and read-only execution in local SQLite.

It does two jobs:

How it works

MCPvalidated writesoriginalsread-only

Client model
names Terms, reviews joins,
extracts facts, writes SQL

Server
scan, profile, infer keys,
validate, store, run read-only

ontology.db

knowledge.sqlite
records, passages, FTS5

Obsidian vault

Your databases

Catalog and keys. The server reads tables through SQLAlchemy, samples rows for top values, null rates, ranges and small enum sets, and infers undeclared foreign keys by name and value containment, including roles like billing_ vs delivery_. On the bundled demo it found 9 undeclared keys, auto-accepted 7, sent 1 self-reference for review and reported 1 it could not place.

Modeling. The model gets one table at a time with samples and Auto Ontology's modeling rules, proposes Terms and column mappings, and the server validates and stores them. Terms carry draft, certified or deprecated status; editing a certified Term returns it to draft.

Answering. check_answerable matches a question's entities to Terms and stored values and says when nothing covers a concept ("return on ad spend" with no ad-spend data). validate_sql then checks the query against the ontology and a dry run, and run_sql executes it read-only. Verified question and SQL pairs feed later answers and mined reusable measures.

Knowledge store. One writable SQLite file holds entities, concepts, passages and sources. Full originals stay in an Obsidian vault and passages link back to the heading they came from. A changed document replaces only its own passages; nothing is rebuilt. Concepts, relations and FTS5 indexes are ordinary tables, so one validated query can combine a text search, a recursive walk over relations and the records. Search is lexical (bm25, trigram) because there is no embedding model.

Safety. Connected databases are read-only in three layers: a SQL guard that allows one SELECT/WITH per call against the scanned catalog and blocks file and server functions, read-only connections, and rollback of every transaction. Queries time out at 30 seconds and return at most 500 rows.

Tradeoffs and failure modes

Implications

The broader pattern is worth copying even if you never install it: put a deterministic validator between the agent and any number it reports, and keep countable facts in typed storage with provenance rather than in prose memory.

Sources

Connections

See R028 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.