A visual, node-based RAG (Retrieval-Augmented Generation) pipeline builder that allows you to create, customize, and execute RAG workflows through an intuitive drag-and-drop interface.
RAG Flow enables you to build complex document processing and question-answering pipelines by connecting different nodes in a visual graph. Each node performs a specific task—loading documents, splitting text, generating embeddings, storing vectors, retrieving relevant context, and generating AI responses.
┌─────────────┐ ┌───────────────┐ ┌─────────────┐
│ PDF Loader │ ──▶ │ Text Splitter │ ──▶ │ Embedder │
└─────────────┘ └───────────────┘ └─────────────┘
│
▼
┌─────────────┐ ┌───────────────┐ ┌─────────────┐
│ LLM Response │ ◀───│ Retriever │ ◀───│ Vector Store│
└─────────────┘ └───────────────┘ └─────────────┘
| Component | Technology |
|---|---|
| Backend | FastAPI, Python |
| Frontend | React + Vite + ReactFlow |
| Vector Store | ChromaDB |
| Embeddings | HuggingFace (sentence-transformers/all-MiniLM-L6-v2) |
| LLM | Ollama (llama3) |
| Graph Execution | NetworkX |
- Python 3.9+ (if running locally)
- Node.js 18+ (if running locally)
- Docker & Docker Compose
- Ollama installed and running (for LLM)
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start the backend server
uvicorn app.main:app --reloadcd frontend
# Install dependencies
npm install
# Start the development server
npm run devMake sure Ollama is running with the llama3 model:
ollama pull llama3
ollama serve# Build and run all services
docker-compose up --build
# Run in background
docker-compose up -d --buildThe services will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:8000
Note: The backend is configured to connect to Ollama on the host machine at http://host.docker.internal:11434. If Ollama runs elsewhere, update OLLAMA_BASE_URL in docker-compose.yml.
| Method | Endpoint | Description |
|---|---|---|
| POST | /run-flow |
Execute a RAG flow |
| GET | /documents |
List all indexed documents |
| DELETE | /documents/{source} |
Delete a document by source |
- PDF Loader - Load PDF documents from file paths
- Text Splitter - Split documents into overlapping chunks (default: 500 chars, 50 overlap)
- Embedder - Generate embeddings using HuggingFace sentence transformers
- Vector Store - Persist and query embeddings using ChromaDB
- Retriever - Retrieve relevant context from vector store based on query
- LLM - Generate responses using Ollama with RAG context (streaming support)
- Graph-based Execution - Flows execute as directed acyclic graphs (DAG) using topological sort
- Node Registry - Dynamic node registration system for easy extensibility
- Streaming Responses - Real-time token streaming from LLM to client
- Drag-and-drop canvas - Built with ReactFlow
- Sidebar - Add nodes (PDF Loader, Text Splitter, Embedder, Vector Store, Retriever, LLM)
- Node configuration panel - Configure node settings
- Export/Import flows - Save and load flow configurations as JSON files
- List all indexed documents with chunk counts
- Delete documents by source
- Persistent vector storage
- More Document Loaders - Support for Word, CSV, TXT, HTML, and URLs
- Multiple Embedding Models - Support for OpenAI, Azure OpenAI, and other embedding providers
- Multiple LLM Providers - Support for OpenAI, Anthropic, Google Gemini, and local models
- Flow Templates - Pre-built templates for common RAG use cases
- Conversation Memory - Maintain chat history across interactions
- Multi-document RAG - Query across multiple document sources
- Hybrid Search - Combine semantic and keyword search
- Re-ranking - Add re-ranking nodes for improved retrieval
- Flow Versioning - Track and version flow changes
- Analytics Dashboard - Track query performance and metrics
- API Key Management - Secure storage for API keys
- User Authentication - Multi-user support with roles
- Custom Nodes - Plugin system for user-defined nodes
{
"nodes": [
{
"id": "loader",
"data": {
"type": "pdf_loader",
"config": { "path": "./documents/sample.pdf" }
}
},
{
"id": "splitter",
"data": { "type": "text_splitter", "config": {} }
},
{
"id": "embedder",
"data": { "type": "embedder", "config": {} }
},
{
"id": "vectorstore",
"data": { "type": "vector_store", "config": {} }
},
{
"id": "retriever",
"data": {
"type": "retriever",
"config": { "query": "What is this document about?" }
}
},
{
"id": "llm",
"data": { "type": "llm", "config": { "model": "llama3" } }
}
],
"edges": [
{ "source": "loader", "target": "splitter" },
{ "source": "splitter", "target": "embedder" },
{ "source": "embedder", "target": "vectorstore" },
{ "source": "vectorstore", "target": "retriever" },
{ "source": "retriever", "target": "llm" }
]
}MIT