← redevops.io
Private pitch · redevops.io

Context Runtime

Knowledge-Aware Execution Planning
Where this fits. v4–v6 introduce governed mission execution — the mission as the unit of execution, event-sourced state, the execution graph, simulation, approvals, replay and saga. 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.
The decision engine no longer begins by choosing a retriever. It first determines which knowledge representation can answer the request, then optimizes the physical access method within that representation.

Thesis

Every generation of Context Runtime through v3 answered variations of a single question — how should the runtime execute? v4 changes the question itself:

v3   →   How should the runtime execute?
         (which plan, which model, under which policy, at what cost)

v4   →   What knowledge representation must the runtime reason over
         BEFORE an execution plan can even exist?

That is not another capability bolted onto execution planning — it is a new stage above it. v3 optimizes execution; v4 decides what kind of knowledge the question is even about, and only then hands a representation-scoped problem down to the planning machinery below. We call the component as a whole the decision engine: earlier generations called it the planner, but selecting an execution plan is now only one of its jobs. It is the difference between a better query plan and choosing which engine class the query belongs to in the first place.

What kind of knowledge is required before an execution plan can even exist?

Production AI no longer operates over documents alone. It operates over documents, graphs, temporal history, analytical warehouses, codebases, images, video, and continuously changing operational data. Retrieval is therefore not the optimization target — knowledge representation is. Retrieval becomes a lower-level physical planning decision within each representation.

Compatibility with v2. Whitepaper v2 modeled sparse, dense, hybrid, graph and memory as peer retrieval arms. That remains the physical execution layer. v4 adds a logical planning stage above it: the decision engine first selects a knowledge representation, then evaluates the retrieval methods available within it — analogous to a database separating a logical relation from its physical scan operator. v4 extends v2; it does not reclassify or invalidate it.

LOGICAL — chosen firstPHYSICAL — within the representationDocumentflat text · the RAG defaultBM25 · Dense · Hybrid RRFGraphentities & relationshipsPersonalized PageRankTemporalfacts with validity intervalsas-of / point-in-timeAnalyticalaggregates over storesSQL · Mongo · ElasticsearchVisionvisual & multimodal contentColPali · videoCodesymbols · ASTs · call graphsAST / symbol graph
The decision engine chooses a knowledge representation first (logical); each representation owns the physical access method it is searched by. Retrieval is an implementation detail within a representation, not a peer choice.

Why retrieval stops scaling

Early RAG systems assumed every answer lived inside documents. That assumption breaks for production systems, where the same question can require entirely different representations of knowledge:

QuestionRepresentation required
"What changed between March and May?"Temporal
"What depended on this requirement?"Graph
"What was promised to this customer?"Conversation history
"Show revenue by region."Analytical (OLAP)
"Why did inventory disappear?"Multi-source analytical

These are not different retrievers over the same store — they are different representations of knowledge. A decision engine that treats them all as document search returns the plausible-but-wrong answer. The decision engine must select the representation before it optimizes retrieval.

From retrieval planning to knowledge planning

The shift is one stage, inserted at the top of the decision engine — and it composes with every capability the earlier generations added rather than replacing them.

Intentthe request, unscopedPolicy-scoped capability registryprincipal may not even see forbidden reps← policy: scopeKnowledge representationwhich kind of knowledge answers this← new in v4Candidate plansmethods that specialize the representationPlan-level policy validationrows · budgets · residency · approvals← policy: validateCost modelmeasured, not assumed← Gen. 2Executionthe chosen plan's minimal surfaceMeasurement + learningreward feeds representation selection← online, Gen. 4
Knowledge-aware planning inserts one logical stage — representation selection — above the v2/v3 machinery. Policy applies twice: it scopes the registry before candidates exist, then validates the plan. A single deployment runs every generation at once.

Policy is applied twice, for two different jobs. First a policy-scoped capability registry removes the representations, sources and plugins the principal may not use — so a user without CRM or medical access never has those representations even considered as candidates. Then, once candidate plans exist, plan-level validation checks the execution-specific constraints: row access, budgets, data residency and approvals. This preserves v3’s rule — a prohibited plan is never part of the feasible search space — and prevents the decision engine from ever learning unauthorized capability availability through timing, EXPLAIN output or rejected-plan metadata. v4 does not replace v3’s governance or v2’s measured cost model; it feeds them a richer, already-scoped decision. A single deployment runs every generation at once.

How it is wired (shipped in the core). Knowledge-aware planning is three concrete stages, not a rewrite of the ones below it:

  1. Classify — the intent analyzer emits a KnowledgeRepresentation alongside the intent bucket, and is hybrid: a fast keyword head resolves explicit cues for free, and an LLM head fires only when the keyword head is unsure (it defaulted to document or was low-confidence) — the implicit multi-hop or temporal intent a keyword rule cannot see. Content signals reach representations no bucket produces on its own: “how many… per week” or “records in the orders table where…” → the analytical (structured-store) representation, which routes to the plugged-in database's retriever — SQL, or MongoDB / Elasticsearch where SQL is not applicable; “what’s in this screenshot” → multimodal.
  2. Constrain — candidate generation is restricted to the methods that specialize the chosen representation (methods_for(representation)) instead of a flat per-bucket table, plus a document fallback so a missing or infeasible representation engine degrades gracefully.
  3. Record & learn — the representation is recorded on the plan, the EXPLAIN trace and the outcome event. Because a routed plan keeps its document fallback, the online bandit’s arms span two representations, so choosing between them is representation selection — learned per context from measured reward, exactly the v3 loop applied one level up.

Every decision the engine makes is inspectable in one trace — representation choice included:

EXPLAIN
├── representation decision
├── candidate execution plans
├── physical retrieval / access methods
├── policy decisions
├── estimated vs actual measurements
└── reward provenance

Learning is cumulative, not replaced each generation: Gen. 1 introduced the bandit seam, v2 added measured evidence and quality-aware routing, v3 added controlled exploration under drift, and v4 applies the same loop to representation selection.

Measured — v4 routing benchmark (real HippoRAG + Graphiti, three graph regimes). The hybrid keyword+model head routes at 1.00 / 0.90 / 1.00 (document / graph / temporal) versus the keyword head alone at 0.95 / 0.00 / 0.00 — and holds on a shuffled 45-query interleaved stream (1.00 / 0.93 / 1.00): genuine per-query routing, not per-dataset memorization. On multi-hop, real HippoRAG lifts gold-recall 0.650 → 0.988. On answer quality (independent judge), CR-routed context ties full-context dumping at roughly a third of the tokens and beats naïve retrieval by +0.206 — better context ≈ more context, far cheaper. Temporal routing is validated; the Graphiti engine earns its keep at haystack scale (on a tiny oracle set, hybrid retrieval dominates it).

Knowledge representations

The organizing concept of v4 is not a list of retrievers — it is a small, ordered set of knowledge representations. A request is assigned a primary knowledge representation, while the decision engine may retain fallback candidates from other representations; that choice, not the retrieval algorithm, is what the decision engine decides first.

Documents          flat text · the RAG default
   ↓
Graphs             entities and the relationships between them
   ↓
Temporal history   facts with validity intervals — what changed, and when
   ↓
OLAP               aggregates over columnar warehouses
   ↓
Images / Vision    visual and multimodal content
   ↓
Code               symbols, ASTs, call graphs
   ↓
Community          global summaries over a corpus

Retrieval is an implementation detail within each representation. "Hybrid search," "Personalized PageRank," "as-of query," "materialized-view scan" are not competing retrievers the decision engine chooses between — they are how their respective representations happen to be searched. The decision engine reasons one level up: it picks the representation; the representation owns its retrieval.

Each representation currently binds through the existing RetrieverPlugin compatibility seam, so the decision engine routes across them and the application never changes. The broader abstraction is a KnowledgePlugin, whose operation may be retrieval, structured query, graph traversal or multimodal analysis — the present interface may be renamed later, but the routing semantics are already representation-first. The engine behind a representation is replaceable — a reference implementation ships in the open core; a heavier or proprietary engine binds at construction time.

RepresentationOpen-core referenceOptional / enterprise bindingCore statusBinding status
Documenthybrid (BM25 + dense + RRF)ReDevOps-RAGShippedAvailable
GraphSimGraph (2-hop spreading)HippoRAG (PPR)ShippedOptional
Temporalin-memory bi-temporal storeGraphitiShippedOptional
Communitycommunity summariesGraphRAGShippedOptional
Conversational memory3-index chat memory—Shipped—
Analytical (structured store)generic structured-store seamDoris · Postgres · ClickHouse · MongoDB · ElasticsearchRoadmap / partialDoris enterprise binding exists
Codehybrid + code routingAST / symbol graphPartialRoadmap
Vision / Imagemultimodal retrieverColPali / videoPartialOptional

The decision engine selects among these by intent, policy, and measured cost — exactly the machinery from v2/v3, now ranging over representations instead of only document-retrieval methods. Adding a representation never regresses the default: an unbound or non-matching representation falls back to document retrieval.

Temporal knowledge — now first-class

A large class of production questions asks not "what is true?" but "what was true, and when did it change?" — what a team decided in chat and later reversed, which requirement replaced another, which policy was in force as of a given date. Flat semantic search over a message dump reliably surfaces the stale version.

Answering these needs facts that carry their own validity interval (valid_from / valid_to) plus a transaction time (recorded_at), and a retrieval mode that can query the graph as of a point in time and surface how a fact was superseded — the property of a bi-temporal knowledge graph (the Graphiti / Zep lineage), distinct from multi-hop retrieval, which traverses connections but has no notion of when a fact began or ceased to be true.

In the runtime this is not a new layer — it is one more representation the decision engine routes to. A time-anchored intent (as of · what changed · superseded · point-in-time) proposes the temporal method alongside hybrid; the cost model decides when its bookkeeping earns its cost. Shipped as of v4: a dependency-free bi-temporal store as the reference implementation, with the full Graphiti engine available as an optional binding.

Capability is not context

Adding a capability should not enlarge the prompt. There are two ways to give a model a new capability:

Capability count scales in a registry — which is cheap — rather than in the context window, which is not.

Swapping Postgres for ClickHouse or Doris becomes an adapter-and-template change, invisible to the model's context. For the rare case where the model genuinely must author a query, the runtime supplies schema on demand — the minimal schema of the specific tables the plan touches, scoped by policy — never the whole catalog.

Enterprise data as planning input

Enterprise AI increasingly combines documents, warehouses, ERP, CRM, object storage, event streams, and graphs. Under v4 these are not integrations bolted onto a chatbot — they are planning inputs, each a representation behind the uniform plugin interface. The decision engine learns which representation minimizes cost while maximizing trust, and governance (which identity may read which source, in which region) is expressed as data-scope constraints in the policy layer inherited from v3.

The roadmap

GenerationStageStatus
1Static cost modelIndustry default
2Measured executionContext Runtime today
3Observable planning (EXPLAIN)Shipped
4Online learning (bandit + exploration)Partial
5Trust-aware execution · policy-constrained planningEnterprise (v3)
6 (v4)Knowledge-aware planningShipped (core)

The decision engine evolves from selecting execution strategies to selecting knowledge representations. Retrieval becomes one specialization within a broader execution-planning architecture — and the applications above it never change as the knowledge beneath them does.

This is why "planner" undersells it. The decision engine classifies intent, selects the knowledge representation, enforces policy, ranks candidates on measured cost, routes execution, verifies, and learns from every outcome — planning is now one of its jobs. What began as a query planner is a decision engine: the layer that decides what to reason over, how, and under which constraints.

Context Runtime — private pitch. Not for distribution. © 2026 redevops.io  ·  Whitepaper v4 — Knowledge-Aware Execution Planning