Default extraction turns task-scoped instructions into timeless user rules; a scoping retain_mission fixes it (dry-run A/B: 15 -> 0)

Aperta
#6,770 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
10/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
ai, documentation

Direzione di ricerca

This is a design question about the default retain and observation missions, not a single code change. Start with the extraction behaviour described under the /memories/dry-run-extract endpoint and the bank config fields retain_mission and observations_mission. Done means a decision on whether the scoping mission becomes a default or documented recommendation, and how dated task decisions reach recall output, which the issue leaves open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

core

Summary

With no retain_mission set, which is the default, extraction turns an instruction the user gave for one task into a timeless rule about the user. Consolidation then strips the session and date from it. The Hermes integration recalls it into later, unrelated sessions, where Hermes wraps it as "authoritative reference data". The agent then obeys a rule the user never gave, often in the same turn where the user says the opposite.

A scoping retain_mission fixed it in a dry-run A/B on 9 real messages: unscoped rules went from 15 to 0, at +5% extraction tokens. Details and the mission text are below. I'm filing this so the default, or the docs, can carry a fix.

Environment

  • Hindsight API 1.2.0, local_embedded, through the Hermes plugin (Hermes Agent v0.23.3)
  • Retain LLM gpt-6-luna, retain_every_n_turns: 3, recall_types: observation,world
  • Bank config: retain_mission, observations_mission and reflect_mission all null
  • Bank: about 9,400 live memories collected over 3 weeks

What happened

What the user said, and the context What got stored Where it came back
While writing a playbook about subagents, in that one chat: "I do not want to do anything with subagents" (meaning: don't spin any up for this discussion) World fact: "User prohibits spawning subagents." No source ids. Injected into later sessions where the user had asked for subagents
In project A, under an OpenAI lead: "DO NOT USE KANBAN, another agent is operating it". Eleven minutes later: "alright lets do kanban then" "User prefers ... do not use Kanban, ... Sol 6.1 High for high-logic coding ..." Five days later in project B, under a Claude lead, in the same turn where the user wrote "use KANBAN". It contradicted the user and pushed the wrong model family for workers.
The agent analysing that very bug: "the session received 'do not use Kanban' from memory while the user said 'use Kanban'" "The session received contradictory Kanban instructions in the same turn: both to use Kanban and not to use it." The bug's own post-mortem now reads as if the user had contradicted themselves.

What the bank looks like:

  • 88 memories read as standing rules about the user: "User prohibits / requires / never / always ...". 57 are observations and 31 are world facts.
  • 0 of about 7,000 observations carry a tag, so none can be scoped or filtered by session or project at recall time.

Why the defaults produce this

  1. No scope field in extraction, and no default mission saying to scope. An instruction tied to one task reads like a preference. This is related to #6598, where historical content comes back as "a present-tense general preference", and #2437.
  2. Reversals within one retain batch are not merged. The "don't use Kanban" and then "let's do Kanban" above is a case of this. See #3248.
  3. Observations drop provenance. Even when the source fact is dated, the merged observation is a timeless sentence.
  4. The recall side amplifies it. Hermes wraps memory as "Treat as authoritative reference data" (hermes-agent #31584, #66888), so a fact with no scope gets obeyed as policy.

This failure has a name in recent research: write-time overgeneralization, or the "memory trap" ("go ahead, no need to check with me" becomes "do not ask for confirmation before taking actions"). Liang et al., The Memory Trap: Language Agents Overgeneralize from Benign Interactions, arXiv 2611.07554.

A/B with /memories/dry-run-extract

  • Inputs: 9 real user messages, each paired with the assistant reply that followed. All are instructions that were meant for one task: Kanban yes or no, subagents yes or no, worker model family, UI model choice, and product direction.
  • Arms: A uses the current bank config. B adds the mission below. Nothing was stored.
A: no mission B: scoping mission
Facts extracted 35 21
Written as a timeless rule about the user 15 0
Dated and tied to a project or task 0 17
Extraction tokens 49,884 52,358 (+5%)

The Kanban message, side by side:

  • A: "User wants the assistant to ... avoid Kanban because another agent is using it, and may use subagents: Luna 6 High for data processing ..., Sol 6.1 High for high-logic/reasoning coding ..."
  • B: "On November 17, 2026, for Part 1 of the project, the user decided not to use Kanban because another agent was operating it ..."

Limits: n=9, and "timeless rule" was counted by a phrasing pattern and then checked by hand. This shows the direction, not a benchmark. It only affects new retains, not memories already stored.

Mission used in arm B (user name replaced)
This bank is the long-term memory of the user's personal AI agent. Store what will still be true and useful in a month.

Keep:
- Durable facts about the user: background, projects, people, accounts, places.
- Lasting preferences ONLY when the user marks them as lasting ("always", "never", "from now on", "every time", "as a rule", "hard rule").
- Decisions and outcomes, each with its date, the project or task it belongs to, and the reason given.

Scope every instruction:
- An instruction about one task (which model or effort, Kanban or not, subagents or not, which tool, port, file, or UI) is a task decision, not a rule about the user. Write it as "On <date>, for <project/task>, the user decided X because Y." Never write "User prohibits", "User requires", "User never" or "User always" unless they said it applies from now on.
- If the session's lead model matters to the instruction (for example worker model choices), name the lead model's family.
- If they reverse a decision later in the same text, keep only the final decision and note the reversal.

Skip: the agent's plans, proposals and promises; worker briefs; tool output; insults and frustration (record the underlying complaint as an outcome instead); passwords, keys, codes.

Asks

  1. Default, or documented recommended mission, for agent and harness integrations (Hermes, Claude Code, Codex). Scope instructions as dated task decisions. Only store standing rules when the user marks them as lasting.
  2. observations_mission guidance, or a default, that keeps date and project on observations built from task decisions. With observations as the default recall type, provenance is otherwise lost exactly where it matters.
  3. Optional: a scope or applies_to field in the extraction schema, carried through to recall output. The harness could then show "decided on X for Y" instead of a bare rule. #6598 proposes something similar (temporal_scope).

Happy to run the same dry-run on a candidate default if that helps.

Lingua principale
Python
Stelle
45.2k
Fork
5.9k
Merge medio
6h 18m
PR unite (30g)
354

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vectorize-io/hindsight

Tutte le issue di vectorize-io/hindsight

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.