Skip to content

feat(planner): knowledge-aware routing — temporal representation (Whitepaper v4)#3

Merged
arybach merged 1 commit into
v2from
feat/knowledge-aware-planning-temporal
Jul 10, 2026
Merged

feat(planner): knowledge-aware routing — temporal representation (Whitepaper v4)#3
arybach merged 1 commit into
v2from
feat/knowledge-aware-planning-temporal

Conversation

@arybach

@arybach arybach commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Knowledge-aware execution planning (v4 groundwork)

Shifts the planner's decision from which retrieval algorithm to which knowledge representation answers the request — and makes temporal (bi-temporal) a first-class routable representation. Fully backward compatible; full suite green.

The idea

The planner already routes multi_hop → graph (HippoRAG). This generalizes that pattern: a request maps to a knowledge representation (document / graph / temporal / analytical / community / code / multimodal), and the concrete retrieval method is a specialization within it. Retrieval becomes one family of knowledge access, not the whole of it.

What's in this PR

  • types.pytemporal IntentBucket + a KnowledgeRepresentation taxonomy.
  • planner/representations.py (new) — retrieval-method → representation map + helpers.
  • planner/rules.py — temporal intent cues (as of / what changed / superseded / point-in-time), placed before multi_hop; BUCKET_DEFAULTS/BUCKET_TIERS emit a temporal candidate plus a hybrid fallback (the cost model picks).
  • adapters/store_router.py — optional temporal slot with empty-fallback: routes to the bi-temporal store only when one is bound and a fact matches; otherwise falls back to single-hop. The new constructor param defaults to None, so every existing caller (incl. the control plane) is unchanged.
  • costmodel/estimators.py — temporal recall + a temporal-bucket edge so the planner prefers the bi-temporal store for time-dependent questions (mirrors how multi_hop prefers graph).
  • tests/test_temporal_routing.py (new) — 8 tests: intent routing, cost edge, router dispatch + fallback, bi-temporal point-in-time (as_of) & what-changed (changes), taxonomy, end-to-end run.

Open-core boundary (deliberate)

This PR ships the abstraction + routing scaffold + the in-memory reference plugins only. The differentiated engines stay optional/enterprise bindings behind the same RetrieverPlugin seam:

  • Temporal: reference = the in-memory TemporalStore already in the tree; a real Graphiti engine + bi-temporal ingestion pipeline bind at construction time.
  • Graph: already routes end-to-end; the real HippoRAG backend is an optional dep bound at the graph slot.
  • Heavier representations (OLAP/ClickHouse/Doris, SQL) are future plugins on the same interface.

Notes

  • Backward compatible: HopRouterRetriever(single_hop, graph, community=None, temporal=None).
  • No control-plane behavior change: with no temporal store wired, temporal-classified queries fall back to hybrid exactly as today.

🤖 Generated with Claude Code

…presentation

Whitepaper v4 groundwork: the planner routes across knowledge *representations*, not
just retrieval algorithms. This adds temporal (bi-temporal) as a first-class routable
representation and a representation taxonomy, without a big refactor and fully backward
compatible.

- types: add `temporal` IntentBucket + a `KnowledgeRepresentation` taxonomy
- planner/representations.py (new): retrieval method -> representation map
  (document / graph / temporal / analytical / community / code / multimodal)
- planner/rules: temporal intent cues (as-of / what-changed / superseded / point-in-time),
  placed before multi_hop; BUCKET_DEFAULTS + BUCKET_TIERS (temporal candidate + hybrid fallback)
- store_router: optional `temporal` slot with empty-fallback — routes to the bi-temporal
  store only when one is bound and matches; otherwise falls back to single-hop, so a new
  representation never regresses default behavior
- costmodel: temporal recall + a temporal-bucket edge so the planner prefers the bi-temporal
  store for time-dependent questions (mirrors how multi_hop prefers graph)
- tests: 8 tests (routing, cost edge, router dispatch + fallback, bi-temporal point-in-time
  and what-changed semantics, representation taxonomy, end-to-end run)

The reference temporal backend is the in-memory TemporalStore already in the tree; a real
Graphiti engine binds via the same RetrieverPlugin seam at construction time. HippoRAG (graph)
already routes end-to-end; this closes the temporal gap. Full suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arybach arybach merged commit 5b0ddcd into v2 Jul 10, 2026
@arybach arybach deleted the feat/knowledge-aware-planning-temporal branch July 10, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant