Thank you for your interest in contributing to OpenRAG! 🎉
Whether you're fixing a bug, adding a feature, improving documentation, or just exploring — every contribution matters and helps make OpenRAG better for everyone.
This guide will help you set up your development environment and start contributing quickly.
- Quickstart
- Prerequisites
- Initial Setup
- Development Workflows
- Service Management
- Reset & Cleanup
- Makefile Help System
- Testing
- Project Structure
- Troubleshooting
- Code Style
- Create a Pull Request
Get OpenRAG running in three commands:
make check_tools # Verify you have all prerequisites
make setup # Install dependencies and create .env
make dev # Start OpenRAGOpenRAG is now running locally on the following ports:
- Frontend: http://localhost:3000
- Langflow: http://localhost:7860
| Tool | Version | Installation |
|---|---|---|
| Docker or Podman | Latest | Docker or Podman |
| Python | 3.13+ | With uv package manager |
| Node.js | 18+ | With npm |
| Make | Any | Usually pre-installed on macOS/Linux |
If using Podman on macOS, configure the VM with enough memory (8GB recommended):
# Stop and remove existing machine (if any)
podman machine stop
podman machine rm
# Create new machine with 8GB RAM and 4 CPUs
podman machine init --memory 8192 --cpus 4
podman machine startImportant
8GB RAM is the minimum recommended for running OpenRAG smoothly. If you experience crashes or slowness, increase the memory allocation.
make check_toolsYou should see: All required tools are installed.
-
Clone the repo and setup the project:
git clone https://github.com/langflow-ai/openrag.git cd openrag make setup -
Configure the required environment variables before starting OpenRAG:
OPENAI_API_KEY= OPENSEARCH_PASSWORD= LANGFLOW_SUPERUSER=admin LANGFLOW_SUPERUSER_PASSWORD=
The
OPENSEARCH_PASSWORDmust adhere to the OpenSearch password complexity requirements.If
LANGFLOW_SUPERUSER_PASSWORDisn't set, then the Langflow instance starts without authentication enabled.For more information, see the OpenRAG environment variables reference.
-
Start OpenRAG using one of the options described in the next section.
make dev # With GPU support # or make dev-cpu # CPU only
There are multiple ways to start OpenRAG based on your use case:
- Local development environment: Recommended for development.
- Full Docker stack: Simple build that runs everything in containers. Not ideal for development. Best for testing the full system.
- Branch development: Build OpenRAG with a fork or branch of the Langflow repository.
- Docling only: Run the Docling service by itself.
Everything runs in containers. Best for testing the full system.
make dev # Start with GPU support
make dev-cpu # Start with CPU only
make stop # Stop and remove all containersTip
This is the recommended workflow for active development. It provides faster code reloading and easier debugging.
Run infrastructure in Docker, but backend/frontend locally for faster iteration.
# Terminal 1: Start infrastructure (OpenSearch, Langflow, Dashboards)
make dev-local-cpu
# Terminal 2: Run backend locally
make backend
# Terminal 3: Run frontend locally
make frontend
# Terminal 4 (optional): Start docling for document processing
make doclingBenefits:
- Faster code reloading
- Direct access to logs and debugging
- Easier testing and iteration
Tip
When running the backend with make backend, you can access the interactive API documentation at http://localhost:8000/docs.
Build and run OpenRAG with a custom Langflow branch:
# Use a specific branch
make dev-branch BRANCH=my-feature-branch
# Use a different repository
make dev-branch BRANCH=feature-x REPO=https://github.com/myorg/langflow.gitNote
The first build may take several minutes as it compiles Langflow from source.
Additional branch commands:
make build-langflow-dev # Rebuild Langflow image (no cache)
make stop-dev # Stop branch dev containers
make restart-dev # Restart branch dev environment
make clean-dev # Clean branch dev containers and volumes
make logs-lf-dev # View Langflow dev logs
make shell-lf-dev # Shell into Langflow dev containerDocling handles document parsing and OCR:
make docling # Start docling-serve
make docling-stop # Stop docling-servemake stop # Stops and removes all OpenRAG containersmake status # Show container status
make health # Check health of all servicesmake logs # All container logs
make logs-be # Backend logs only
make logs-fe # Frontend logs only
make logs-lf # Langflow logs only
make logs-os # OpenSearch logs onlymake shell-be # Shell into backend container
make shell-lf # Shell into Langflow container
make shell-os # Shell into OpenSearch containermake stop # Stop and remove containers
make clean # Stop, remove containers, and delete volumesmake db-reset # Reset OpenSearch indices (keeps data directory)
make clear-os-data # Clear OpenSearch data directory completelyCaution
This will delete all data, containers, and volumes. Use only when you need a completely fresh start.
make factory-reset # Complete reset: containers, volumes, and dataTip
The Makefile provides color-coded, organized help for all commands. Run make help to get started!
make help # Main help with common commands
make help_dev # Development environment commands
make help_docker # Docker and container commands
make help_test # Testing commands
make help_local # Local development commands
make help_utils # Utility commands (logs, cleanup, etc.)make test # Run all backend tests
make test-integration # Run integration tests (requires infra)
make test-sdk # Run SDK tests (requires running OpenRAG)
make lint # Run linting checksmake test-ci # Full CI: start infra, run tests, tear down
make test-ci-local # Same as above, but builds images locallyopenrag/
├── src/ # Backend Python code
│ ├── api/ # REST API endpoints
│ ├── services/ # Business logic
│ ├── models/ # Data models
│ ├── connectors/ # External integrations
│ └── config/ # Configuration
├── frontend/ # Next.js frontend
│ ├── app/ # App router pages
│ ├── components/ # React components
│ └── contexts/ # State management
├── flows/ # Langflow flow definitions
├── docs/ # Documentation
├── tests/ # Test files
├── Makefile # Development commands
└── docker-compose.yml # Container orchestration
Note
Ensure these ports are available before starting OpenRAG:
| Port | Service |
|---|---|
| 3000 | Frontend |
| 7860 | Langflow |
| 8000 | Backend |
| 9200 | OpenSearch |
| 5601 | OpenSearch Dashboards |
If containers crash or are slow:
# For Podman on macOS, increase VM memory
podman machine stop
podman machine rm
podman machine init --memory 8192 --cpus 4
podman machine startTip
If things aren't working, try a full reset:
make stop
make clean
cp .env.example .env # Reconfigure as needed
make setup
make devmake health- Run
make helpto see all available commands - Check existing issues
- Review documentation
- Use
make statusandmake healthfor debugging - View logs with
make logs
- Follow PEP 8 style guidelines
- Use type hints
- Document with docstrings
- Use
structlogfor logging
- Follow React/Next.js best practices
- Use TypeScript for type safety
- Use Tailwind CSS for styling
- Follow established component patterns
If you want to propose your changes to the OpenRAG maintainers, make sure your code is fully tested and ready for review:
- Fork and Branch: Create a feature branch from
main - Test: Ensure tests pass with
make testandmake lint - Document: Update relevant documentation. To build and test documentation changes, see Contribute OpenRAG documentation.
- Commit: Use clear, descriptive commit messages
- PR Description: Explain changes and include testing instructions
Important
All PRs must pass CI tests before merging.
For more information and suggestions for successful contributions, see Contribute to OpenRAG.
Thank you for contributing to OpenRAG! 🚀