A production-ready Retrieval-Augmented Generation (RAG) system with multilingual support and agentic architecture using open-source LLM models.
- β 5 languages: English, Spanish, French, Chinese, Arabic
- β Automatic language detection
- β Multilingual embeddings
- β Responses in query language
- Router Agent: Routes queries to specialized handlers
- Retrieval Agent: Vector search and document retrieval
- Synthesis Agent: Generates responses using LLM
- Validation Agent: Fact-checking and quality validation
- Orchestrator pattern for agent collaboration
- β Fully tested (5/5 tests passed)
- β Docker containerized
- β Streamlit web interface
- β REST API with FastAPI
- β Vector database (Qdrant)
- β Local LLM (Ollama)
- β Docker & Docker Compose (v20.10+)
- β Python 3.9+
- β 8GB RAM minimum (16GB recommended)
- β 20GB disk space
- β Linux/macOS or Windows with WSL2
git clone https://github.com/AdityaJ9801/Multilingual-Agentic-RAG.git
cd Multilingual-Agentic-RAGdocker-compose up -d
sleep 60 # Wait for services to initializebash scripts/ingest_sample_data.shpip install -r streamlit_requirements.txtstreamlit run streamlit_app.py- π¨ Streamlit UI: http://localhost:8501
- π API Docs: http://localhost:8000/docs
- β Health Check: http://localhost:8000/api/v1/health
- Open http://localhost:8501
- Go to Query tab
- Enter your query in any language
- Click Submit
- View results with sources
Query the System:
curl -X POST "http://localhost:8000/api/v1/query" \
-H "Content-Type: application/json" \
-d '{
"query": "What is machine learning?",
"language": "en",
"top_k": 5,
"include_sources": true
}'Upload Documents:
curl -X POST "http://localhost:8000/api/v1/ingest" \
-F "file=@document.txt"List Documents:
curl http://localhost:8000/api/v1/documentsCheck Health:
curl http://localhost:8000/api/v1/healthEdit .env file to customize:
OLLAMA_MODEL: LLM model to use (mistral, llama2, etc.)OLLAMA_TEMPERATURE: Response creativity (0.0-1.0)CHUNK_SIZE: Document chunk size in charactersSUPPORTED_LANGUAGES: Comma-separated language codesEMBEDDING_MODEL: Multilingual embedding model
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Gateway β
β (REST API, Request Validation) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β β
ββββββΌββββββ βββββββββΌβββββββ
β Ingestion β β Query Engine β
β Pipeline β β (Orchestrator)
ββββββ¬ββββββ βββββββββ¬βββββββ
β β
β ββββββββββββββββββββββΌβββββββββββββββββββββ
β β β β
ββββββΌβββββΌβββ ββββββββββββ ββΌβββββββββββ ββββββββΌβββ
β Document β β Router β β Retrieval β βSynthesisβ
β Processor β β Agent β β Agent β β Agent β
ββββββ¬ββββββββ ββββββββββββ βββββββββββββ ββββββ¬βββββ
β β
β ββββββββββββββββββββββββββββββββββββββββ€
β β β
ββββββΌβββββΌβββββββββββ βββββββββββββΌβββ
β Embeddings β β Validation β
β (Sentence-Trans) β β Agent β
ββββββ¬ββββββββββββββββ ββββββββββββββββ
β
ββββββΌβββββββββββββββ
β Vector Database β
β (Qdrant) β
βββββββββββββββββββββ
ββββββββββββββββββββ
β LLM Service β
β (Ollama) β
ββββββββββββββββββββ
- PDF:
.pdf(via pdfplumber and PyPDF2) - Text:
.txt(UTF-8, Latin-1, CP1252) - Markdown:
.md - JSON:
.json - CSV:
.csv
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/ingest |
Upload and process documents |
| POST | /api/v1/query |
Submit queries and get responses |
| GET | /api/v1/documents |
List ingested documents |
| DELETE | /api/v1/documents/{id} |
Remove a document |
| GET | /api/v1/health |
Health check |
| GET | /api/v1/agents/status |
Agent status |
docker-compose down
docker-compose up -ddocker-compose logs
docker-compose restart# Verify API is running
curl http://localhost:8000/api/v1/health
# Check Streamlit logs in terminal# Re-ingest sample data
bash scripts/ingest_sample_data.sh- Check Docker resources:
docker stats - Verify Ollama is running:
docker-compose ps - Reduce
top_kparameter in queries
multi_agentic_rag/
βββ app/ # Application code
βββ scripts/ # Helper scripts
βββ sample_data/ # Sample documents
βββ streamlit_app.py # Streamlit frontend
βββ docker-compose.yml # Docker configuration
βββ requirements.txt # Dependencies
βββ INSTALLATION_GUIDE.md # Installation steps
βββ ARCHITECTURE.md # System design
βββ API_DOCS.md # API documentation
βββ README.md # This file
# Stop all services
docker-compose down
# Stop and remove volumes
docker-compose down -v