coding-agents: option for hindsight_reflect to return the memories its answer is based on

Open
#7,270 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

integration:coding-agents
Use Case

Our coding agents write their own notes to the bank on purpose (through hindsight_ingest_document) and later ask hindsight_reflect about past decisions. We want any synthesized answer to be traceable, word for word, to the notes it came from.

Problem Statement

The plugin's reflect call sends only { query, budget, ...tagFilter } to POST /v1/default/banks/{bank}/reflect and keeps only text from the response:

https://github.com/vectorize-io/hindsight/blob/42f863cd55fad35c5cc4dbeeaad2cdf2197a3a24/hindsight-integrations/coding-agents/src/core/hindsight.ts#L1008-L1029

The hindsight_reflect MCP tool returns that text as is:

https://github.com/vectorize-io/hindsight/blob/42f863cd55fad35c5cc4dbeeaad2cdf2197a3a24/hindsight-integrations/coding-agents/src/core/page-tools.ts#L283-L298

So the agent gets a summary with no way to see which memories it was built from. It either trusts it or runs separate recalls and guesses which facts the answer used.

How This Feature Would Help

The agent could check each claim in the answer against the stored notes verbatim, and quote the note itself when it matters.

Proposed Solution

The API already supports it: include: { facts: {} } makes the reflect response carry based_on with memories (each with id, text, type, context, document_id, ...), mental_models and directives (docs, request model).

In the plugin:

  • a config option (for example reflectIncludeSources; off or on by default, your call) that makes hindsight_reflect send include: { facts: {} }
  • the cited memories listed under the answer: id and document id, plus the text (trimmed to a cap) or a pointer the agent can fetch

The automatic first-prompt hook can keep the current text-only call.

Alternatives Considered

Running a separate recall after reflect and matching facts by hand. It works, but the agent can't tell which of the recalled facts the answer actually relied on. Patching the plugin locally, which we'd rather not maintain.

Priority

Nice to have

Additional Context

We run plugin 0.9.1 against server 1.3.1. #1586 shows based_on can get large on the server's own MCP reflect tool, so a size cap per memory (or ids only, with the text fetched on demand) would make sense here too.

Checklist
  • I would be willing to contribute this feature
Dominant language
Python
Stars
45.2k
Forks
5.9k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vectorize-io/hindsight

All issues in vectorize-io/hindsight

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.