RAG-based AI chatbot about Tunisian archaeological sites using Llama 3, ChromaDB, and Streamlit
# đïž Chatbot RAG - Patrimoine ArchĂ©ologique de Tunisie
Chatbot intelligent utilisant une architecture RAG (Retrieval-Augmented Generation) pour répondre aux questions sur les sites archéologiques tunisiens.
## đ FonctionnalitĂ©s
- **Recherche vectorielle** dans ChromaDB avec embeddings (all-MiniLM-L6-v2)
- **Génération de réponses** via LLM local (Llama 3 / Ollama)
- **Interface utilisateur** Streamlit interactive
- **Sources citées** avec scores de pertinence
- **Support multilingue** français/arabe
## đïž Architecture
```
Documents (PDF, TXT, JSON)
â
Nettoyage & Structuration
â
Découpage en chunks (300-500 tokens)
â
Embedding (all-MiniLM-L6-v2)
â
ChromaDB (collection persistante)
â
Question utilisateur â Embedding â Recherche k-NN
â
Top-k chunks + métadonnées
â
Prompt enrichi (Question + Contexte + Instructions)
â
LLM local (Llama 3 via Ollama)
â
Réponse structurée + Sources
```
## đ Installation
### Prérequis
- Python 3.9-3.12 (recommandé: 3.11) - Python 3.13+ non supporté
- Ollama avec Llama 3
### Ătapes
```bash
# 1. Cloner le projet
git clone
cd patrimoine-tunisie-rag
# 2. Créer environnement virtuel (avec Python 3.11 recommandé)
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/Mac
# 3. Installer les dépendances
pip install -r requirements.txt
# 4. Installer Ollama et Llama 3
# Télécharger Ollama:
ollama.ai
ollama pull llama3
# 5. Ingérer les données dans ChromaDB
python ingest.py
# 6. Tester le pipeline RAG
python rag.py
# 7. Lancer l'interface Streamlit
streamlit run app.py
```
### Note sur Python
Ce projet nécessite Python 3.9-3.12. Si vous avez Python 3.13+, installez une version compatible:
- Windows:
python.org
- Ou utilisez pyenv/conda pour gérer plusieurs versions
## đ Structure du Projet
```
âââ data/ # Corpus de documents
â âââ carthage.txt
â âŠ