Documents, SQL, Graphs and Time: AI Needs More Than One Way to Think
The AI-infrastructure conversation fixates on bigger models and better prompts. But a whole class of enterprise problems is about relationships.
This is the sequel to why the runtime started routing knowledge instead of retrieving it. That post routed between documents, a reasoning graph and temporal memory; here we add the missing representation, a deterministic property graph, and measure it on a real public ownership dataset.
The short version:
- KYC / KYB / sanctions / ownership questions are graph traversals.
- To the existing reasoning graph (HippoRAG) we added a system-of-record graph (Cypher/Gremlin over Neo4j/Neptune) as a second backend of the same
graphrepresentation. - On 182,445 real GLEIF entities with 168,818 ownership edges, the variable-depth traversal runs in 0.53 ms; name → ultimate owner in 7 ms with a full-text index.
- From a plain-English question the planner picks the right engine: BM25, dense vectors, HippoRAG, SQL, or the property graph, 91.5% of the time (representation routing 94.9%); we publish the misroutes too.
Relationships are the product
KYC, KYB, fraud detection, supply-chain risk, sanctions screening and ownership analysis all ask the same question:
Who is connected to whom, through what path, and can we prove it?
When onboarding a business, the question is who ultimately owns and controls it, often through cross-border holding companies; sanctions on the company itself rarely settle it. Those are graph traversals, variable-depth, relationship-first, pattern-based: exactly what a relational database is worst at (a recursive join re-scanning at every level) and a property graph is best at (index-free adjacency, every hop a pointer walk).
Two different kinds of graph
Context Runtime already supported reasoning graphs like HippoRAG that improve retrieval quality. Property graphs serve a different purpose: systems of record giving deterministic traversals, exact ownership chains, auditable evidence.
| Reasoning graph (HippoRAG) | Property graph (this work) | |
|---|---|---|
| Built by | LLM entity/relation extraction | Curated ingest + entity resolution |
| Query | Personalized PageRank ranking | Deterministic Cypher/Gremlin traversal |
| Correctness | Approximate: great for "find relevant context" | Exact: the answer a regulator audits |
| Good for | "Explain the risk network around X" | "What is the exact ownership chain of X" |
| Miss an edge | Slightly worse RAG | Wrong onboarding decision → liability |
They are complementary. A serious KYC deployment runs both, and the runtime should decide which one a question needs.
Property graphs become another representation
Context Runtime views a property graph the way it views SQL, vector search or temporal history: a knowledge representation the planner can choose.
We added two retrieval methods, cypher (Neo4j / openCypher / Memgraph) and gremlin (Amazon Neptune / TinkerPop), mapping to the existing graph representation alongside the incumbent HippoRAG graph. Ownership phrasing ("ultimate beneficial owner", "who owns", "parent company", "controlled by") now routes there, and the cost model learned to value the specialist engine: the same mechanism that routes HippoRAG for multi-hop and Graphiti for temporal. So "who ultimately owns Acme Corp" selects the property graph while "how is Acme connected to the fraud ring" still selects HippoRAG.
The retriever is small and safe by construction: the query value is always parameter-bound (never touching the Cypher string), the traversal is depth-bounded, an optional row-scope predicate carries the permissions plane, and the full ownership path is preserved on every result for audit.
Why this belongs in Context Runtime
Neo4j answers a graph query. Context Runtime decides whether to query the graph at all: whether more evidence is needed, whether to verify the answer, whether Mission Runtime should require human approval, and how to replay the decision later. The graph database stays the system of record; Context Runtime becomes the execution planner.
What we built, and measured on real data
We loaded the GLEIF golden-copy relationship records (real corporate consolidation/control links between legal entities) plus GLEIF entity names into Neo4j, flagged against OpenSanctions targets:
182,445 real entities · 168,818 ownership edges · 99.99% named · 3,765 sanctioned
The retriever (unchanged from its unit tests) resolves real ultimate-owner chains:
It also surfaces sanctioned entities inside ownership chains (one consolidated by UniCredit; DB USA Corporation under Deutsche Bank). Against a ground-truth Cypher walk it returns the identical owner set; a DETACH DELETE payload sent as a query is bound as a value, not executed (the graph is untouched).
Result 1: the lookup is the cost
Per-seed median over 300 real ownership queries on the 182k-entity graph:
The variable-depth walk on a six-figure graph is sub-millisecond; the only real cost is finding the seed by name, where a full-text index turns a 67 ms scan into a 7 ms lookup, inside a millisecond-class "Go / No-Go" onboarding budget. That drove two production changes: a pooled driver and a full-text seed-match option.
Result 2: the planner actually chooses between five engines
We ran 59 labelled KYC/KYB queries through the real planner (intent → representation → cost-model selection) and read back the selected plan's engine:
Per class: reasoning-graph, lexical, temporal and document all 100%; property-graph 83%, analytical 80%, conceptual 75%. Crucially, HippoRAG and the property graph, two backends of the same representation, are chosen distinctly for reasoning vs ownership questions.
We did not tune the failures away. All six misroutes are legible: across is a multi-hop trigger that pulls an aggregate onto the graph path; ownership as an abstract noun over-fires the graph hint on a definitional question. A benchmark reporting 90% with a readable failure taxonomy beats a fitted 100%.
What's next
GLEIF gives entity-level consolidation: the corporate control graph. Person-level ultimate beneficial owners want OpenOwnership (BODS) and SEC EDGAR filings loaded the same way; the ontology grows, and the loader and retriever remain. The larger goal: bind all five engines over this data and measure end-to-end onboarding quality (decision accuracy and explainability) with the online bandit learning method selection from real feedback.
The objective was the runtime above the graph database. It's making property graphs a first-class knowledge representation the runtime can automatically combine with every other representation, and now one we can show it choosing, correctly and in milliseconds, on real data.
Reproducible: the property-graph plugin and both benchmarks live in the Context Runtime repos; the loader pulls public GLEIF + OpenSanctions data into Neo4j. See the retrieval benchmarks for the routing and traversal numbers in context.
Data sources and licensing: GLEIF golden-copy is CC0 1.0 (public domain); OpenSanctions is CC-BY-NC 4.0 and is used here for non-commercial research only; commercial or compliance deployment requires a separate OpenSanctions data license. These datasets are used only to develop and benchmark the runtime itself; they are never redistributed, embedded in the product, or part of a customer deployment; Context Runtime customers apply it to their own data. Loaders download the data on demand.