fleet-memory/hindsight-api-slim/hindsight_api/engine/reflect
Kagura 8e2e2d5bf2
fix(reflect): disable source facts in search_observations to prevent context overflow (#669)
search_observations in the reflect agent hardcoded include_source_facts=True
with max_source_facts_tokens=-1 (unlimited). For banks with many observations
backed by thousands of facts, a single tool call could produce 300K+ tokens,
exceeding the default 100K context budget and causing forced synthesis with
an empty 'Retrieved Data' section.

The reflect agent synthesizes from observations, not raw backing facts.
Disable source facts to keep payloads proportional to observation count
(~6K vs ~310K in the reporter's case).

The consolidation path already has configurable source fact limits (PR #509,
v0.4.17). The reflect path was not updated.

Fixes #668

Co-authored-by: Kagura Chen <daniyuu19@sjtu.edu.cn>
2026-03-24 09:12:54 +01:00
..
__init__.py feat: introduce hindsight-api-slim and hindsight-all-slim packages (#560) 2026-03-13 13:50:03 +01:00
agent.py feat: fact_types and mental model exclusion filters for reflect (#615) 2026-03-19 17:03:41 +01:00
models.py feat: introduce hindsight-api-slim and hindsight-all-slim packages (#560) 2026-03-13 13:50:03 +01:00
observations.py feat: introduce hindsight-api-slim and hindsight-all-slim packages (#560) 2026-03-13 13:50:03 +01:00
prompts.py feat: introduce hindsight-api-slim and hindsight-all-slim packages (#560) 2026-03-13 13:50:03 +01:00
tools.py fix(reflect): disable source facts in search_observations to prevent context overflow (#669) 2026-03-24 09:12:54 +01:00
tools_schema.py feat: fact_types and mental model exclusion filters for reflect (#615) 2026-03-19 17:03:41 +01:00