Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Demystify RAG by building it from scratch. Local LLMs, no black boxes - real understanding of embeddings, vector search, retrieval, and context-augmented generation.
| Date | Stars |
|---|---|
| 2026-07-24 | 1479 |
| 2026-07-25 | 1479 |
| 2026-07-28 | 1479 |
| 2026-07-30 | 1479 |
| 2026-07-31 | 1485 |
| 2026-08-10 | 1548 |
| 2026-08-18 | 1571 |
| 2026-08-19 | 1570 |
| 2026-08-20 | 1568 |
| 2026-08-21 | 1571 |
| 2026-08-22 | 1574 |
| 2026-08-23 | 1575 |
| 2026-08-24 | 1597 |
| 2026-08-25 | 1605 |
| 2026-08-26 | 1607 |
| 2026-08-27 | 1607 |
| 2026-08-28 | 1608 |
| 2026-08-29 | 1609 |
| 2026-08-30 | 1611 |
| 2026-08-31 | 1613 |
| 2026-09-01 | 1615 |
| 2026-09-02 | 1616 |
| 2026-09-03 | 1617 |
| 2026-09-04 | 1618 |
| 2026-09-05 | 1619 |
| 2026-09-07 | 1620 |
| 2026-09-08 | 1622 |
| 2026-09-09 | 1624 |
| 2026-09-10 | 1624 |
| 2026-09-12 | 1625 |
| 2026-09-13 | 1626 |
| 2026-09-14 | 1627 |
| 2026-09-15 | 1628 |
| 2026-09-16 | 1629 |
| 2026-09-17 | 1630 |
| 2026-09-19 | 1631 |
| 2026-09-20 | 1632 |
Today
+1 stars today
This week
+6 stars this week
This month
+61 stars this month
Momentum
0.0
growth rate 0.37%/day
 # RAG from Scratch **Demystify Retrieval-Augmented Generation (RAG) by building it yourself - step by step.** No black boxes. No cloud APIs. Just clear explanations, simple examples, and local code you fully understand. This project follows the same philosophy as [AI Agents from Scratch](https://github.com/pguso/ai-agents-from-scratch): make advanced AI concepts approachable for developers through minimal, well-explained, real code. --- ## What You'll Learn - **What RAG really is**, and why it’s so powerful for knowledge retrieval. - **How embeddings work**, turn text into numbers your model can understand. - **How to build a local vector database**, store and query documents efficiently. - **How to connect everything**, retrieve context and feed it into an LLM for grounded answers. - **How to re-rank and normalize**, improving retrieval precision and reducing noise. - **Query rewriting**, normalize and rewrite user queries (heuristic and LLM) before retrieval. - **Step-by-step code walkthroughs**, every function explained, nothing hidden. --- ## Concept Overview Retrieval-Augmented Generation (RAG) enhances language models by giving them access to **external knowledge**. Instead of asking the model to “remember” everything, you let it **retrieve relevant context** before generating a response. **Pipeline:** 1. **Knowledge Requirements**, define questions and data needs. 2. **Data Loading**, import and structure your documents. 3. **Text Splitting & Chunking**, divide data into manageable pieces. 4. **Embedding**, turn chunks into numerical vectors. 5. **Vector Store**, save and index embeddings for fast retrieval. 6. **Retrieval**, fetch the most relevant context for a given query. 7. **Post-Retrieval Re-Ranking**, re-order results to prioritize the best context. 8. **Query Preprocessing & Embedding Normalization**, clean and standardize input vectors for consistency. 9. **Augmentation**, merge retrieved context into the model’s prompt. 10. **Generation**, produce grounded answers using a local LLM. --- ## Learning Path Follow these examples in order to build understanding progressively: ### 0. **How RAG Works** `examples/00_how_rag_works/` [Code](examples/00_how_rag_works/example.js) | [Code Explanation](examples/00_how_rag_works/CODE.md) | [Concepts](examples/00_how_rag_works/CONCEPT.md) **What you'll learn:** - The core idea behind Retrieval-Augmented Generation - How retrieval and generation work together - A minimal, simplified end-to-end RAG flow in under 70 lines of code **Key concepts:** retrieval, generation, context injection, similarity search --- ### 1. **Data Loading** `examples/02_data_loading/` [Code](examples/02_data_loading/example.js) | [Code Explanation](examples/02_data_loading/CODE.md) | [Concepts](examples/02_data_loading/CONCEPT.md) **What you'll learn:** - Loading raw text data - Normalizing and preparing documents **Key concepts:** file I/O, preprocessing, document structure --- ### 2. **Text Splitting & Chunking** `examples/03_text_splitting_and_chunking/` [Code](examples/03_text_splitting_and_chunking/example.js) | [Code Explanation](examples/03_text_splitting_and_chunking/CODE.md) | [Concepts](examples/03_text_splitting_and_chunking/CONCEPT.md) **What you'll learn:** - How to split long text into manageable chunks - Overlaps, boundaries, and chunk strategies **Key concepts:** chunking logic, context windows, granularity trade-offs --- ### 3. **Embedding** `examples/04_intro_to_embeddings/02_generate_embeddings/` [Code](examples/04_intro_to_embeddings/02_generate_embeddings/example.js) | [Code Explanation](examples/04_intro_to_embeddings/02_generate_embeddings/CODE.md) | [Concepts](examples/04_intro_to_embeddings/02_generate_embeddings/CONCEPT.md) **What you'll learn:** - How embeddings represent meaning as vectors - How to generate embeddings locally **Key concepts:** vector representation, similarity, embedding models --- ### 4
Excerpt of 18,445 characters
Read on GitHubPatric Gutersohn
2
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:6552f61beeed97e2, topic:ai-agents, topic:agents, readme:ai agents
matched fp:6552f61beeed97e2, topic:llm
matched fp:6552f61beeed97e2, topic:rag, readme:retrieval-augmented generation, readme:retrieval augmented
matched fp:6552f61beeed97e2, topic:tutorial, topic:educational, readme:learning path