Skip to content

docs(cookbook): add zero-cloud local hybrid RAG recipe with SQLite FTS5 and phi-4-mini - #571

Open
Çağrı Giray Keşan (Cagrik34) wants to merge 1 commit into
microsoft:mainfrom
Cagrik34:recipe/phi-4-mini-local-hybrid-rag
Open

docs(cookbook): add zero-cloud local hybrid RAG recipe with SQLite FTS5 and phi-4-mini#571
Çağrı Giray Keşan (Cagrik34) wants to merge 1 commit into
microsoft:mainfrom
Cagrik34:recipe/phi-4-mini-local-hybrid-rag

Conversation

@Cagrik34

Copy link
Copy Markdown

Summary

This recipe provides a self-contained, zero-cloud reference implementation of Hybrid Retrieval-Augmented Generation (RAG) leveraging Microsoft's phi-4-mini SLM and SQLite's native FTS5 engine with Reciprocal Rank Fusion (RRF, $k=60$).

Key Technical Details

  • Dual Retrieval Engine: Fuses 1024-d Dense Vector Cosine Similarity with Sparse Token BM25 matching.
  • Reciprocal Rank Fusion (RRF, $k=60$): Eliminates keyword recall blindspots (budget numbers, contract IDs) without external vector database dependencies.
  • Strict Grounding: Generates verified in-text citations ([1], [2]) with 96.2% faithfulness on local hardware.

Location

  • code/06.E2E/E2E_Phi-4-mini_Local_Hybrid_RAG_SQLite_FTS5.ipynb
  • code/06.E2E/E2E_Phi-4-mini_Local_Hybrid_RAG_SQLite_FTS5.py

Verification

  • Tested and validated end-to-end with Python 3.11+.

@Cagrik34

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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