Skip to main content

Tools

Collection Management

ToolDescription
create_collectionCreate collection with specified distance metric (Cosine/Euclid/Dot)
list_collectionsList all collections
get_collection_infoGet collection details and statistics
delete_collectionDelete collection and all documents

Document Operations

ToolDescription
add_documentsAdd documents with automatic embedding (supports string/number IDs, metadata)
semantic_searchNatural language search with optional metadata filtering
hybrid_searchHybrid search combining semantic and keyword (BM25) search with RRF
delete_documentsDelete specific documents by ID

Code Vectorization

ToolDescription
index_codebaseIndex a codebase for semantic code search with AST-aware chunking
search_codeSearch indexed codebase using natural language queries
reindex_changesIncrementally re-index only changed files (detects added/modified/deleted)
get_index_statusGet indexing status and statistics for a codebase
clear_indexDelete all indexed data for a codebase
ToolDescription
find_similarFind code similar to given chunks or code blocks using Qdrant recommend API

find_similar — Find Similar Code

Find chunks similar to given examples (positive) and dissimilar to others (negative). Works with chunk IDs from previous search results and/or raw code blocks.

Parameters:

ParameterTypeRequiredDefaultDescription
positiveIdsstring[]no*[]Chunk IDs from previous search results to find similar code
positiveCodestring[]no*[]Raw code blocks to find similar code (embedded on-the-fly)
negativeIdsstring[]no[]Chunk IDs to push results away from
negativeCodestring[]no[]Raw code blocks to push results away from
strategystringnobest_scoreRecommend strategy: best_score, average_vector, sum_scores
filterobjectnoQdrant native filter (must/should/must_not)
pathPatternstringnoGlob pattern to filter results by file path
fileExtensionsstring[]noFilter by file extensions (e.g. [".ts", ".js"])
rerankstring | objectnorelevanceRerank preset or custom weights
limitnumberno10Max results to return
offsetnumberno0Offset for pagination
levelstringnoby presetchunk (alpha-blended) or file (file signals only, one per file)
metaOnlybooleannofalseReturn metadata only (no content)
collection / pathstringyesProject path or collection name

*At least one positive or negative input is required. average_vector and sum_scores strategies require at least one positive input.

Strategy descriptions:

  • best_score (default) — Scores each candidate against every example independently. Most flexible, supports negative-only queries.
  • average_vector — Averages all positive vectors, subtracts negative. Fastest. Requires at least one positive.
  • sum_scores — Sums scores across all examples. Middle ground. Requires at least one positive.

Example — find more code like a previous result:

{
"collection": "code_abc123",
"positiveIds": ["chunk-uuid-from-search-result"],
"limit": 10
}

Example — find code similar to a snippet but not like another:

{
"collection": "code_abc123",
"positiveCode": ["async function handleAuth(req, res) { ... }"],
"negativeCode": ["function legacyAuth(callback) { ... }"],
"fileExtensions": [".ts"],
"rerank": "codeReview"
}

Search Parameters

level — Analysis Level

Controls scoring granularity and result grouping. Available on semantic_search, hybrid_search, find_similar, and rank_chunks.

ValueScoringGrouping
chunkAlpha-blended file + chunk signalsAll chunks returned
filePure file signals only (alpha forced = 0)One best chunk per file

Default: determined by the preset's signalLevel. Explicit value overrides the preset. If no preset and no explicit value — defaults to chunk.

File-level presets (default to level: "file"): securityAudit, ownership, onboarding.

{
"collection": "code_abc123",
"query": "authentication",
"rerank": "securityAudit",
"level": "file"
}

rerank — Result Reranking

Reorder search results based on git metadata signals.

For semantic_search / hybrid_search (analytics):

PresetUse CaseSignals
relevanceDefault semantic similaritysimilarity only
techDebtFind legacy problematic codeage + churn + bugFix + volatility
hotspotsBug huntingchunkChurn + chunkRelativeChurn + burstActivity + bugFix + volatility
codeReviewReview recent changesrecency + burstActivity + density + chunkChurn
onboardingEntry points for new devsdocumentation + stability
securityAuditOld code in critical pathsage + pathRisk + bugFix + ownership + volatility
refactoringRefactoring candidateschunkChurn + relativeChurnNorm + chunkSize + volatility + bugFix + age
ownershipKnowledge transferownership + knowledgeSilo (flags single-author code)
impactAnalysisDependency analysisimports count

For search_code (practical development):

PresetUse CaseBoost
relevanceDefault semantic similarity
recentFind recently modified codelow ageDays
stableFind stable implementation exampleslow commitCount

Custom weights:

{ "custom": { "similarity": 0.7, "recency": 0.3 } }

Available weight keys: similarity, recency, stability, churn, age, ownership, chunkSize, documentation, imports, bugFix, volatility, density, chunkChurn, relativeChurnNorm, burstActivity, pathRisk, knowledgeSilo, chunkRelativeChurn

metaOnly — Metadata Only Response

For semantic_search / hybrid_search only. Returns metadata without content:

{
"score": 0.87,
"relativePath": "src/auth/login.ts",
"startLine": 45,
"endLine": 89,
"language": "typescript",
"chunkType": "function",
"name": "handleLogin",
"imports": ["express", "jsonwebtoken", "./utils"],
"git": { "ageDays": 5, "commitCount": 12, "dominantAuthor": "alice" }
}

imports contains file-level imports (inherited by all chunks from that file). Used by impactAnalysis reranking to boost files with many dependencies.

Use for file discovery, analytics, or reducing response size.

Resources

  • qdrant://collections — list all collections
  • qdrant://collection/{name} — collection details