Skip to content
Development
Command

/search-similar

Find semantically similar items using vector similarity search.

From plugin
rohitg00-claude-code-toolkit
2.5k199 skills138 agents199 commands
Install
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/search-similar

Context preview

What this command does when you run it.

Find semantically similar items using vector similarity search.

Command definition

search-similar.md

/search-similar - Search Similar Items

Find semantically similar items using vector similarity search.

Steps

1. Take the search query text from the user 2. Generate an embedding for the query using the same model as the index 3. Perform approximate nearest neighbor search in the vector store 4. Retrieve the top-K most similar items (default: 10) 5. Calculate and display similarity scores for each result 6. Apply metadata filters if specified (category, date range, source) 7. Re-rank results using cross-encoder for improved precision 8. Deduplicate results that are too similar to each other (similarity > 0.95) 9. Format results with: rank, similarity score, source text, metadata 10. Provide a relevance assessment for the top results 11. Suggest query refinements if results are not satisfactory 12. Cache the query embedding for repeated searches

Rules

  • Use the same embedding model for queries and indexed items
  • Set a minimum similarity threshold to filter irrelevant results (default: 0.5)
  • Return metadata with results for context and source attribution
  • Handle empty results gracefully with alternative search suggestions
  • Limit result count to avoid overwhelming output (max 50)
  • Include the similarity metric used (cosine, dot product, euclidean)
  • Cache frequently searched queries for faster response times
Ships withrohitg00-claude-code-toolkit

The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.

Get the whole plugin