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.
RAG (Retrieval-augmented generation) ChatBot that provides answers based on contextual information extracted from a collection of Markdown files.
| Date | Stars |
|---|---|
| 2026-07-24 | 434 |
| 2026-07-25 | 435 |
| 2026-07-28 | 435 |
| 2026-07-30 | 435 |
| 2026-07-31 | 435 |
| 2026-08-06 | 435 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# RAG (Retrieval-augmented generation) ChatBot
[](https://github.com/umbertogriffo/rag-chatbot/actions/workflows/ci.yaml)
[](https://github.com/pre-commit/pre-commit)
[](https://github.com/astral-sh/ruff)
Check out the todo list to see the next steps and improvements we want to implement in this project [here](notes/todo.md).
> [!IMPORTANT]
> Disclaimer:
> The code has been tested on:
> * `Ubuntu 22.04.2 LTS` running on a Lenovo Legion 5 Pro with twenty `12th Gen Intel® Core™ i7-12700H` and
an `NVIDIA GeForce RTX 3060`.
> * `MacOS Sonoma 14.3.1` running on a MacBook Pro M1 (2020).
>
> If you are using another Operating System or different hardware, and you can't load the models, please
> take a look at the official llama.cpp's GitHub [issue](https://github.com/ggml-org/llama.cpp/issues).
> [!WARNING]
> It's important to note that the large language model sometimes generates hallucinations or false information.
## Table of contents
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Install Poetry](#install-poetry)
- [Bootstrap Environment](#bootstrap-environment)
- [How to use the make file](#how-to-use-the-make-file)
- [Environment](#environment)
- [Set the Open-Source LLM Model](#set-the-open-source-llm-model)
- [Set the Embedding Model](#set-the-embedding-model)
- [Set the Response Synthesis strategy](#set-the-response-synthesis-strategy)
- [Build the memory index](#build-the-memory-index)
- [Run the Chatbot](#run-the-chatbot)
- [References](#references)
## Introduction
This project combines the power of [llama.cpp](https://github.com/ggml-org/llama.cpp) and [Chroma](https://github.com/chroma-core/chroma) to build:
* a Conversation-aware Chatbot (ChatGPT like experience).
* a RAG (Retrieval-augmented generation) ChatBot.
The RAG Chatbot works by taking a collection of Markdown files as input and, when asked a question, provides the
corresponding answer based on the context provided by those files.

> [!NOTE]
> We decided to grab and refactor the `RecursiveCharacterTextSplitter` class from `LangChain` to effectively chunk
> Markdown files without adding LangChain as a dependency.
The `Memory Builder` component of the project loads Markdown pages from the `docs` folder.
It then divides these pages into smaller sections, calculates the embeddings (a numerical representation) of these
sections with the [Semantic Search](https://sbert.net/examples/sentence_transformer/applications/semantic-search/README.html) models
from [Sentence Transformers](https://sbert.net/index.html), and saves them in an embedding database called [Chroma](https://github.com/chroma-core/chroma) for later use.
When a user asks a question, the RAG ChatBot retrieves the most relevant sections from the Embedding database.
Since the original question can't be always optimal to retrieve for the LLM, we first prompt an LLM to rewrite the
question, then conduct retrieval-augmented reading.
The most relevant sections are then used as context to generate the final answer using a local language model (LLM).
Additionally, the chatbot is designed to remember previous interactions. It saves the chat history and considers the
relevant context from previous conversations to provide more accurate answers.
To deal with context overflows, we implemented two approaches:
* `Create And Refine the Context`: synthesize a responses sequentially through all retrieved contents.
* 
* `Hierarchical Summarization of Context`: generate an answer for each relevant section indepenExcerpt of 22,082 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:f11f7f33cbf7a060, topic:chatbot, name:chatbot, desc:chatbot
matched fp:f11f7f33cbf7a060, topic:vector-database
matched fp:f11f7f33cbf7a060, topic:gpu
matched fp:f11f7f33cbf7a060, topic:rag, desc:retrieval-augmented generation, readme:retrieval-augmented generation