# 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.

Repository: https://github.com/pguso/rag-from-scratch
Canonical: https://ross.abutalabs.com/products/pguso-rag-from-scratch
Language: JavaScript
License: MIT
License Family: permissive
Topics: agents, ai-agents, educational, llm, node-llama-cpp, nodejs, rag, rag-chatbot, rag-pipeline, tutorial
Last push: 2026-03-11T11:44:33+00:00

## Health v2 (maintenance only)
Score: 49/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 71, release rhythm 35, longevity 22
- inputs: {"age_days": 310, "days_push": 175, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1607, forks 193 (observed 2026-08-28T04:05:10.549286+00:00)

## What it is
An educational repository that teaches Retrieval-Augmented Generation (RAG) by building it step by step from scratch in JavaScript, using local LLMs via node-llama-cpp with no cloud APIs. It covers the full RAG pipeline including embeddings, vector stores, retrieval, re-ranking, and query rewriting with explained code walkthroughs.

## Use cases
- learn how RAG works by building it from scratch
- understand how embeddings and vector search work
- build a local RAG chatbot without cloud APIs
- implement a RAG pipeline in Node.js
- learn query rewriting and re-ranking for retrieval
- run LLM-powered retrieval locally with node-llama-cpp
- study a minimal end-to-end RAG example

## When to choose
- you want to deeply understand RAG internals rather than use a framework
- you prefer local LLMs and no external API dependencies
- you are a JavaScript/Node.js developer learning AI concepts
- you want progressive, well-explained tutorial examples

## When to avoid
- you need a production-ready RAG framework or library
- you want managed cloud vector databases or hosted LLM APIs
- you work primarily in Python with LangChain/LlamaIndex ecosystems
- you need scalable, optimized retrieval for large document collections

## Facets
- artifact type: learning-resource
- maturity: active
- function: rag, llm-inference, machine-learning, nlp, search-engine, developer-tools
- domain: large-language-models, artificial-intelligence, tutorials, education
- platform: cross-platform
- tags: rag-from-scratch, local-llm, embeddings, vector-search, node-llama-cpp, educational-project, hands-on-tutorial, no-cloud-apis, retrieval-augmented-generation, natural-language-processing, nodejs, javascript

## Member repositories
- pguso/rag-from-scratch (main) score 49

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:10.549286+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:51:48.488095+00:00, confidence not recorded.
  - readme: https://github.com/pguso/rag-from-scratch (fetched 2026-08-28T04:05:10.549286+00:00, sha e0d560501b5d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
