A production-ready, open-source Live RAG (Retrieval-Augmented Generation) system designed specifically for Frappe documents. Dossier provides real-time document ingestion, intelligent chunking, semantic search, and natural language Q&A capabilities through a modern chat interface.
- Live Document Synchronization: Real-time webhook processing for automatic document ingestion
- Intelligent Text Chunking: Semantic-aware document splitting with configurable overlap
- Lightweight Vector Embeddings: High-quality embeddings using BGE-small model
- Contextual Search: Semantic similarity search with metadata filtering
- Natural Language Q&A: AI-powered responses using local LLM inference
- Modern Chat Interface: Real-time streaming responses with source highlighting
- Production-Ready: Docker-first deployment with comprehensive monitoring
- Extensible Architecture: Frappe-agnostic design for any document type
Dossier is built as a microservices architecture with clear separation of concerns:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frappe ββββββ Webhook Handler ββββββ Message Queue β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β React Frontend ββββββ API Gateway β β Ingestion Svc β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Query Service ββββββ LLM Service β β Embedding Svc β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β PostgreSQL β β Redis β β Qdrant VDB β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Webhook Handler (Node.js): Receives and validates Frappe webhooks
- Ingestion Service (Python): Processes documents and manages ingestion workflows
- Embedding Service (Python): Generates vector embeddings using BGE-small model
- Query Service (Python): Handles semantic search and retrieval
- LLM Service (Python): Generates natural language responses using Ollama
- API Gateway (Python): Authentication, rate limiting, and request routing
- Frontend (React): Modern chat interface with real-time streaming
- PostgreSQL: Configuration and metadata storage
- Redis: Message queuing and caching
- Qdrant: Vector database for semantic search
- Ollama: Local LLM inference engine
- Docker 20.10+ and Docker Compose 2.0+
- 8GB RAM minimum (16GB recommended)
- 50GB free disk space
git clone https://github.com/your-org/dossier.git
cd dossier
# Copy and edit environment configuration
cp .env.example .env
# Edit .env with your Frappe instance details# Start all services
make up
# Wait for services to be ready
make health-check
# Pull LLM models (optional - takes time)
make pull-models- Chat Interface: http://localhost:3000
- API Gateway: http://localhost:8080
- Service Health: http://localhost:8080/health
Key configuration options in .env:
# Database Configuration
DATABASE_URL=postgresql://dossier:your_password@postgres:5432/dossier
REDIS_URL=redis://redis:6379
# Frappe Integration
FRAPPE_URL=https://your-frappe-instance.com
FRAPPE_API_KEY=your_frappe_api_key
FRAPPE_API_SECRET=your_frappe_api_secret
# Security
JWT_SECRET=your_jwt_secret_key
WEBHOOK_SECRET=your_webhook_secret
# LLM Configuration
DEFAULT_MODEL=llama3.2
OLLAMA_URL=http://ollama:11434
# Embedding Configuration
EMBEDDING_MODEL=all-MiniLM-L6-v2
BATCH_SIZE=32Configure which Frappe doctypes to index:
# Access the database
make db-shell
# Insert doctype configuration
INSERT INTO doctype_configs (doctype, enabled, fields, filters, chunk_size, chunk_overlap)
VALUES ('Customer', true, '["customer_name", "customer_details"]', '{"disabled": 0}', 1000, 200);# Check all services
make health-check
# Check specific service
curl http://localhost:8001/health
# View service logs
make logs- Prometheus Metrics: Available at
/metricsendpoint on each service - Structured Logging: JSON logs with correlation IDs
- Distributed Tracing: Request flow tracking across services
# Run performance benchmarks
make benchmark
# View system metrics
make metrics# Run all tests
make test-all
# Run specific test suites
make test-e2e # End-to-end functionality
make test-performance # Performance benchmarks
make test-integration # System integration
# Run deployment validation
python scripts/deployment-validation.py# Test complete workflow
make integration-full
# Test individual components
make test-webhook
make test-ingestion
make test-query# Create production environment
make prod-setup
# Edit production configuration
nano .env.prod# Generate secure secrets
openssl rand -hex 32 # JWT_SECRET
openssl rand -hex 32 # WEBHOOK_SECRET
openssl rand -base64 32 # POSTGRES_PASSWORD# Build production images
make prod-build
# Start production services
make prod-up
# Verify deployment
make prod-status
make health-check-prodConfigure reverse proxy (Nginx/Traefik) for SSL termination. See Deployment Guide for detailed instructions.
# Set up development environment
make setup-dev
# Start development services with hot reload
make dev-up
# Run development tools
make lint
make format
make test- Service Extensions: Add new endpoints to existing services
- Custom Processors: Implement custom chunking or embedding strategies
- UI Components: Extend the React frontend with new features
- Monitoring: Add custom metrics and dashboards
Each service exposes OpenAPI documentation:
- API Gateway: http://localhost:8080/docs
- Ingestion Service: http://localhost:8001/docs
- Query Service: http://localhost:8003/docs
- LLM Service: http://localhost:8004/docs
- Deployment Guide: Comprehensive deployment instructions
- API Reference: Complete API documentation
- Configuration Guide: Detailed configuration options
- Development Guide: Development setup and workflows
-
Services Won't Start
# Check logs make logs # Check resource usage docker stats
-
Database Connection Issues
# Test database connectivity make db-shell # Check database logs docker-compose logs postgres
-
High Memory Usage
# Check memory usage docker stats --no-stream # Restart services make restart
# Enable debug logging
export DEBUG=true
export LOG_LEVEL=DEBUG
# Restart services
make restartYou are welcome to contribute!
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
This project is licensed under the MIT License.
- Frappe Framework for the excellent base platform
- Qdrant for the vector database
- Ollama for local LLM inference
- FastAPI for the API framework
- React for the frontend framework
Built with β€οΈ for the Frappe community
For detailed deployment instructions, see the Deployment Guide.