Repository navigation
feat(recall,search,mcp): return the rooms a memory belongs to with each hit - #1706
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
8 of 10 tasks
…ch hit (#1703) A hit did not say which room(s) its memory lives in, so an agent that found a memory through a global recall could not follow up with `room recall`. Each memory hit of recall, search and room recall (with a query) now carries an optional `rooms` list of `{room_id, room_name}` (the room title, or the id when it has none), sorted by room id and omitted when the memory is in no room. A memory can be in several rooms, so it is a list. - uteke-core: `RoomRef`, `rooms` on `SearchResult` and `UnifiedSearchResult`, an id-scoped `Store::room_refs_for_memories` (chunked, one query per 400 ids, unlike `room_ids_by_memory` which reads the whole table) and `Uteke::attach_rooms*`. `run_recall`, `search` and the room semantic recall attach them to the final list, after the ranking, the cut to `limit` and the recall cache, so order and scores are unchanged and a cached hit never reports an old membership. - MCP and CLI: a `(rooms: ...)` line under a hit in the MCP text output and a `Rooms:` line in the human CLI output; the JSON carries the field. - Tests: rooms per variant (plain, unified, pack, explain), unchanged order and scores, omitted when empty, blank-title fallback, more ids than one query holds, room recall and pack, and an isolation test that a scoped hit never shows the room of the other namespace. - docs/rooms.md and the CHANGELOG describe the field. It is an additive response field on CORE endpoints; the uteke-cloud contract issue must be answered before this merges.
The finding-the-right-room section said a recall hit does not say which room it came from. It now does: step 1 notes the rooms field, and the closing paragraph only keeps the missing room search (#1704).
ajianaz
force-pushed
the
feat/rooms-in-recall-results
branch
from
November 10, 2026 01:39
bb47168 to
08f1cf2
Compare
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Each memory hit of
recall,searchandroom recall(with a query) now carries an optionalroomslist of{room_id, room_name}: the rooms its memory belongs to, sorted by room id, omitted when the memory is in no room. It is onPOST /recall,POST /search,POST /room/recall, the MCP toolsuteke_recall,uteke_searchanduteke_room_recall, and the CLI (JSON, plus aRooms:line in the human output), in the plain, unified,--packand--explainforms.Why
A hit did not say which room(s) its memory lives in, so an agent that found a memory through a global recall could not follow up with
room recall. A memory can be in several rooms (room link), so it is a list. Closes #1703.Blocked on the contract:
/recall,/searchand/room/recallare CORE. The change is an additive response field, but AGENTS.md requires a uteke-cloud contract issue first (the tracker is Gitea). The owner posts it; a draft is in the uteke documentuteke-contract-draft-rooms-in-recall-1703(roomuteke). Do not merge before it is answered.How
uteke-core:RoomRef;roomsonSearchResultandUnifiedSearchResult(omitted from the JSON when empty); an id-scopedStore::room_refs_for_memories(one query per 400 ids, unlikeroom_ids_by_memory, which reads the whole table);Uteke::attach_rooms*.run_recall,searchand the room semantic recall attach the rooms to the FINAL list, after the ranking, the cut tolimitand the recall cache. Order and scores are unchanged, and a cached hit never reports an old membership. TheMemorystruct is not touched (it is constructed in about 30 files).(rooms: ...)line and the CLI human output aRooms:line, only for a memory in a room, so existing output is unchanged.docs/api-reference.mdanddocs/core-contract.jsonregenerate without a diff (responses are not in the registry).Testing
cargo test --workspacepasses (1661 passed, 0 failed locally; CI green on this head after one re-run of theTestjob, whose only failure was a stdin write race in the unrelatedconnect_hookstest)cargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warningspassescorabinary is not available in this environment; the CI Cora Review covers it: no issues found)New tests: rooms on plain, unified, pack and explain hits; order and scores identical to a recall without the lookup; the field omitted when empty and listed otherwise; a cached recall reports the new membership; blank-title fallback and sort by id; more ids than one query holds; keyword search, room recall and room pack; and an isolation test that a scoped hit never shows the other namespace's room.
Not run: the fast50 benchmark (it needs the LongMemEval dataset). The ranking code is not touched, and the lookup is one indexed query for the returned ids only.
Related Issues
Closes #1703. Related: #1702, #1704 (stacked on this).
Checklist
fix/,feat/,docs/,chore/,refactor/,test/,perf/,security/)develop