← redevops.io
Draft · scheduled for later delivery · redevops.io

Context Runtime

The AI Query Planner: planning knowledge representations, retrieval, reasoning and execution
Where this fits. v7 introduces representation planning — documents, SQL, property graphs and temporal state as first-class representations, selected before retrieval, on the Execution Planner + Context Runtime boundary. The current system-level reference is Whitepaper v8; the canonical model is the Platform Architecture spec — where an older description here disagrees with the spec, the spec wins.
v7 is not another feature release. It names an architectural layer: a cost-based planner that, given only an application's intent, decides which knowledge representation, retrieval method, reasoning strategy, verification policy and execution plan to run - the way a relational query planner decides access paths. This is the PostgreSQL-query-planner argument for AI systems.

This is a draft, and a thesis. Where v5 shipped the mission kernel and v6 the DevOps operating system around it, v7 formalizes what the planner has quietly been all along and pushes it one level higher - from "which retriever" to "which representation of knowledge should answer this at all." The evidence is already published: the retrieval and reasoning benchmarks, and the property-graph work on real KYC data. Treat forward-looking phases as intent, not as completed guarantees; the implementation-status table separates what exists today from what is planned.

Abstract

The first generation of AI infrastructure optimized prompts. The second optimized retrieval. Our benchmarks demonstrate there is no universal best retriever, reasoning strategy or language model across workloads: the winner changes with the question, the corpus and the regime. Context Runtime raises the optimization one level. An application describes intent; the runtime selects the knowledge representation, retrieval method, reasoning strategy, verification policy and execution plan that measured outcomes say will answer it best, then learns from the result. v7 states this as a single architectural claim - the AI query planner - and supports it with formal planner interfaces, a property-graph case study on 182,445 real GLEIF entities, benchmark methodology, an implementation-status ledger, and a comparison with the frameworks it is often mistaken for.

1. What the benchmarks taught us

v7 starts from measurement, not from architecture. Two benchmark suites, both public and reproducible, converge on the same finding from opposite ends.

Retrieval. Across PopQA, MuSiQue, LongMemEval, TEMPO and a domain corpus, no single retriever wins: reasoning-retrieval (DIVER) leads multi-hop at 0.93 recall@4 while lexical ties it on lookup; a Russian domain corpus flips the ranking and a multilingual encoder wins; temporal-reasoning does not separate at retrieval at all. The routed policy tracks the column winner (CR-auto 0.97 on MuSiQue). The newest slice extends this to five engines on real KYC data: given a plain-English question the planner selects BM25, dense vectors, HippoRAG, SQL or the property graph, routing to the correct representation 94.9% of the time and the correct engine 91.5% of the time.

Reasoning. The reasoning suite shows the mirror image: retrieval is necessary, not sufficient. On TEMPO every retriever ties at 0.59 recall - the evidence is easy to find - yet a learned thinking pass over the full context lifts the answer from 0.79 to 1.00. And, honestly, the same thinking pass hurts multi-hop (0.79 to 0.71): effort is not free and not universally good. It is a per-class decision.

The lesson is one sentence: there is no universal best - only a best-for-this-workload, and the only way to know it is to measure and route. Both halves of the pipeline, retrieval and reasoning, are routing problems.

That is a planning statement. If the best access path to an answer depends on the query and the data, then choosing it is a planner's job - and we already have a mature discipline for exactly that shape of problem.

2. The query-planner argument

A relational database does not ask the application how to fetch rows. SQL is declarative: the application states what it wants, and a cost-based query planner decides how - sequential scan or index scan, nested-loop or hash join, which index, which join order - by consulting table statistics and a cost model, then picks the cheapest plan that satisfies the query. The application never changes when the planner picks a different path; the path changes as the data changes.

This is precisely the abstraction AI systems are missing. Today an application hard-codes its access path: it is a RAG pipeline, or it is a graph query, or it is a fixed agent loop. Context Runtime makes the access path a planning decision. The application states intent; the planner enumerates candidate ways to answer - representations, retrieval methods, reasoning strategies, verification policies - scores them against a measured cost model, and executes the plan that wins.

RELATIONAL QUERY PLANNER AI QUERY PLANNER SQL (declarative what)SELECT ... WHERE ... Intent (declarative what)goal · constraints · budget candidate plansseq scan · index scan · hash join candidate plansrepresentation × retriever × strategy cost modeltable statistics · row estimates cost modelmeasured value · cost · latency · risk chosen plan → executecheapest that satisfies chosen plan → execute → learnand feed the outcome back samesame
The two planners share one architecture. The only difference is what they choose between and how they learn: the database's statistics are updated by ANALYZE; the runtime's cost model is updated by every mission it runs.

The analogy is load-bearing, not decorative. It tells us what a mature version of this layer must have: an enumerable space of plans, a cost model grounded in statistics rather than intuition, an optimizer that prunes and selects, an EXPLAIN that makes the choice legible, and a feedback path that keeps the statistics honest. v7 claims each of these for AI, and the rest of the paper builds them out.

The planning stack

The planner is not one decision but a stack of them, each a measured routing choice, each with its own benchmark. From the application down to the knowledge systems:

Applications
   ↓  Mission planning        compose representations · verify · abstain or recommend
   ↓  Reasoning planning      which reasoning strategy · how much effort   → /benchmarks/reasoning
   ↓  Representation planning  which knowledge representation answers this   → /benchmarks/representation
   ↓  Retrieval planning       which retriever within that representation    → /benchmarks/retrieval
   ↓  Knowledge systems         documents · SQL · graphs · temporal · streams

Each layer is now measured. Retrieval planning (which retriever) and reasoning planning (which strategy, how much effort) are the two published suites. Representation planning - the decision above both, which this paper introduces - is measured by RepresentationBench: 300 curated enterprise questions across analytical, document, graph, temporal, code and multimodal, routed by the real planner at 92.7% representation-choice accuracy and 92.8% within-representation method routing, each decision sub-millisecond and legible. Mission planning - composing several representations into one verified decision - is the top of the stack; its benchmarks (KYC Go/No-Go, a harder matching-robustness half, and Retail restock over real Walmart demand) are shipped, and are deliberately built so the composed decision can be measurably wrong - real robustness numbers, not 100% by construction. The rest of this paper walks the stack.

3. Knowledge representations are access paths

Enterprise knowledge is not one shape. It lives as documents, relational tables, property graphs, temporal histories, multimodal assets, source code, operational systems and event streams. Each is a different access path to an answer, with a different cost profile and a different regime where it wins. The planner's first and highest-leverage decision is which representation a question needs - because that choice dominates everything downstream. Retrieving a document when the answer is a five-hop ownership chain is not a tuning error; it is the wrong access path.

RepresentationAccess paths (methods)Wins when the question is…
documentdense vectors · BM25 · hybrida fact stated in text; lexical for exact ids, dense for paraphrase
graph (reasoning)HippoRAG · SimGraphmulti-hop: the answer is in the connections between passages
graph (system of record)Cypher · Gremlinan exact, auditable traversal: ownership, UBO, entity links
analyticalSQL · Mongo · Elasticsearchan aggregate or a filter over a known schema (counts, rankings)
temporalGraphiti · state_at(T)point-in-time state: what was true then, what changed
multimodalCLIP · ColPali/ColQwenthe answer is in an image, a page render or a diagram
codeAST scope-graph"where is X defined", "what calls X" over a codebase

Two of these rows deserve emphasis because they are new in v7's telling. The graph representation now holds two engines that answer different questions - an approximate reasoning graph (HippoRAG) and a deterministic system-of-record graph (Cypher/Gremlin) - and the planner chooses between them by query shape. And the temporal representation reframes a large class of "retrieval" problems as state reconstruction: many production questions are not "find the document" but "reconstruct what was true at time T", which a bi-temporal store answers directly and a document index cannot.

4. The planner: decision flow, interfaces and scoring

The planner turns an intent into an executed plan through a fixed pipeline. It is the same lowering the runtime has always performed, now named, formal and back-compatible: intent analysis classifies the request to a representation; candidate generation enumerates the plans that representation admits (method × model tier × reasoning strategy × verification); a rule pass prunes the inadmissible and the policy-violating; the cost model scores the survivors; the optimizer selects; execution runs; and the measured outcome updates the model.

intent→ representation candidatesmethod×tier×strategy prunepolicy · feasibility scorecost model selectknapsack execute+ verify measure the outcomecost · value · latency · verified learnupdate statistics
The planner pipeline. The forward path (grey) enumerates and selects; the feedback path (amber) is what makes the cost model a learned one - every executed mission's measured outcome updates the statistics the next selection reads.

Formal interfaces

The layer is small and pluggable by design. Four interfaces define it; every retriever, model and estimator is an implementation behind one of them.

IntentAnalyzer.analyze(goal)            -> Intent{ bucket, representation, confidence }
CandidateGenerator.generate(intent,goal)-> [Candidate{ steps=[retrieve·rerank·route·reason·verify] }]
Estimator.estimate(candidate, goal)     -> PlanScore{ value, cost_usd, latency_s, risk, hallucination }
Optimizer.select([(cand, score)], goal) -> Plan{ chosen, rejected[(cand,reason)], score }

RetrieverPlugin.search(query, k, method)-> [Hit{ id, text, score, meta }]   # the access path

Scoring

Selection is a bounded optimization, not a heuristic. Each candidate is scored on a common utility and the optimizer picks the highest-value plan that fits the mission's budget and policy - a knapsack over admissible plans:

utility(plan)  =  w_v · value            # expected answer quality (recall × model accuracy)
               -  w_c · cost_usd
               -  w_l · latency_s
               -  w_r · risk             # hallucination, governance, sensitivity
   subject to:  cost ≤ budget,  sensitivity=restricted ⇒ tier=local,
                require_citations ⇒ a verify step exists

select        =  argmax utility(plan)  over the pruned candidate set

The value term is where routing lives. The estimator holds intent-aware priors - a graph engine's recall edge on multi-hop, the property graph's on ownership, SQL's on aggregates, a full-context thinking pass on temporal - so the specialist access path outscores the safe default exactly on the questions it is built for. Those priors are a cold start; the feedback loop refines them per deployment from measured value.

5. Representation composition

Single-representation questions are the easy case. Real decisions compose. The planner does not just pick one access path; it assembles several into one execution graph, gathers evidence from each, and hands a verifier the union. Three worked examples, two shipped and measured and one on the roadmap, show the same machinery at different scales.

intent: onboard "Acme"?planner composes representations property graphownership / UBO chain SQLregister counts · risk band documentadverse media sanctionsscreen every owner verify → gated Go / No-Goevidence: the chain + the screen, replayable
KYC as representation composition: four access paths, one governed decision. The Mission Runtime gates the outcome and keeps the traversal path plus the screen as replayable evidence.

6. Case study: the property graph

The property graph is the sharpest test of the thesis, because it is the representation most tempting to treat as a special integration. v7 treats it as an access path like any other, and the result is measured on real public data rather than asserted.

Ownership questions - "who ultimately owns and controls this business" - are variable-depth traversals up an ownership DAG, the one query shape relational stores are structurally worst at (a recursive join that re-scans per level) and a graph is best at (index-free adjacency, one pointer walk per hop). So the runtime gains two retrieval methods, cypher (Neo4j / openCypher) and gremlin (Neptune / TinkerPop), that map to the graph representation alongside the incumbent HippoRAG. Ownership phrasing routes to the deterministic engine; "how is X connected to the ring" still routes to the reasoning engine. Two graphs, chosen apart.

plannerrepresentation: graph method: graph (HippoRAG)reasoning · approximate · PPR method: cypher / gremlinGraphRetriever · parameter-bound Neo4j / Neptunesystem of record entity graph + PPRLLM-extracted cost modelselects measured outcome → learning
The property graph is a plugin behind the same RetrieverPlugin seam as every other engine. The cost model selects between the exact traversal and the reasoning graph by query shape; the graph database stays the system of record and the runtime stays the planner.

The retriever is safe by construction: the query value is always parameter-bound (it never touches the Cypher string), traversal depth is bounded, an optional row-scope predicate carries the permissions plane, and the full path is preserved on every result for audit. We loaded the GLEIF golden-copy relationship records - real corporate consolidation/control links - plus entity names, flagged against OpenSanctions, into Neo4j, and measured the unchanged retriever against it.

What we measured (real GLEIF + OpenSanctions)Result
graph loaded into Neo4j182,445 entities · 168,818 ownership edges · 3,765 sanctioned
the N-hop ownership traversal itself (index-free adjacency)0.53 ms
name → ultimate owner, CONTAINS scan vs full-text index67 ms → 7 ms
retriever vs ground-truth Cypher owner setidentical (exact)
planner routes plain-English question to the right enginerepresentation 94.9% · engine 91.5%

The finding that matters: the traversal was never the cost. The variable-depth walk on a six-figure graph is sub-millisecond; the only real cost was the seed lookup, which an index removes. And the planner distinctly selects the property graph for ownership while keeping HippoRAG for reasoning - the two-graph coexistence the thesis predicts, measured. Full numbers and methodology are on the retrieval benchmark.

7. Temporal knowledge as state reconstruction

A recurring category error in RAG is to treat a temporal question as a retrieval question. "What did we know about this account in Q1", "what changed after the policy update", "what was the ownership structure before the restructuring" are not searches for a document; they are reconstructions of state at a time. The runtime exposes this directly as state_at(T) over a bi-temporal store (Graphiti), so the temporal representation returns the world as it was, with provenance, rather than the latest chunk that happens to mention it. The reasoning benchmark makes the stakes concrete: on TEMPO the evidence is trivially findable (every retriever ties), and the entire lift comes from reasoning over the reconstructed state - which is why temporal is a representation the planner routes to, not a corner of document search.

8. Learning: the statistics stay honest

A cost-based planner is only as good as its statistics. A database runs ANALYZE; the runtime runs every mission. Selection is a contextual bandit keyed on the intent class: the estimator's priors give a cold start, and each executed plan's measured outcome - realized cost, latency, verified answer quality, and for missions the eventual success or reversal - updates the value the next selection reads. Two properties make this trustworthy rather than a black box. First, discounting: recency-weighted learning lets the model track drift (a model upgrade, a corpus shift, a price move) instead of being anchored by stale history - the drift benchmark shows this recovering most of the oracle reward where plain averaging does not. Second, legibility: EXPLAIN surfaces the full candidate menu for a class with each arm's cost prior and learned value, and flags the cost/quality Pareto frontier, so a routing decision reads as "the cheapest arm that answers this class," auditable after the fact.

The honest discipline: audit the evaluation before declaring a wall. A first reasoning ablation showed effort tiers not paying and apparent capacity ceilings - which auditing traced to evaluation artifacts (truncated context, a mislabeled dataset), not model limits. Removing that false wall reshaped the design. We publish the results that did not go our way.

9. Benchmark methodology

The benchmarks are built to be believed, not to flatter. Four principles govern them.

10. What this is, and is not

Context Runtime is regularly compared to tools it does not compete with, because they occupy adjacent layers. The distinction is the query-planner one: an orchestration framework lets you wire an access path; a graph database is one access path; the runtime chooses and composes access paths by measured cost. It sits above the frameworks and beside the stores, and it can drive both.

SystemWhat it isRelation to the query-planner layer
LangChainlibrary of components + chainsyou hand-wire the pipeline; the access path is fixed at author time. CR selects it at run time.
LangGraphstateful agent graph runtimeyou author the control flow; it executes what you drew. CR generates and scores the graph from intent.
CrewAI / AutoGenmulti-agent role orchestrationcoordinates agents; no cost model over representations. CR is the planner such agents could call.
Amazon Bedrockmanaged models + KBs + agentsa hosted single-path RAG/agent surface. CR is the routing layer over many paths, self-hostable, model-agnostic.
DSPycompile/optimize LM programsoptimizes prompts/weights for a fixed program. CR optimizes which program (representation+method) to run.
Neo4j / Neptunegraph databasesone excellent access path. CR routes to them when the question is a traversal - they stay the system of record.
PostgreSQL plannercost-based SQL optimizerthe intellectual template. CR is its analogue one layer up, over knowledge representations instead of table access paths.

None of these is a competitor to be beaten on a leaderboard; they are the ecosystem the planner routes over. The claim is architectural: the missing layer is not a better retriever or a better agent framework, it is the optimizer that decides which to use.

11. Implementation status

v7 names a layer that is partly built. This ledger separates what runs today from what is planned, so the thesis is read against evidence.

CapabilityStatus
Intent → representation classification; candidate generation; knapsack selection; EXPLAINshipped (v4)
Document (dense/BM25/hybrid), reasoning-graph (HippoRAG/SimGraph), temporal (Graphiti), analytical (SQL/Mongo/Elastic) pluginsshipped
Property-graph plugin (Cypher/Gremlin), cost-model routing priors, full-text seed, pooled drivershipped, benchmarked on real GLEIF/OpenSanctions
Online bandit routing with discounting; reasoning-effort ladder (self-consistency, refinement)shipped (v4/v6, opt-in)
Retrieval + reasoning + property-graph routing benchmarks, publishedlive on redevops.io/benchmarks
RepresentationBench (representation, now 300 questions across 6 representations incl. code + multimodal) + within-representation method routing + RepresentationBench-KYC (Go/No-Go, real GLEIF/OpenSanctions) + RepresentationBench-Retail (restock/abstain, real M5)shipped, published
Fuzzy/alias sanctions matching (near-match → abstain, jurisdiction disambiguation); end-to-end representation → retrieval → reasoning → mission trace on one workloadshipped, published
Entity resolution → golden records; versioned KYC/KYB ontology; hybrid SQL+graph executionplanned
Real vision arm for Retail (SKU-110K / DeepStream); OpenOwnership + SEC EDGAR ingestplanned (next)
Representation learning (learned selection beyond hand-set priors); world models; distributed executionresearch

12. Roadmap

The sequence extends the property-graph proof into the full composition - now demonstrated end to end, with the composed KYC and Retail decisions, the fuzzy/alias matching-robustness half, and a single-workload representation → retrieval → reasoning → mission trace all shipped and published - then into learning. Remaining near-term: entity resolution and golden records so the graph's nodes are trustworthy; versioned ontologies and schema packs; hybrid SQL+graph planning (aggregate in the store, traverse in the graph); a real Retail vision arm (SKU-110K / DeepStream); and OpenOwnership + SEC EDGAR ingest. Then: representation learning so selection improves beyond hand-set priors; and, further out, world models and distributed execution.

Conclusion

The first era of AI infrastructure optimized the prompt; the second optimized retrieval. Both assumed a fixed access path and tuned within it. The benchmarks say the access path itself is the decision: no retriever, reasoning strategy or model is universally best, so the winning move is to choose per workload and learn from the outcome. That is a query planner. Context Runtime v7 makes the knowledge access path a first-class, cost-based, learned planning decision - representations, retrieval, reasoning, verification and execution, chosen the way PostgreSQL chooses a scan. Applications describe the goal; the runtime decides how it is answered, shows its work, and gets better every time it runs.

Amendment (v10-era) — capability contracts, reference-first retrieval, harness strategy

These extend v7's planner-scoring and retrieval theses to serve the harness of v10.

Typed CapabilityDescriptor

The capability graph becomes model-facing through one contract — id · version · purpose · consumes · produces · pre/postconditions · deterministic · side_effects · required_runtimes · required_permissions · visibility · cost_model · latency_model · context_model · verification · retry_policy · idempotency · sandbox_profile · failure_types. An undeclared capability cannot be planned or executed. Cost/latency/context models feed the planner's scoring; the verification field carries the acceptance chain (v9).

Reference-first retrieval

ReDevOps RAG returns typed handles, not chunks: RetrievalResult carries evidence/artifact references, a bounded rationale preview, authority, temporal and contradiction status, and available expansions. Retrieval modes (preview-only, citation-only, structural-neighborhood, contradiction-sweep, full-rationale, dependency-expansion, historical-as-of, merge-evidence-bundle) are planner-selected. A new expected-context-value score — relevance + authority + structural_necessity + contradiction_value + unresolved_risk_value + expected_reuse − expansion_cost − privacy_risk — makes v10's Context-Precision and Expansion-Recall optimizable at retrieval time.

Harness-strategy candidates

The planner selects a harness strategy (DIRECT_TYPED_CALL · REFERENCE_AND_EXPAND · CODE_SANDBOX · DETERMINISTIC_ONLY · HIERARCHICAL_MERGE · HUMAN_GATED · LONG_LIVED_SESSION · FRESH_ISOLATED_SESSION) from object size, expected reuse, privacy, side effects, context limit, coupling, required verification, cache value, latency, cost, and worker reliability — the bridge from v8's execution topology to the v10 harness.

Context Runtime - private pitch. Not for distribution. © 2026 redevops.io  ·  Whitepaper v7 (draft) - The AI Query Planner
redevops.io is a member of the NVIDIA Inception program.
© 2026 NVIDIA, the NVIDIA logo, Nemotron, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.