Repository navigation
feat(mcp): find sessions that cover several concepts at once - #2557
Open
mariusvniekerk wants to merge 1 commit into
Open
mariusvniekerk wants to merge 1 commit into
mariusvniekerk wants to merge 1 commit into
Conversation
An assistant recalling past work often needs one session that discussed two or more ideas, such as an auth change and the retry policy it needed. A single semantic query blends those ideas into one vector and favors passages that mention both together. It misses a session that covered them in different exchanges. search_content now accepts two to five concepts in place of a pattern. Each concept runs as its own semantic search with the same filters, and only sessions that every search found are kept. Each result lists the best passage for every concept, so the assistant can cite and open each piece of evidence. The intersection uses kit's group fusion, which was built for this caller. Results rank by the mean of each concept's best score, because all concepts use one vector generation and their scores are comparable. Equal means keep the per-concept ranking order. Each concept search reads at most 250 candidates. A session ranked below that window drops out of the intersection, so the response reports candidate_truncated when a window fills or the limit cuts the result. This replaces #1876, which first proposed the feature before the shared search contract and kit's fusion helpers landed. Co-authored-by: salmonumbrella <182032677+salmonumbrella@users.noreply.github.com>
roborev: Combined Review (
|
This branch has not been deployed
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.
When an assistant recalls past work, it often needs the one session that discussed two or more things, such as an auth change and the retry policy it needed. A single semantic query blends those ideas and favors passages that mention them together. It misses a session that covered them in different exchanges.
search_content(MCP andGET /api/v1/search/content) now acceptsconcepts: two to five ideas in place ofpattern. Each concept runs as its own semantic search with the request's filters, and only sessions that every search found come back. Each result carriesconcept_evidence, the best passage per concept with its snippet, score,ordinal_range, and transcript revision, so the assistant can open each piece of evidence withget_messages.This replaces #1876. That PR proposed the feature before the shared search contract (#1875) and kit's group fusion (kenn-io/kit#118) landed. Its terms mode and exact session and branch filters are already on main, so this keeps only the concepts part and rebuilds the intersection on
rrf.FuseGroupsEvery.Limits and tradeoffs
candidate_truncatedreports when a window filled or the limit cut the result.cursor, a non-semanticmode, andpatternalongsideconceptsare rejected as input errors. Over HTTP, concepts need the semantic search-intent header, like semantic and hybrid modes.patternis no longer a required parameter in the OpenAPI spec or the MCP tool schema. The transports return "pattern or concepts required" when both are missing.revision_boundis true only when every piece of concept evidence also carries a revision. Each concept is a separate query, so evidence for one session can show different revisions if the session changed between the queries.Where to look
internal/service/search_concepts.go: validation, the per-concept searches, fusion, and ranking. PostgreSQL and ClickHouse serve through the same service path, so no backend-specific code changed.internal/server/huma_routes_search.goandinternal/mcp/tools.go: the transport checks run before the service, so a rejected request never reaches the store.conceptsyet. Teaching it is a separate change.Created with Claude Opus 5.5 in Claude Code.