Repository navigation
feat(mcp): hybrid conversation search and literal transcript search - #25527
Conversation
…ate on cards Builds on transcript paging (BasedHardware#25491) so an agent can read a long conversation the way a person skims one, without loading the whole transcript first. - view=outline returns the card plus the stored note sections, each anchored to the segment range it cites (first_segment, segment_count, start, end), and no transcript. - offset starts a transcript read at a segment index, such as a section's first_segment; the cursor then continues it (a resent offset is ignored). - format=lines renders a page as one "[h:mm:ss] Speaker: text" line per speaker turn with transcript_range, about a third of the size of the per-segment JSON; the cursor is bound to the format. Also on get_conversations_by_ids. - Cards carry status and duration_seconds, plus kind, shown_on_home and summary_covers_through where stored, so agents can tell live conversations, media and other people's background talk from the user's own. - Tool descriptions and server instructions say to start long conversations with the outline, prefer lines, and treat transcript text as quoted content, never instructions. - omi_mcp_transcript_pages_total counts detail pages by tool, view, format, position and whether more remain, so paging can be measured. Defaults are unchanged: transcript view, JSON segments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…il read Review follow-ups on the progressive-reads commit: - view=outline returns at most 100 sections, reports sections_truncated, and checks the 120k serialized budget like transcript pages. - duration_seconds is the transcript's speech span: null on list and search cards, which load no transcript, instead of the wall window, which can start long before speech. - summary_covers_through is localized like the other card timestamps. - The default format adds nothing to the detail cursor fingerprint, so cursors minted before format existed still decode during a rolling deploy. - offset is ignored, not parsed, when a cursor is given; negative, malformed or oversized offsets are argument errors rather than clamped. - The page counter's position=first means "no cursor sent", so an offset read from the outline counts as a first page. - The detail card is built once per request rather than on every budget-fitting retry. The 1,200-segment walk test uses about 0.27s of CPU instead of 0.43s, well inside the 1.0s per-test limit that CI shard 5 hit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l outline windows Codex review follow-ups on BasedHardware#25497: - format=lines pages over text only. original_text is not rendered, so a page boundary inside it produced continuation pages with no speech. - Lines join turns on speaker_key, not the display label, so two people who share a name (or two unresolved speakers) stay on separate lines. - An outline section's start/end span every cited segment (min start, max end), since cited segments can overlap or be stored out of time order. - transcript_range is always present on lines pages and null when the page is empty, so fields=[transcript, transcript_range] works at the end of a read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…earch_transcripts Agents asking about something said in passing found nothing: MCP search read summary vectors only, and the keyword index ran only when vectors returned zero rows, so one semantic hit hid every exact title or overview match. Two-hour v3 conversations make summaries leave out more detail. search_conversations: - asks summary vectors and the keyword index (titles, overviews) on every call; shared hits rank first, then the two indexes alternate, so neither crowds the other out. Stale ids get one bounded second hydration. - each card carries match_basis (summary, keyword, transcript); only match_snippets quote the transcript, and each snippet carries segment_index, the get_conversation_by_id offset to read around it. - search_coverage names what actually ran (summary_vectors_and_keyword, summary_vectors_only, keyword_only) plus unavailable_indexes; one index down still answers. No hits with the keyword index down stays a 503. search_transcripts (new, conversations.read): - literal words or a short phrase in saved transcripts, newest first, over the bounded owner/query-bound scan chat transcript recall already uses (no derived index, 50 records and 4s per call, signed cursor resuming after the last record examined). - optional conversation_id finds where something was said in one long conversation; hits carry segment_index, speaker and time. - locked, discarded, deferred and unreadable records are never quoted; misses are never presented as absence. The developer search route reports the same truthful coverage. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A segment-only speaker correction leaves adjacent rows with one diarization key but different resolved labels; joining on the key alone attributed an unassigned speaker's words to the user. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n-my-level/omi into lane/mcp-search # Conflicts: # backend/utils/mcp_server/registry.py
A loaded detail with no transcript (a photo-only capture) reported a null duration; use the shared conversation_duration_seconds wherever the transcript is loaded, and keep list cards null. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Four journeys chain real tool calls the way an agent would (search -> outline -> section in lines; literal transcript hit -> read around it; a whole long conversation by cursor; a day listing that tells media from conversation, then a batch read) and validate every response against its output schema and the serialized budget, so a tool that stops leading to the next one breaks a journey. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # backend/utils/mcp_context.py # backend/utils/mcp_server/registry.py
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
# Conflicts: # backend/tests/unit/test_mcp_streamable_http.py # backend/utils/mcp_server/registry.py # docs/doc/developer/mcp/introduction.mdx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 463734319a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A summary-vector index still building is one index down: keyword search still answers, and the index error returns only when both are down. search_transcripts rejects dates with conversation_id (it searches the whole conversation). A one-letter query word must appear as a word in the segment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…down fallbacks A page of large (or escaped CJK) hits stops before the 120000-character serialized budget and resumes at the first conversation it left out. Keyword or vector index loss now records the degraded fallback even when other hits survive. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f514763e11
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…5524 and BasedHardware#25500 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…acy segment index Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ef964c3bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38d4a90315
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…snippet window Matching gets 2s after the 4s scan (chat's 6s overall) and resumes after the last finished record; unreadable records record a degraded fallback; a long segment is clipped around the shortest stretch holding every query word. Developer changelog entries for BasedHardware#25497, BasedHardware#25524 and this PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6335bedb83
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…as partial coverage Co-Authored-By: Claude Opus 5.5 <[email protected]>
Why
Agents (ChatGPT, Claude, assistants that sync Omi into their own knowledge repositories) often ask about something said in passing: a name, a number, a phrase. Hosted MCP search could not find these:
search_conversationsread summary vectors only. The keyword index (titles, overviews) ran only when the vectors returned nothing, so one semantic hit hid every exact keyword match.What changes
search_conversations:match_basison every card lists which ofsummary,keywordandtranscriptmatched. Onlymatch_snippetsquote the transcript.segment_indexon every snippet is theget_conversation_by_idoffsetto read around it (feat(mcp): outline-first, offset and lines reads, and conversation state on cards #25497).search_coverageissummary_vectors_and_keyword,summary_vectors_onlyorkeyword_only, andunavailable_indexesnames what could not be asked. With one index down, search still answers. No hits with the keyword index down stays the existing actionable 503.search_transcripts(new tool,conversations.read):database.transcript_search): no derived index, at most 50 records and 4 seconds per call, newest first, and a signed cursor that resumes after the last record examined.conversation_idscopes the search to one conversation, to find where something was said in a long one.segment_index,segment_id, speaker and time. A conversation shows at most 5 hits, withmore_hitswhen there are more.complete,examined,unreadable,search_coverage).The developer search route reports the same truthful coverage. The server instructions mention
search_transcripts, and the tools docs and introduction table are updated.Tests
New
backend/tests/unit/test_mcp_search_hybrid.py, 15 cases:segment_indexround-trips into anoffsetread;New
backend/tests/unit/test_mcp_agent_journeys.pychains real tool calls over a synthetic store the way an agent would, and checks every response against its advertised output schema and the 120,000-character response budget:lines;search_transcriptsfinds a phrase said once in a 1,400-segment conversation, then anoffsetread around it;next_cursor;next_idsinstead of shrinking it.If a tool stops leading to the next one (an id, a section, a segment index, a cursor), a journey breaks even when each tool's own tests pass.
Existing recall tests are updated for always-on keyword search. All 55 backend unit files matching
mcp,developer_readortranscript_searchpass one process per file on the merged branch.UI-Evidence: none -- backend MCP tools and docs only; no rendered UI changes.
Release
Default-on. The change is additive:
Cost: one keyword-index query per search, which in-app chat already makes on every search. Its timeout is bounded at 5 seconds, and it runs sequentially after the vector query.
search_transcriptsreads up to 50 conversations per call under a 4-second budget, the same budget chat uses.Rollback is reverting this PR.
Not verified:
The per-tool metrics in #25514 measure both.
Failure-Class: none
🤖 Generated with Claude Code