Skip to main content

Module assembly

Module assembly 

Source
Expand description

Context assembly — orchestrates rendering, budget allocation, ordering, and sections.

ContextAssembler takes &[SearchHit] + FormatPolicy and produces a FormattedContext ready for LLM consumption.

§RF-4: Structured Context Rendering

Three intent-aware rendering modes improve how grains are presented:

  1. Aggregation mode — entity summary header + grouped-by-entity rendering when entity_count is present in the RecallResult.
  2. Timeline mode — chronological rendering with date prefixes when temporal intent is detected (temporal_expr, time range, or multi-day span).
  3. Relevance highlighting — top-5 “Most Relevant” section + “Additional Context” when result set exceeds 10 grains.

Modes are mutually exclusive, checked in priority order (aggregation > timeline > relevance). JSON output bypasses all modes.

Structs§

ContextAssembler
The main assembly engine.
FormattedContext
Assembled context ready for LLM consumption.
RenderingHints
RF-4: Hints from the recall query/result that guide rendering mode selection.