RagMini
Minimal local RAG stack: ingest a folder of .txt/.md files, chunk them, build a lightweight TF‑IDF index, retrieve top‑k passages, and output a grounded answer with citations (file + chunk ID) plus a debug view of retrieved chunks/scores.
Key Features
Ingests documents – Reads .txt and .md files from a folder
Chunks intelligently – Configurable chunk size and overlap
Builds index fast – TF-IDF vectors for efficient retrieval
Retrieves top-k results – Ranked by relevance with scores
Citations included – Every answer shows file + chunk ID for verification
Pure Python – No ML frameworks required, only stdlib
Repository & Documentation
GitHub: https://github.com/satsonmusic/RagMini
Main Implementation: https://github.com/satsonmusic/RagMini/blob/main/rag_ministack.py
Included Sample Documentation:
Getting Started Guide – Installation and usage
Architecture Overview – Design principles and reasoning
Success Metrics – How we measure effectiveness
Quick Start Guide
Step 1 Clone the repository
git clone https://github.com/satsonmusic/RagMini.git
cd RagMini
Step 2 Run a query against included sample documents
python rag_ministack.py --query "Your question here" --top-k 5
Example
Step 1 Add .md file with whatever text you want RagMini to analyze, summarize, answer questions, etc.
For ease of us, I have already added 3 sample documents discussing RagMini. However, you can add (and delete) anything you want in text and save as .md (recipes, research papers, quarterly reports etc.).
https://github.com/satsonmusic/RagMini.git)
Step 2 Run a query against the article and ask whatever you want RagMini to do with it. Continuing our example:
python rag_ministack.py --query "Is RagMini helpful for businessowners?" --top-k 3
Run it!