Logo Lanfrica

Hadirlabidi/Projet_AI

Domain:

natural language processing

Record type:

software
Creator:
Had
Host:
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 │