Skip to content

feat(memory): Link passive memories to the files they came from - #2483

Draft
sentry-junior[bot] wants to merge 1 commit into
mainfrom
feat/memory-file-provenance
Draft

sentry-junior[bot] wants to merge 1 commit into
mainfrom
feat/memory-file-provenance

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Prototype of file provenance for memory, adapted from Lore's knowledge_file_refs. It is the first step toward showing related memories when the agent touches a file. Recall by file is not part of this PR.

How it works

  • Core adds a paths field to tool-result entries in the plugin run transcript. For readFile, editFile, and writeFile, core takes the path from the matching tool call input and makes it relative to the Sandbox root (for example repos/junior/README.md).
  • Passive extraction already makes each memory cite transcript entries as evidence. When a memory cites a successful tool result that has paths, the memory plugin writes those files to a new junior_memory_file_refs table. A duplicate capture adds its files to the memory that already exists. Lore links a memory to every file the session touched; this links it only to the files its cited evidence came from, so the link is tighter.
  • The extraction prompt does not change. The memory plugin removes paths before the transcript goes to the model.

Open questions

  • Paths depend on the repos/<name> checkout layout, not on owner/repo. Two repos with the same name share keys. We could key on owner/repo plus a repo-relative path, but then core needs the git remote while the run is still active.
  • bash, grep, and findFiles are not covered. Lore has a heuristic parser for paths in shell commands that we could port later.
  • Memories created with the explicit createMemory tool get no file links.

via @BYK.

--

View Session [Sentry]

Project the Sandbox file that readFile, editFile, and writeFile name onto
plugin run tool results as paths. Passive extraction stores those paths in
a new junior_memory_file_refs table when a memory cites the tool result.
This is the provenance half; recall by file comes later.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 31, 2026 3:21pm UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

2 screenshot changes — 2 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Child Agent Drawer · Desktop
Conversation Child Agent Drawer · Desktop
Changed
Conversation Child Agent Drawer · Mobile
Conversation Child Agent Drawer · Mobile
Changed

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 8f1fe434 Deployed Oct 31, 2026 by vercel[bot]
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.

1 participant