context
Retrieve relevant knowledge for reasoning steps using salience ranking, optimizing context windows with goal-driven selection and incremental updates.
Instructions
Get the most relevant knowledge for your current reasoning step, ranked by composite salience (recency × frequency × priority). Returns a token-optimized context window. Supports three output formats: 'predicate' (machine-readable), 'natural' (LLM-optimized prose), 'structured' (grouped with metadata). Pass goals for goal-driven selection, sessionId for incremental diffing across turns.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxFacts | No | Maximum facts to return (default: 100) | |
| minSalience | No | Minimum salience score 0.0–1.0 (default: 0.0) | |
| predicates | No | Only include these relationship types | |
| scope | No | Optional scope filter | |
| format | No | Output format: 'predicate' (default, machine-readable), 'natural' (LLM-optimized natural language), or 'structured' (grouped with metadata) | |
| includeRules | No | Include reasoning rules in the context (default: true) | |
| goals | No | Goal atoms for goal-driven context selection, e.g. [{"predicate":"recommend","args":["?x"]}] | |
| sessionId | No | Session ID for incremental diffing — only returns facts changed since last call with this sessionId | |
| autoResolveContradictions | No | Auto-resolve contradictions by salience (default: true) | |
| maxFactsPerPredicate | No | Diversity cap — maximum facts per predicate type |