pguso/rag-from-scratch

Demystify RAG by building it from scratch. Local LLMs, no black boxes - real understanding of embeddings, vector search, retrieval, and context-augmented generation.

59
/ 100
Established

Implements a modular, JavaScript-based RAG pipeline with progressive learning examples covering embeddings, in-memory vector indexing, and retrieval strategies including hybrid search, multi-query decomposition, and query rewriting with LLM fallbacks. Built entirely with local models (via node-llama-cpp) and includes reusable library components for caching, normalization, and result fusion techniques like reciprocal rank fusion.

1,239 stars. Actively maintained with 3 commits in the last 30 days.

No Package No Dependents
Maintenance 16 / 25
Adoption 10 / 25
Maturity 13 / 25
Community 20 / 25

How are scores calculated?

Stars

1,239

Forks

135

Language

JavaScript

License

MIT

Last pushed

Mar 11, 2026

Commits (30d)

3

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/rag/pguso/rag-from-scratch"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.