Repository navigation
feat(search): find content similar to a text, a resource, a topic or an entity - #296
Merged
Merged
Conversation
…an entity GET /similar, and find_similar for the assistant and MCP clients: the resources most like what was given, fused by rank from passages close in meaning (when search by meaning is set up), shared key words, shared topics and shared entities, each citing the moments that show it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSG4xbWi1TYHFmWSUh1CSt
…-5mx3gh # Conflicts: # DEVLOG.md
This was referenced Oct 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.
Requested by Adeel · project thread
Description
Before: search found moments that contain a query's words (or, with embeddings, its meaning). There was no way to ask "what else is like this passage, this resource, this topic or this entity".
After:
GET /api/v1/similartakes exactly one oftext,recording,topicorentityand lists the resources most like it, best first, each with why: up to three cited moments (open at the line or page), the key words it says, and the topics and entities in common. The chat assistant and MCP clients get the same asfind_similar.How:
app/domain/similar.pyfuses four ranked lists by reciprocal rank: passages close in meaning (only when search by meaning is set up; a resource uses the centre of its own passage vectors, so no model call), the text's rare key words (from thetermtable) or a resource's keywords OR'ed through the word index, shared topics, and shared entities (rarer ones weigh more). Without an embeddings server, the default install still answers by words, topics and entities, and calls no model.This is the API for the Similar tab and the selection popover; the web app part follows in the next PR.
Motivation and Context
Adeel asked for similar content as a dedicated tab on resources and in a popover when selecting text anywhere, including concepts, topics and the graph canvas. This PR is the API underneath it.
Types of changes
Checklist:
tests/api/test_similar.py,test_mcp.py).docs/accordingly (api.md, processing.md#similar-content, mcp.md, assistant.md; DEVLOG refine-later list).Done questions (AGENTS.md)
GET /similar, assistantfind_similar, MCPfind_similar.embeddings.*andsearch.*.make openapi).🤖 Generated with Claude Code
https://claude.ai/code/session_01NSG4xbWi1TYHFmWSUh1CSt