feat(hindsight): default recall_types to observation only#34079
Merged
kshitijk4poor merged 2 commits intoMay 28, 2026
Merged
Conversation
Auto-recall used to surface every fact type Hindsight had on the
session — `world`, `experience`, and `observation`. That triple-ships
the same underlying signal in three different framings: observations
are the concrete events the user said/did/asked, while world and
experience facts are aggregate summaries Hindsight derives from those
exact observations. Including all three burns most of
`recall_max_tokens` on rephrasings, crowds out events the model
actually needs to see, and produces effective duplicates in the
prompt — observations themselves are deduplicated by construction
so observation-only recall is denser per token and closer to
conversational ground truth.
Change
------
- Default `_recall_types = ["observation"]` (was `None`, which
delegated to server-side "return everything").
- `initialize()` now treats a missing `recall_types` config the same
way; also accepts comma-separated strings for parity with `recall_tags`.
- An explicit `recall_types=[]` config falls back to the default rather
than disabling the filter (would silently widen recall vs. the new
default).
- Added to `get_config_schema()` so it's discoverable via `hermes config`.
Per-call `hindsight_recall` tool invocations are unaffected — they
already only forward `types` when the caller passes the argument.
Docs / migration
----------------
plugins/memory/hindsight/README.md grows a "Behavior change" callout
explaining the why (no-duplicates, information-efficient) and how to
restore the legacy broad recall:
"recall_types": "observation,world,experience" # or a JSON list
in `~/.hermes/hindsight/config.json`.
Tests
-----
- `test_default_values` updated for the new default.
- New cases: explicit list override, CSV string accepted, empty list
falls back to default (not "wider than default").
The original change's description and README claimed the per-call hindsight_recall tool was unaffected by the new observation-only default. That is inaccurate: hindsight_recall reads the same self._recall_types instance attribute as the auto-recall prefetch path, and RECALL_SCHEMA exposes no per-call types argument, so the model cannot override it. Narrowing the default narrows BOTH paths. Corrects the README behavior-change note, the config-table row, and the get_config_schema description to reflect that recall_types applies to both auto-recall and the hindsight_recall tool.
2 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Salvage of #33983 (@nicoloboschi) onto current
main, plus a one-commit follow-up correcting the documented scope.Defaults the Hindsight plugin's
recall_typesto["observation"](was unset → server returned every fact type). Observations are Hindsight's consolidated, deduplicated, evidence-grounded knowledge layer; rawworld/experiencefacts are the supporting evidence observations already summarize, so observation-only recall is denser per token for per-turn context injection.Commits
feat(hindsight): default recall_types to observation only— @nicoloboschi's original work, cherry-picked with authorship preserved. Adds CSV-string parsing forrecall_types(parity withrecall_tags), empty-list → default fallback, and exposes the key inget_config_schema().docs(hindsight): correct recall_types scope— our follow-up. The original description/README claimed the per-callhindsight_recalltool was unaffected. That is inaccurate: the tool reads the sameself._recall_typesinstance attribute as auto-recall, andRECALL_SCHEMAexposes no per-calltypesargument, so the model cannot override it. Narrowing the default narrows both paths. Corrects the README behavior-change note, the config-table row, and the schema description.Verification
pytest tests/plugins/memory/test_hindsight_provider.py→ 100/100 pass (5 new/updatedrecall_typescases: default, explicit-list override, CSV string, empty-list fallback).hindsight_recalltool call forwardstypes=['observation']to the server (proving the tool path is affected — basis for the doc correction).py_compileclean,ruff checkclean.plugins/memory/hindsight/+ its tests) — no core code touched.Migration
To restore broad recall, set in
~/.hermes/hindsight/config.json:{ "recall_types": "observation,world,experience" }(JSON list works too.) This applies to both auto-recall and the
hindsight_recalltool.Closes #33983