Skip to content

feat(hindsight): default recall_types to observation only#34079

Merged
kshitijk4poor merged 2 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/hindsight-recall-observation-default
May 28, 2026
Merged

feat(hindsight): default recall_types to observation only#34079
kshitijk4poor merged 2 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/hindsight-recall-observation-default

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Summary

Salvage of #33983 (@nicoloboschi) onto current main, plus a one-commit follow-up correcting the documented scope.

Defaults the Hindsight plugin's recall_types to ["observation"] (was unset → server returned every fact type). Observations are Hindsight's consolidated, deduplicated, evidence-grounded knowledge layer; raw world/experience facts are the supporting evidence observations already summarize, so observation-only recall is denser per token for per-turn context injection.

Commits

  1. feat(hindsight): default recall_types to observation only@nicoloboschi's original work, cherry-picked with authorship preserved. Adds CSV-string parsing for recall_types (parity with recall_tags), empty-list → default fallback, and exposes the key in get_config_schema().
  2. docs(hindsight): correct recall_types scope — our follow-up. The original description/README claimed the per-call hindsight_recall tool was unaffected. That is inaccurate: the tool reads the same self._recall_types instance attribute as auto-recall, 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 schema description.

Verification

  • pytest tests/plugins/memory/test_hindsight_provider.py100/100 pass (5 new/updated recall_types cases: default, explicit-list override, CSV string, empty-list fallback).
  • E2E: confirmed with the new default a bare hindsight_recall tool call forwards types=['observation'] to the server (proving the tool path is affected — basis for the doc correction).
  • py_compile clean, ruff check clean.
  • Plugin-only diff (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_recall tool.

Closes #33983

nicoloboschi and others added 2 commits May 29, 2026 01:34
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.
@kshitijk4poor kshitijk4poor merged commit 4df62d2 into NousResearch:main May 28, 2026
18 checks passed
@kshitijk4poor kshitijk4poor deleted the salvage/hindsight-recall-observation-default branch May 28, 2026 20:07
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