pguso/rag-from-scratch
A step-by-step tutorial building a complete Retrieval-Augmented Generation system using local LLMs and vector search.

Not currently ranked — collecting fresh signals.
star history
This project teaches RAG by implementing it from scratch in JavaScript, covering document loading, text chunking, embedding generation, vector storage and retrieval, re-ranking, query preprocessing, and context-augmented generation with local LLMs. It uses node-llama-cpp for local inference and provides detailed code walkthroughs so developers fully understand each component of a RAG pipeline.
Frequently asked
- What is pguso/rag-from-scratch?
- A step-by-step tutorial building a complete Retrieval-Augmented Generation system using local LLMs and vector search.
- Is rag-from-scratch open source?
- Yes — pguso/rag-from-scratch is open source, released under the MIT license.
- What language is rag-from-scratch written in?
- pguso/rag-from-scratch is primarily written in JavaScript.
- How popular is rag-from-scratch?
- pguso/rag-from-scratch has 1.5k stars on GitHub.
- Where can I find rag-from-scratch?
- pguso/rag-from-scratch is on GitHub at https://github.com/pguso/rag-from-scratch.