Skip to content

Conversation

@haz3141
Copy link
Owner

@haz3141 haz3141 commented Sep 6, 2025

Step 6: Advanced RAG Enhancements

Features Added

  • Embeddings Pipeline: Added Embeddings class with sentence-transformers support and stub fallback for offline testing
  • FAISS Vector Store: Added FaissIndex for efficient vector similarity search with numpy fallback
  • Hybrid Retriever: Combined BM25 and vector scores with configurable alpha weighting
  • MCP Endpoint: Added /tools/retrieve_hybrid endpoint for hybrid retrieval
  • Comprehensive Tests: Added tests for hybrid retrieval with deterministic stub embeddings
  • CI Updates: Updated CI to run hybrid retrieval tests with stub embeddings

Technical Details

  • Uses sentence-transformers for embeddings (with fallback to stub for tests)
  • FAISS for vector similarity search (with numpy fallback)
  • Hybrid scoring combines normalized BM25 and vector scores
  • All tests use stub embeddings for deterministic, offline testing
  • Environment variables for configuration (EMBED_BACKEND, EMBED_MODEL, HYBRID_ALPHA)

Version

Bumps to v0.5.0

Testing

  • All tests pass with stub embeddings
  • Hybrid endpoint tested and working
  • CI configuration updated to include hybrid tests

…triever

- Add Embeddings class with sentence-transformers and stub fallback
- Add FaissIndex for vector similarity search with numpy fallback
- Add HybridRetriever combining BM25 and vector scores
- Add comprehensive tests for hybrid retrieval
- Update requirements.txt with new dependencies
- Add RetrieveHybridRequest model with query, k, and alpha parameters
- Add retrieve_hybrid endpoint that uses HybridRetriever
- Returns hits with both vector and BM25 scores for transparency
- Update .env.sample with new environment variables for embeddings and hybrid retrieval
- Update CI configuration to run hybrid retrieval tests with stub embeddings
- Add lab/security/redact.py for PII pattern redaction
- Add lab/security/guardian.py for tool allowlist and response sanitization
- Add comprehensive tests for security modules
- Integrate Guardian into MCP server endpoints
- Add audit logging for all tool calls
- Add evaluation harness with hit@k and mrr@k metrics
- Add observability with JSONL audit logs
- Add promotion flow documentation and security checklist
- Update CI with new tests and evaluation step
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.

2 participants