Repository navigation
feat(session): recall saved project conversations across sessions - #1045
俞小姐与茉莉清茶 (Sanikki) wants to merge 6 commits into
Conversation
|
俞小姐与茉莉清茶 (@Sanikki) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi 俞小姐与茉莉清茶 (@Sanikki), thank you for this, and sorry it took us so long to reply. You asked for design agreement on #1043 and we should have answered sooner. The work is careful: reusing the saved conversations instead of a second store, the size limits, the exclusions (subagent, archived and reverted sessions, unfinished replies), the off switch and the tests are all things we'd want to keep. We'd like to take the feature, but in a different shape. The issue is where the recalled text goes, not how it's selected. Why not the system prompt
What we'd suggest instead
If it helps, the notes part could go in first as its own small PR while the recall part is reworked. Please also rebase on Let us know if you'd like to take this on. If you'd rather not, or we haven't heard back in about two weeks, we'll close this PR and implement the design ourselves, crediting your work. |
|
Thanks for the feedback, and no worries about the wait! I’m happy to keep working on this. Your points about caching and keeping conversation history out of the system prompt make sense. I’ll rebase on main and extend the existing I’ll update this PR when the changes are ready. |
Sessions start empty, so decisions reached in an earlier session in the same project get restated every time. Read every markdown file under .openscience/memory/ into the instruction sources, appended last so the existing byte budget drops memory before AGENTS.md or configured instructions. Reading alone leaves the directory empty, so the prompt also names the file a new note goes in: when the user asks the agent to remember something it appends an entry there with its file tools. Nothing is captured, summarized or written in the background.
2366aa7 to
403d775
Compare
|
I’ve rebased the branch on
All 13 focused tests and the CLI typecheck pass. One test specifically checks the caching concern you raised: it records a fact in one session and verifies that, in a later session, the fact reaches the model only through the tool result. The serialized system messages and tool definitions stay identical across sessions and before and after the recall call. Thanks again for the feedback. This is ready for another look whenever you have a chance. |
|
Thanks 俞小姐与茉莉清茶 (@Sanikki), the redesign is right: on-demand Bug 1: a long turn hides the whole session Each agent step is stored as its own assistant message, and harness continuations add user messages. To reproduce:
Result: "No matches in the searched project history window". The model then told the user the fact was never mentioned. Bug 2: empty sessions use up the 8 slots Candidates are the 8 most recently updated sessions, chosen before checking whether they contain any finished exchange. Empty sessions, aborted sessions and forks take those slots, so older sessions with real content are never searched. To reproduce:
Result: "No matches", for the search that worked a minute earlier. Suggested fix Drop the fixed session and message windows. Search all eligible sessions in the project, newest first, and stop when the result budget (16 KiB / Since the search may stop early, please end every result with what was covered, e.g. "Searched 143 of 143 sessions" or "Stopped after 2 s; searched sessions back to 12 Nov". Then "no match" isn't read as "never happened". Tests Please add tests that check behaviour, without asserting the internal limits (8 sessions, 32 messages):
A heads-up for later Users' sessions already live in SQLite, so we may later move the search internals onto a database query, and possibly a full-text index, for very large projects. If we do, the parts you've built would stay: the Once the fixes are in, we'll run CI and try it in the app again. Thanks for sticking with this! |
|
Thanks for building the previous revision and trying it in the app. I reproduced both issues on I’ve pushed the fix in Changes and tests based on your feedbackI removed the fixed session and message windows. Here’s how I verified the five cases you raised:
Both of your original repro cases now find the previously missed fact on the first call, without a retry or a cursor. Two additional changes from follow-up testing
On a personal note, thank you for taking the time to test this yourselves and point out exactly what needed to change. I’m still learning how to build agent applications, and seeing where my design fell short in real use taught me a lot. Getting hands-on experience with these issues and hearing your feedback has been especially helpful. I really appreciate your suggestions and guidance. |
What does this PR do, and why?
This PR extends the existing
recalltool withscope: "project"so the model can look up earlier work when it’s relevant. Calls without ascopecontinue to search only the current session. When it needs context from an earlier conversation, the model can request the project scope itself; users don’t need to enable a setting.Project recall searches saved conversations in the same project and directory. It returns matching excerpts as tool results, with their source session and message IDs, rather than adding conversation history to the system prompt. It reuses the existing session store and does not search automatically on every turn.
The search checks the latest 32 messages in up to 8 recent eligible sessions and returns matches from at most 4 sessions within a 16 KiB output budget. Only completed user–assistant exchanges are eligible. Child, archived, and reverted sessions are excluded, as are tool outputs, reasoning, and synthetic text. If matches are omitted because of a result limit, the tool result says so.
Setting
OPENSCIENCE_DISABLE_PROJECT_MEMORY=1disables cross-session search without deleting saved conversations or affecting current-session recall. Markdown note loading is outside the scope of this PR.Linked issue
Related to #1043.
How did you verify it?
backend/cli:bun test --timeout 200000 ./test/tool/recall.test.ts ./test/tool/recall-project.test.ts ./test/tool/recall-project-prompt.test.ts— 13 passed, 0 failed (74 assertions). Covers current-session compatibility, cross-session persistence, project and directory isolation, exclusions, output limits, and disable switches.recalltool result. It also checks that the serialized system messages and tool definitions stay identical across sessions and before and after the recall call.backend/cli:bun run typecheckpassed. Changed-file Prettier checks and the staged gitleaks scan also passed.frontend/docs:bun run checkpassed in a temporary LF-normalized copy on Windows. It validated 70 pages, 982 links, 16 JSON examples, and 9 TypeScript examples.Checklist
bun run checkis green (format, typecheck, backend + frontend/ui + SDK tests) — not rerun for this revision; see the focused checks above.No server API/SDK, installer or UI source changes.