Skip to content

feat(reflect): add facts_only mode to exclude chunks and expand tool#1039

Closed
cdbartholomew wants to merge 1 commit intomainfrom
feat/reflect-facts-only
Closed

feat(reflect): add facts_only mode to exclude chunks and expand tool#1039
cdbartholomew wants to merge 1 commit intomainfrom
feat/reflect-facts-only

Conversation

@cdbartholomew
Copy link
Copy Markdown
Contributor

Summary

  • Adds facts_only flag to the reflect API and mental model trigger config
  • When enabled, raw source chunks are excluded from recall results, the expand tool is removed from the agent's tool set, and max_chunk_tokens is hidden from the recall schema
  • Mental model refreshes can now be scoped to only consider extracted facts, without raw document/chunk context influencing synthesis

Changes

  • ReflectRequest and MentalModelTrigger — new facts_only: bool field
  • reflect_async / run_reflect_agent — thread facts_only through to tool setup
  • tool_recallinclude_chunks is now a parameter (was hardcoded True)
  • get_reflect_tools — conditionally excludes expand tool and chunk params when facts_only=True
  • agent.py — expand is now governed by enabled_tools (removed from hardcoded exemption)

Test plan

  • 8 new unit tests covering tool schema, expand rejection, and default behavior
  • All 46 reflect agent tests pass
  • Lint passes

When facts_only is enabled, reflect only considers extracted facts — raw
source chunks are stripped from recall results, the expand tool is removed
from the agent's tool set, and the max_chunk_tokens parameter is hidden
from the recall tool schema.

Available via the reflect HTTP API (facts_only field) and per-mental-model
trigger config (trigger.facts_only), so mental model refreshes can be
scoped to synthesized facts without raw document context.
@nicoloboschi
Copy link
Copy Markdown
Collaborator

added a more complete fix here #1048

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.

2 participants