Skip to content

docs(cookbook): add zero-cloud local hybrid RAG recipe with SQLite FTS5 and Sentence Transformers - #368

Open
Cagrik34 wants to merge 3 commits into
huggingface:mainfrom
Cagrik34:recipe/sqlite-hybrid-rag-sentence-transformers
Open

docs(cookbook): add zero-cloud local hybrid RAG recipe with SQLite FTS5 and Sentence Transformers#368
Cagrik34 wants to merge 3 commits into
huggingface:mainfrom
Cagrik34:recipe/sqlite-hybrid-rag-sentence-transformers

Conversation

@Cagrik34

Copy link
Copy Markdown

Summary

This recipe introduces a self-contained, zero-cloud reference implementation of Hybrid Retrieval-Augmented Generation (RAG) integrating SQLite FTS5 (BM25) and Dense Vector Cosine Similarity with open-source Sentence Transformers (sentence-transformers/all-MiniLM-L6-v2).

Key Technical Details

  • Zero External Infrastructure: Operates entirely within an embedded SQLite database (:memory: or local .db), eliminating external vector database overhead.
  • Dual-Engine Retrieval: Fuses 384-dimensional dense semantic vectors with native SQLite FTS5 full-text token matching.
  • Reciprocal Rank Fusion (RRF, $k=60$): Resolves score calibration challenges and guarantees recall of exact numeric tokens, part codes, and domain acronyms.
  • Strict Grounding: Demonstrates citation formatting ([1], [2]) ready for any open-source SLM/LLM pipeline.

Location

  • notebooks/en/zero_cloud_hybrid_rag_sqlite_fts5.ipynb
  • Added entry to notebooks/en/_toctree.yml under LLM Recipes.

Reviewers

cc @merveenoyan @stevhliu

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Cagrik34

Cagrik34 commented Sep 6, 2026

Copy link
Copy Markdown
Author

Hi @huggingface team, friendly check-in. This is a zero-cloud Hybrid RAG cookbook recipe: sentence-transformers embeddings + SQLite FTS5 (BM25) + RRF (k=60), no third-party vector databases or paid APIs. Self-contained notebook with reproducible outputs. Ready for review whenever convenient. Thank you!

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