The Multilingual RAG System is designed for Arabic and English document understanding. It separates document processing, storage, and querying into clear layers to ensure scalability, multilingual support, and high-speed retrieval.
- Converts raw PDFs/DOCs into structured text blocks with metadata.
- Supports complex layouts (tables, multi-column text, footnotes).
- Automatically detects Arabic (RTL) vs. English (LTR) content.
- Outputs clean, chunked text ready for embedding.
-
Converts text chunks into multilingual semantic embeddings.
-
Stores vectors in Qdrant Cloud with:
- Language-specific collections (Arabic / English)
- High-speed vector similarity search
- Cloud scalability for large datasets
- Detects query language automatically.
- Retrieves top semantic matches from the relevant collection.
- Aggregates context for accurate, language-specific responses.
-
Powered by Groq-accelerated Llama models.
-
Produces multilingual answers enriched with:
- Contextual reasoning
- Source citations (page numbers & document names)
- Streamlit web app for interactive queries and document uploads.
- Streamlit Cloud deployment with secure secrets management.
Try the live app: https://multilingual-rag-app.streamlit.app/
-
Docker installed
-
A free Qdrant Cloud account
-
API keys for:
- Groq (LLM)
- Qdrant (vector DB)
- LlamaCloud (PDF extraction)
Required API Keys
-
Qdrant Cloud (Vector Database) Go to Qdrant Cloud → Create a free account → Create a new cluster → Copy your cluster URL and API key
-
Groq (LLM Provider) Visit Groq Console → Sign up and create API keys (We use two keys for load balancing Arabic and English)
-
LlamaCloud (PDF Extraction) Go to LlamaCloud → Sign up and get your API key (Required for document parsing)
Create a .streamlit/secrets.toml
file in the project root with your API keys:
# Qdrant Cloud Configuration
qdrant_url=https://your-cluster-url.qdrant.tech:6333
qdrant_api_key=your-qdrant-api-key
# Groq API Keys (for LLM)
groq_api_key=gsk_your-groq-api-key-for-arabic
groq_api_key_1=gsk_your-groq-api-key-for-english
# LlamaCloud API Key (for PDF extraction)
llama_cloud_api_key=llx_your-llamacloud-api-key
You can pull and run the prebuilt image from Docker Hub directly.
# Run prebuilt image from Docker Hub with secrets mounted
docker run --rm -p 8501:8501 `
-v ${PWD}/.streamlit/secrets.toml:/app/.streamlit/secrets.toml `
ymack/my-rag-app:latest
docker run --rm -p 8501:8501 \
-v $(pwd)/.streamlit/secrets.toml:/app/.streamlit/secrets.toml \
ymack/my-rag-app:latest
Then open your browser to: http://localhost:8501
If you prefer to build and run the image locally:
# Clone the repository
git clone https://github.com/yusufM03/multilingual-rag.git
cd multilingual-rag
# Build the Docker image locally
docker build -t my-rag-app .
# Run the container with secrets mounted
docker run --rm -p 8501:8501 \
-v $(pwd)/.streamlit/secrets.toml:/app/.streamlit/secrets.toml \
my-rag-app
Make sure .streamlit/secrets.toml
exists before running the container.
yusufm03-multilingual-rag//
├── .streamlit/
│ └── secrets.toml
├── config/
│ ├── __init__.py
│ └── settings.py
├── docs/
│ ├── Agentic RAG Task.pdf
│ ├── overview.png
├── Documents/
├── models/
│ └── rag_response.py
├── src/
│ ├── __init__.py
│ ├── app.py
│ └── core.py
├── utils/
│ ├── language_detector.py
│ └── store_logs.py
├── .dockerignore
├── .gitignore
├── dockerfile
├── readme.md
└── requirements.txt
Integrated with Weights & Biases (W&B) Cloud for:
- Version control of prompts & models
- Retrieval monitoring & drift detection
- Feedback-driven optimization
- Regression testing & batch evaluation
User Query → Qdrant Retrieval → LLM Response
↓ ↓
Retrieve Top-K Compute Evaluation
(context) ┌──────────────┐
└─────────▶│ Auto Metrics │
│ + W&B Logging│
└──────────────┘
↓
Continuous Monitoring & Improvement
↓
Batch Regression Testing
↓
Model/Prompt Updates & Deployment