Skip to main content

build_context

Function build_context 

Source
pub fn build_context(
    graph: &EntityGraph,
    entity_id: &str,
    all_entities: &[SemanticEntity],
    token_budget: usize,
) -> Vec<ContextEntry>
Expand description

Build a context set for a target entity within a token budget.

Greedy knapsack by priority:

  1. Target entity (full content)
  2. Direct dependents (full content)
  3. Transitive dependents (signature only)