<img alt="RAGLight" height="200px" src="https://github.com/Bessouat40/RAGLight/raw/3.4.7/media/raglight.png">
RAGLight is a lightweight and modular Python library for implementing Retrieval-Augmented Generation (RAG). It enhances the capabilities of Large Language Models (LLMs) by combining document retrieval with natural language inference.
Designed for simplicity and flexibility, RAGLight provides modular components to easily integrate various LLMs, embeddings, and vector stores, making it an ideal tool for building context-aware AI solutions.
⚠️ Requirements
Actually RAGLight supports :
- Ollama
- Google Gemini
- LMStudio
- vLLM
- OpenAI API
- Mistral API
- AWS Bedrock
If you use LMStudio, you need to have the model you want to use loaded in LMStudio. If you use AWS Bedrock, configure your AWS credentials (env vars,
~/.aws/credentials, or IAM role) — no extra install needed.
max_history cap.generate_streaming() on all providers — drop-in alongside generate() with no extra configuration.Install the base library:
pip install raglight
RAGLight uses optional extras for vector store backends, so you only install what you need:
| Extra | Package installed | Notes |
|---|---|---|
raglight[chroma] |
chromadb |
Requires a C++ compiler on Windows |
raglight[qdrant] |
qdrant-client |
Pure Python — works on Windows without a C++ compiler |
raglight[langfuse] |
langfuse |
Observability tracing |
pip install "raglight[qdrant]" # Qdrant only (Windows-friendly)
pip install "raglight[chroma]" # ChromaDB only
pip install "raglight[chroma,qdrant]" # both
pip install "raglight[qdrant,langfuse]" # Qdrant + observability
For the quickest and easiest way to get started, RAGLight provides an interactive command-line wizard. It will guide you through every step, from selecting your documents to chatting with them, without writing a single line of Python. Prerequisite: Ensure you have a local LLM service like Ollama running.
Just run this one command in your terminal:
raglight chat
You can also launch the Agentic RAG wizard with:
raglight agentic-chat
The wizard will guide you through the setup process. Here is what it looks like:
<img alt="RAGLight" src="https://github.com/Bessouat40/RAGLight/raw/3.4.7/media/cli.png">
The wizard will ask you for:
.venv, node_modules, __pycache__).After configuration, it will automatically index your documents and start a chat session.
RAGLight automatically excludes common directories that shouldn't be indexed, such as:
.venv, venv, env)node_modules)__pycache__)build, dist, target).vscode, .idea)You can customize this list during the CLI setup or use the default configuration. This ensures that only relevant code and documentation are indexed, improving performance and reducing noise in your search results.
The ignore folders feature is also available in all configuration classes, allowing you to specify which directories to exclude during indexing:
ignore_folders parameter to exclude folders during RAG pipeline indexingignore_folders parameter to exclude folders during AgenticRAG pipeline indexingignore_folders parameter to exclude folders during vector store operationsAll configuration classes use Settings.DEFAULT_IGNORE_FOLDERS as the default value, but you can override this with your custom list:
# Example: Custom ignore folders for any configuration
custom_ignore_folders = [
".venv",
"venv",
"node_modules",
"__pycache__",
".git",
"build",
"dist",
"temp_files", # Your custom folders
"cache"
]
# Use in any configuration class
config = RAGConfig(
llm=Settings.DEFAULT_LLM,
provider=Settings.OLLAMA,
ignore_folders=custom_ignore_folders # Override default
)
See the complete example in examples/ignore_folders_config_example.py for all configuration types.
raglight serve starts a FastAPI server configured entirely via environment variables — no Python code required.
raglight serve
Options :
--host Host to bind (default: 0.0.0.0)
--port Port to listen on (default: 8000)
--reload Enable auto-reload for development (default: false)
--workers Number of worker processes (default: 1)
--ui Launch the Streamlit chat UI alongside the API (default: false)
--ui-port Port for the Streamlit UI (default: 8501)
Example :
RAGLIGHT_LLM_MODEL=mistral-small-latest \
RAGLIGHT_LLM_PROVIDER=Mistral \
raglight serve --port 8080
Langfuse tracing example:
LANGFUSE_HOST=http://localhost:3000 \
LANGFUSE_PUBLIC_KEY=pk-lf-... \
LANGFUSE_SECRET_KEY=sk-lf-... \
raglight serve
Langfuse tracing is enabled automatically when
LANGFUSE_HOST(orLANGFUSE_BASE_URL),LANGFUSE_PUBLIC_KEYandLANGFUSE_SECRET_KEYare all set in the environment. Requirespip install "raglight[langfuse]".
Add --ui to start a Streamlit chat interface alongside the REST API — no extra setup required:
raglight serve --ui
| Address | Service |
|---|---|
http://localhost:8000 |
REST API + Swagger (/docs) |
http://localhost:8501 |
Streamlit chat UI |
The UI lets you:
- Chat with your documents — full conversation history, markdown rendering
- Upload files directly from the browser (PDF, TXT, code…)
- Ingest a directory by providing a path on the server machine
- Switch LLM on the fly — the sidebar's ⚙️ Model settings panel lets you change provider, model, and API base URL without restarting the server (AWSBedrock and GoogleGemini included)
Use --ui-port to change the Streamlit port:
raglight serve --ui --port 8000 --ui-port 3000
Both processes share the same configuration (env vars) and are terminated together when you stop the server.
| Method | Path | Body | Response |
|---|---|---|---|
GET |
/health |
— | {"status": "ok"} |
POST |
/generate |
{"question": "..."} |
{"answer": "..."} |
POST |
/ingest |
{"data_path": "...", "file_paths": [...], "github_url": "...", "github_branch": "main"} |
{"message": "..."} |
POST |
/ingest/upload |
multipart/form-data — field files (one or more files) |
{"message": "..."} |
GET |
/collections |
— | {"collections": [...]} |
GET |
/config |
— | {"llm_provider": "...", "llm_model": "...", "llm_api_base": "..."} |
POST |
/config |
{"llm_provider": "...", "llm_model": "...", "llm_api_base": "..."} |
{"llm_provider": "...", "llm_model": "...", "llm_api_base": "..."} |
The interactive API documentation (Swagger UI) is automatically available at http://localhost:8000/docs.
# Health check
curl http://localhost:8000/health
# Ask a question
curl -X POST http://localhost:8000/generate \
-H "Content-Type: application/json" \
-d '{"question": "What is RAGLight?"}'
# Ingest a local folder
curl -X POST http://localhost:8000/ingest \
-H "Content-Type: application/json" \
-d '{"data_path": "./my_documents"}'
# Ingest a GitHub repository
curl -X POST http://localhost:8000/ingest \
-H "Content-Type: application/json" \
-d '{"github_url": "https://github.com/Bessouat40/RAGLight", "github_branch": "main"}'
# Upload files directly (multipart)
curl -X POST http://localhost:8000/ingest/upload \
-F "files=@./rapport.pdf" \
-F "files=@./notes.txt"
# List collections
curl http://localhost:8000/collections
All server settings are read from RAGLIGHT_* environment variables. Copy examples/serve_example/.env.example to .env and adjust the values.
| Variable | Default | Description |
|---|---|---|
RAGLIGHT_LLM_MODEL |
llama3 |
LLM model name |
RAGLIGHT_LLM_PROVIDER |
Ollama |
LLM provider (Ollama, Mistral, OpenAI, LmStudio, GoogleGemini) |
RAGLIGHT_LLM_API_BASE |
http://localhost:11434 |
LLM API base URL |
RAGLIGHT_EMBEDDINGS_MODEL |
all-MiniLM-L6-v2 |
Embeddings model name |
RAGLIGHT_EMBEDDINGS_PROVIDER |
HuggingFace |
Embeddings provider (HuggingFace, Ollama, OpenAI, GoogleGemini) |
RAGLIGHT_EMBEDDINGS_API_BASE |
http://localhost:11434 |
Embeddings API base URL |
RAGLIGHT_DB |
Chroma |
Vector store backend (Chroma or Qdrant) |
RAGLIGHT_PERSIST_DIR |
./raglight_db |
Local persistence directory (used when RAGLIGHT_DB_HOST is not set) |
RAGLIGHT_COLLECTION |
default |
Collection name |
RAGLIGHT_K |
5 |
Number of documents retrieved per query |
RAGLIGHT_SYSTEM_PROMPT |
(default prompt) | Custom system prompt for the LLM |
RAGLIGHT_DB_HOST |
— | Remote vector store host (leave unset for local on-disk storage) |
RAGLIGHT_DB_PORT |
— | Remote vector store port |
RAGLIGHT_API_TIMEOUT |
300 |
Request timeout in seconds for the Streamlit UI (increase for slow models) |
The quickest way to deploy in production :
cd examples/serve_example
cp .env.example .env # edit values as needed
docker-compose up
The docker-compose.yml uses extra_hosts: host.docker.internal:host-gateway so the container can reach an Ollama instance running on the host machine.
You can set sev
$ claude mcp add RAGLight \
-- python -m otcore.mcp_server <graph>