← all repositories

pguso/rag-from-scratch

A step-by-step tutorial building a complete Retrieval-Augmented Generation system using local LLMs and vector search.

1.5k stars JavaScript RAG · SearchLearningLanguage Models
rag-from-scratch
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.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.