← 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
Velocity · 7d
+6.5
★ / day
Trend
steady
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.

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