This guide provides efficient search strategies and workflows for developers implementing new features or debugging the Qdrant RAG MCP Server.
- Use specific search queries instead of browsing files manually
- Search for function implementations with patterns like
"function_name implementation" - Find related code by searching for multiple keywords:
"file_hash metadata modified_at" - Use the Task tool to break down complex implementations into searchable components
Goal: Implement incremental reindexing that only processes changed files.
Key Search Queries:
# Find existing reindex implementation
"reindex_directory function implementation"
"delete_file_chunks calculate_file_hash"
"file_hash metadata modified_at"
# Find where to add incremental logic
"detect_changes implementation comparison"
"scroll through all points file metadata"
# Understand collection clearing
"clear_project_collections delete collection"Files to Focus On:
src/qdrant_mcp_context_aware.py- Main reindex logicsrc/utils/file_hash.py- Hash calculation utilities
Goal: Implement query intent classification and dynamic search optimization.
Key Search Queries:
# Current search implementation
"search_code search_docs hybrid search"
"search_mode vector keyword hybrid"
"query processing search intent"
# Ranking and scoring
"enhanced_ranker ranking_signals"
"vector_score bm25_score combined"
# Configuration handling
"server_config.json search parameters"Files to Focus On:
src/qdrant_mcp_context_aware.py- Search methodssrc/utils/enhanced_ranker.py- Ranking logicsrc/utils/hybrid_search.py- Search mode handling
Goal: Implement multi-level context API for efficient token usage.
Key Search Queries:
# Context expansion features
"include_context context_chunks expand"
"get_file_chunks surrounding chunks"
"_expand_search_context implementation"
# Token optimization
"truncate_content max_length token"
"chunk_size chunk_overlap configuration"Files to Focus On:
- Context expansion logic in search methods
- Chunk retrieval and assembly
Goal: Implement query reformulation and synonym expansion.
Key Search Queries:
# Current query handling
"query reformulation synonym"
"embedding_model encode query"
"search preprocessing normalization"
# Language processing
"ast_chunker language detection"
"code vocabulary mapping"-
Search for file type detection:
"suffix in supported_extensions" "file_type determination extension" -
Find indexer patterns:
"CodeIndexer ConfigIndexer DocumentationIndexer" "index_file chunk metadata" -
Update collection routing:
"get_collection_name file_type" "ensure_collection create"
-
Understand current search flow:
"search tool implementation mcp" "filter_conditions must match" -
Find ranking logic:
"ranking_signals score calculation" "combine_search_results deduplication"
-
Find metadata storage patterns:
"payload metadata chunk storage" "PointStruct vector payload" -
Update all indexers:
"index_code payload fields" "index_config metadata extraction" "index_documentation chunk metadata"
After implementing changes, test with:
# Test health check
"Check system health"
# Test reindexing
"Detect changes in current directory"
"Smart reindex this directory"
# Test search
"Search for [your test query]"
"Search code for [function name]"-
Check indexed content:
"Get file chunks for [file path]" -
Verify collections:
"Get current project context" -
Review logs:
./scripts/qdrant-logs -f --operation [operation_name]
-
Main Server:
src/qdrant_mcp_context_aware.py- MCP tool definitions
- Core indexing/search logic
- Collection management
-
Indexers:
src/indexers/code_indexer.py- AST-based code chunkingconfig_indexer.py- Configuration file parsingdocumentation_indexer.py- Markdown/docs parsing
-
Utilities:
src/utils/ast_chunker.py- Language-specific AST parsingenhanced_ranker.py- Multi-signal rankinghybrid_search.py- BM25 + vector searchfile_hash.py- File change detection
- MCP Server Restart Required: Changes to
qdrant_mcp_context_aware.pyrequire restarting Claude Code - Collection Names: Always use
get_collection_name()for project isolation - Error Handling: Use structured error returns with
error_codefor better debugging - Logging: Use
get_logger()for project-aware logging
- Use the Agent tool for complex searches across multiple files
- Create todos for multi-step implementations to track progress
- Search for test files to understand expected behavior
- Check git history for similar past implementations
Remember: The RAG server is your assistant for understanding its own codebase. Use it liberally!