RLAMA is a powerful AI-driven question-answering tool for your documents, seamlessly integrating with your local Ollama models. It enables you to create, manage, and interact with Retrieval-Augmented Generation (RAG) systems tailored to your documentation needs.
RLAMA aims to become the definitive tool for creating local RAG systems that work seamlessly for everyone—from individual developers to large enterprises. Here's our strategic roadmap:
RLAMA's core philosophy remains unchanged: to provide a simple, powerful, local RAG solution that respects privacy, minimizes resource requirements, and works seamlessly across platforms.
curl -fsSL https://raw.githubusercontent.com/dontizi/rlama/main/install.sh | sh
RLAMA is built with:
RLAMA follows a clean architecture pattern with clear separation of concerns:
rlama/
├── cmd/ # CLI commands (using Cobra)
│ ├── root.go # Base command
│ ├── rag.go # Create RAG systems
│ ├── run.go # Query RAG systems
│ └── ...
├── internal/
│ ├── client/ # External API clients
│ │ └── ollama_client.go # Ollama API integration
│ ├── domain/ # Core domain models
│ │ ├── rag.go # RAG system entity
│ │ └── document.go # Document entity
│ ├── repository/ # Data persistence
│ │ └── rag_repository.go # Handles saving/loading RAGs
│ └── service/ # Business logic
│ ├── rag_service.go # RAG operations
│ ├── document_loader.go # Document processing
│ └── embedding_service.go # Vector embeddings
└── pkg/ # Shared utilities
└── vector/ # Vector operations
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Documents │────>│ Document │────>│ Embedding │
│ (Input) │ │ Processing │ │ Generation │
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Query │────>│ Vector │<────│ Vector Store│
│ Response │ │ Search │ │ (RAG System)│
└─────────────┘ └─────────────┘ └─────────────┘
▲ │
│ ▼
┌─────────────┐ ┌─────────────┐
│ Ollama │<────│ Context │
│ LLM │ │ Building │
└─────────────┘ └─────────────┘
RLAMA is designed to be lightweight and portable, focusing on providing RAG capabilities with minimal dependencies. The entire system runs locally, with the only external dependency being Ollama for LLM capabilities.
You can get help on all commands by using:
rlama --help
These flags can be used with any command:
--host string Ollama host (default: localhost)
--port string Ollama port (default: 11434)
--num-thread int Number of threads for Ollama to use (default: 0, use Ollama default)
Performance Optimization:
- Use --num-thread 16 (or your CPU core count) to potentially improve processing speed
- Ollama often uses half the available cores by default
- Setting this to your full core count can significantly speed up text generation and embeddings
Usage Examples:
# Use 16 threads for better performance
rlama --num-thread 16 run my-docs
# Create a RAG with optimized thread usage
rlama --num-thread 16 rag llama3 documentation ./docs
# Run with custom host and thread settings
rlama --host 192.168.1.100 --port 11434 --num-thread 16 run my-rag
RLAMA stores data in ~/.rlama by default. To use a different location:
Command-line flag (highest priority):
bash
# Use with any command
rlama --data-dir /path/to/custom/directory run my-rag
Environment variable:
bash
# Set the environment variable
export RLAMA_DATA_DIR=/path/to/custom/directory
rlama run my-rag
The precedence order is: command-line flag > environment variable > default location.
Creates a new RAG system by indexing all documents in the specified folder.
rlama rag [model] [rag-name] [folder-path]
Parameters:
- model: Name of the Ollama model to use (e.g., llama3, mistral, gemma) or a Hugging Face model using the format hf.co/username/repository[:quantization].
- rag-name: Unique name to identify your RAG system.
- folder-path: Path to the folder containing your documents.
Example:
# Using a standard Ollama model
rlama rag llama3 documentation ./docs
# Using a Hugging Face model
rlama rag hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF my-rag ./docs
# Using a Hugging Face model with specific quantization
rlama rag hf.co/mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated-GGUF:Q5_K_M my-rag ./docs
Creates a new RAG system by crawling a website and indexing its content.
rlama crawl-rag [model] [rag-name] [website-url]
Parameters:
- model: Name of the Ollama model to use (e.g., llama3, mistral, gemma).
- rag-name: Unique name to identify your RAG system.
- website-url: URL of the website to crawl and index.
Options:
- --max-depth: Maximum crawl depth (default: 2)
- --concurrency: Number of concurrent crawlers (default: 5)
- --exclude-path: Paths to exclude from crawling (comma-separated)
- --chunk-size: Character count per chunk (default: 1000)
- --chunk-overlap: Overlap between chunks in characters (default: 200)
- --chunking-strategy: Chunking strategy to use (options: "fixed", "semantic", "hybrid", "hierarchical", default: "hybrid")
RLAMA offers multiple advanced chunking strategies to optimize document retrieval:
The system automatically adapts to different document types: - Markdown documents: Split by headers and sections - HTML documents: Split by semantic HTML elements - Code documents: Split by functions, classes, and logical blocks - Plain text: Split by paragraphs with contextual overlap
$ claude mcp add rlama \
-- python -m otcore.mcp_server <graph>