Skip to content

feat(rag): step 6B retrieval tool (MCP)#26

Open
haz3141 wants to merge 1 commit intomainfrom
feat/rag-s6b-retrieval
Open

feat(rag): step 6B retrieval tool (MCP)#26
haz3141 wants to merge 1 commit intomainfrom
feat/rag-s6b-retrieval

Conversation

@haz3141
Copy link
Copy Markdown
Owner

@haz3141 haz3141 commented Sep 6, 2025

What

RAG retrieval tool with real embedding-based document search for MCP server.

Scope

  • Query → embed → cosine similarity → top-k (k=3–5) retrieval
  • Return passages + metadata (doc_id, chunk_id, similarity_score)
  • Fallback to mock results when RAG components unavailable
  • Integration with existing MCP server /tools/search_docs endpoint

Files Added/Modified

  • mcp-server/tools/search_docs.py - Real embedding query functionality
  • mcp-server/server.py - Updated to use new search tool
  • tests/rag/test_retrieval_topk.py - Top-k retrieval tests with mocks

Dependencies

  • Depends on S6A (ingestion/embeddings) for full functionality
  • Graceful fallback when components not available
  • No breaking changes to existing API

Testing

  • Mock-based tests for deterministic behavior
  • Top-k ordering validation
  • Error handling and fallback scenarios

Await CI: Merge after all gates pass.

- Add mcp-server/tools/search_docs.py with real embedding query
- Update mcp-server/server.py to use new search tool
- Add tests/rag/test_retrieval_topk.py with top-k retrieval tests
- Query → embed → cosine → top-k (k=3–5) functionality
- Return passages + metadata (doc_id, chunk_id, score)
- Fallback to mock results when RAG components unavailable

Awaits CI for merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant