Prerequisites
Before installing Mini RAG, ensure you have:Python >= 3.11
Mini RAG requires Python 3.11 or higher
OpenAI API Key
For embeddings and LLM generation (or compatible API)
Milvus Instance
Local or cloud instance for vector storage
Package Manager
uv (recommended), pip, or poetry
Install Mini RAG
Using uv (Recommended)
uv is a fast Python package installer and resolver:Using pip
Using poetry
Install from Source
For development or to use the latest features:- Using uv
- Using pip
Dependencies
Mini RAG automatically installs the following dependencies:| Package | Version | Purpose |
|---|---|---|
chonkie | >=1.4.1 | Smart text chunking with multiple strategies |
cohere | >=5.0.0 | Cohere API for advanced re-ranking |
markitdown | >=0.1.3 | Multi-format document loading (PDF, DOCX, images) |
pydantic | >=2.12.4 | Data validation and settings management |
pymilvus | >=2.5.0 | Vector database client for similarity search |
python-dotenv | >=1.2.1 | Environment variable management |
sentence-transformers | >=2.2.0 | Local cross-encoder models for re-ranking |
langfuse | >=2.0.0 | Observability and tracing |
openai | >=1.0.0 | OpenAI API client for embeddings and LLMs |
Set Up Milvus
Mini RAG uses Milvus as its vector database. Choose one of these options:Option 1: Zilliz Cloud (Recommended for Beginners)
The easiest way to get started with Milvus:1
Sign Up
Create a free account at cloud.zilliz.com
2
Create Cluster
Create a new cluster (free tier available)
3
Get Credentials
Copy your cluster URI and API token
4
Add to .env
Add credentials to your
.env fileOption 2: Local Milvus with Docker
Run Milvus locally using Docker:For local Milvus, you don’t need a token. Just set
MILVUS_URI=http://localhost:19530Option 3: Milvus on Kubernetes
For production deployments, see the Milvus Kubernetes documentation.Configure Environment Variables
Create a.env file in your project root:
.env
Using Azure OpenAI?
Using Azure OpenAI?
If you’re using Azure OpenAI, configure your environment like this:
Using a Local LLM?
Using a Local LLM?
Mini RAG works with any OpenAI-compatible API (e.g., llama.cpp, Ollama):
Verify Installation
Test that Mini RAG is installed correctly:test_installation.py
Troubleshooting
ImportError: No module named 'mini'
ImportError: No module named 'mini'
Solution: Ensure Mini RAG is installed in your current Python environment:If not listed, reinstall:
Connection error to Milvus
Connection error to Milvus
Solution: Check your Milvus configuration:
- Verify
MILVUS_URIis correct - Ensure Milvus is running (if using Docker:
docker ps) - Check network connectivity
- Verify token/credentials are correct
OpenAI API authentication error
OpenAI API authentication error
Solution: Verify your API key:
- Check
OPENAI_API_KEYis set correctly - Ensure key has not expired
- Verify key has required permissions
- Test key with a simple OpenAI API call
Python version error
Python version error
Solution: Mini RAG requires Python 3.11+:If you need to upgrade, use pyenv or download from python.org.
Dependency conflicts
Dependency conflicts
Solution: Create a fresh virtual environment:
Optional: Install Development Tools
If you’re planning to contribute or develop with Mini RAG:Next Steps
Quick Start
Build your first RAG application
Core Concepts
Learn about Mini RAG’s architecture
API Reference
Explore the complete API
Examples
See practical examples
