user257814938/VEV_RAG

🚀 Agent RAG haute performance fonctionnant 100% en local sur CPU.

Python

0

33 commits

updated Dec 13, 2025

See the code

README

Chat Interface

🚀 Installation Rapide

  1. Installer les dépendances : pip install -r requirements.txt
  2. ** Pour traiter l'audio, installer FFmpeg manuellement. Le plus simple sur Windows est d'utiliser winget dans un terminal (PowerShell ou CMD)** : 'winget install Gyan.FFmpeg'
  3. Télécharger le reranker : python src/retrieval/reranker_installer.py
  4. Installer / Lister / Changer / Supprimer un LLM : python models/llm/llm_model_installer.py
  5. Lancer l'application : streamlit run app.py
  6. Nettoyer les caches : python clear_cache.py
  7. Vérifier les chemins : python monitoring/verify_paths.py

🚀 VEV RAG - Agent RAG Haute Performance 100% Local

VEV Agent

Agent RAG (Retrieval-Augmented Generation) haute performance fonctionnant 100% en local sur CPU.

Python License CPU Only Local First


📋 Table des Matiùres


🎯 À Propos

VEV RAG est un systĂšme de recherche documentaire intelligent qui combine :

  • 🔍 Recherche sĂ©mantique avancĂ©e avec embeddings
  • đŸ€– GĂ©nĂ©ration de rĂ©ponses via LLM local (Qwen3-4B)
  • 📚 Ingestion multi-format (PDF, DOCX, TXT, Web)
  • đŸ’Ÿ Base vectorielle hybride (LanceDB)
  • ⚡ Performance CPU optimisĂ©e (ONNX, GGUF)

Le projet fonctionne entiÚrement en local, sans dépendance cloud, garantissant confidentialité et autonomie.


✹ FonctionnalitĂ©s

đŸ”„ Principales

  • ✅ Ingestion intelligente : Support PDF, Word, TXT et pages web
  • ✅ Chunking sĂ©mantique : DĂ©coupage intelligent par sens (2023)
  • ✅ Embeddings rapides : BGE-M3 via FastEmbed (ONNX)
  • ✅ Recherche hybride : Vectorielle + BM25/FTS
  • ✅ Reranking : MXBai Rerank v2 pour affiner les rĂ©sultats
  • ✅ Cache sĂ©mantique : GPTCache pour accĂ©lĂ©rer les requĂȘtes
  • ✅ LLM local : Qwen3-4B quantifiĂ© (GGUF Q4_K_M)
  • ✅ Interface Streamlit : Chat interactif avec upload de documents
  • ✅ Évaluation RAGAS : MĂ©triques de qualitĂ© automatiques

đŸ›Ąïž SĂ©curitĂ© & Performance

  • 🔒 100% Local : Aucune donnĂ©e ne quitte votre machine
  • ⚡ CPU OptimisĂ© : Fonctionne sans GPU
  • 📊 Évaluation continue : Scores de fidĂ©litĂ© et pertinence
  • đŸ§č Nettoyage avancĂ© : ftfy, clean-text, Spacy

đŸ—ïž Architecture

graph TB
    A[Documents PDF/DOCX/TXT/Web] --> B[Ingestion & Nettoyage]
    B --> C[Chunking Sémantique]
    C --> D[Embeddings BGE-M3]
    D --> E[LanceDB Vectorielle]
    F[Question Utilisateur] --> G[Query Expansion HyDE]
    G --> H[Recherche Hybride]
    E --> H
    H --> I[Reranking MXBai]
    I --> J[LLM Qwen3-4B]
    J --> K[Réponse Générée]
    L[GPTCache] -.-> H

Pipeline Complet

  1. Ingestion : Docling (IBM 2024) convertit les documents en Markdown
  2. Nettoyage : ftfy + clean-text + Spacy normalisent le texte
  3. Chunking : Segmentation sémantique intelligente
  4. Vectorisation : FastEmbed + BGE-M3 (ONNX, CPU-optimisé)
  5. Stockage : LanceDB (hybride vectoriel + BM25)
  6. Recherche : Query expansion (HyDE) + recherche hybride
  7. Reranking : MXBai Rerank v2 affine le top-5
  8. Génération : Qwen3-4B (GGUF Q4) génÚre la réponse
  9. Évaluation : RAGAS mesure la qualitĂ©

📩 Installation

Prérequis

  • Python 3.10 ou supĂ©rieur
  • 8 GB RAM minimum (16 GB recommandĂ©)
  • CPU moderne (pas de GPU requis)

Installation Rapide

# Cloner le dépÎt
git clone https://github.com/user257814938/VEV_RAG.git
cd VEV_RAG

# Créer un environnement virtuel
python -m venv venv
source venv/bin/activate  # Sur Windows: venv\Scripts\activate

# Installer les dépendances
pip install -r requirements.txt

# Télécharger les modÚles
python src/scripts/download_reranker.py

Configuration

Créez un fichier .env à la racine (optionnel) :

# Chemins personnalisés (optionnel)
DATA_DIR=./data
MODELS_DIR=./models

🚀 Utilisation

Interface Streamlit (Recommandé)

streamlit run app.py

Ouvrez votre navigateur Ă  http://localhost:8501

Utilisation Programmatique

from main import VEVRAGAgent

# Initialiser l'agent
agent = VEVRAGAgent()

# Ingérer des documents
agent.ingest_documents(["document.pdf", "article.docx"])

# Poser une question
response = agent.query("Quelle est la définition de l'IA ?")
print(response)

Tests

# Lancer les tests
pytest tests/

# Test d'ingestion
python tests/test_ingestion.py

# Test de recherche
python tests/test_retrieval.py

📁 Structure du Projet

VEV_RAG/
├── 📄 app.py                    # Interface Streamlit
├── 📄 main.py                   # Orchestration principale (VEVRAGAgent)
├── 📄 requirements.txt          # DĂ©pendances Python
├── 📂 src/
│   ├── 📂 core/
│   │   ├── config.py           # Configuration & variables d'environnement
│   │   └── schemas.py          # Structures de donnĂ©es (Pydantic)
│   ├── 📂 ingestion/
│   │   ├── loader_doc.py       # Chargement PDF/DOCX (Docling)
│   │   ├── loader_web.py       # Extraction web (Trafilatura)
│   │   └── cleaner.py          # Nettoyage texte (ftfy, Spacy)
│   ├── 📂 indexing/
│   │   ├── chunker.py          # Chunking sĂ©mantique
│   │   ├── embedder.py         # Embeddings (FastEmbed + BGE-M3)
│   │   └── vector_store.py     # Base vectorielle (LanceDB)
│   ├── 📂 retrieval/
│   │   ├── cache.py            # Cache sĂ©mantique (GPTCache)
│   │   ├── query_expansion.py  # AmĂ©lioration requĂȘtes (HyDE)
│   │   └── reranker.py         # Reranking (MXBai)
│   ├── 📂 generation/
│   │   ├── llm_engine.py       # Moteur LLM (Qwen3-4B GGUF)
│   │   └── system_prompts.py   # Prompts systùme
│   ├── 📂 evaluation/
│   │   └── ragas_eval.py       # Évaluation qualitĂ© (RAGAS)
│   └── 📂 scripts/
│       ├── download_reranker.py # TĂ©lĂ©chargement modĂšles
│       └── verify_paths.py      # VĂ©rification structure
├── 📂 data/
│   ├── raw/                    # Documents bruts
│   ├── processed/              # Documents traitĂ©s
│   └── lancedb/                # Base vectorielle
├── 📂 models/
│   ├── llm/                    # Modùles LLM (GGUF)
│   └── embeddings/             # Modùles embeddings
└── 📂 tests/
    ├── test_ingestion.py       # Tests ingestion
    └── test_retrieval.py       # Tests recherche

ïżœ Analyse ComplĂšte des Formats SupportĂ©s

CatégorieFormatExtensionMoteurStatut
Documents OfficePDF.pdfDocling (v2)✅ SupportĂ© (avec OCR & Tableaux)
Microsoft Word.docxDocling (v2)✅ SupportĂ©
Microsoft Excel.xlsxDocling (v2)✅ SupportĂ© (Conversion Markdown)
Microsoft PowerPoint.pptxDocling (v2)✅ SupportĂ©
Texte & WebTexte Brut.txtPython Natif✅ SupportĂ© (Ultra-rapide)
Markdown.mdPython Natif✅ SupportĂ© (Ultra-rapide)
HTML / XHTML.html, .htmDocling (v2)✅ SupportĂ©
XML / AsciiDoc.xml, .adocDocling (v2)✅ SupportĂ©
WebVTT.vttDocling (v2)✅ SupportĂ© (Sous-titres)
Images (OCR)Images.png, .jpg, .tiff, .bmp, .webpDocling (OCR)✅ SupportĂ©
Audio (IA)Audio.mp3, .wavWhisper Turbo✅ SupportĂ© (Transcription)
SpĂ©cialisĂ©JATS/USPTO XML.xmlDocling (v2)✅ SupportĂ©
Docling JSON.jsonDocling (v2)✅ SupportĂ©

ïżœđŸ”§ Technologies

Stack ComplĂšte

ComposantTechnologieAnnéeRÎle
IngestionDocling (IBM)2024Conversion PDF/DOCX → Markdown
Web ScrapingTrafilatura2019Extraction contenu web
Nettoyageftfy, clean-text, Spacy2012-2019Normalisation texte
ChunkingSemantic Chunking2023Segmentation intelligente
EmbeddingsFastEmbed + BGE-M32023-2024Vectorisation ONNX
Base VectorielleLanceDB2023Stockage hybride (FTS + Vector)
CacheGPTCache2023AccĂ©lĂ©ration requĂȘtes
Query ExpansionHyDE2022AmĂ©lioration requĂȘtes
RerankingMXBai Rerank v22024Affinage résultats
LLMQwen3-4B (GGUF Q4)2025Génération réponses
ÉvaluationRAGAS2023MĂ©triques qualitĂ©
InterfaceStreamlit2019UI interactive

Dépendances Principales

docling>=2.0.0
trafilatura>=1.12.0
ftfy>=6.2.0
spacy>=3.7.0
fastembed>=0.3.0
lancedb>=0.13.0
gptcache>=0.1.43
llama-cpp-python>=0.2.0
ragas>=0.1.0
streamlit>=1.35.0

đŸ€ Contribution

Les contributions sont les bienvenues ! Pour contribuer :

  1. Forkez le projet
  2. Créez une branche (git checkout -b feature/amelioration)
  3. Committez vos changements (git commit -m 'Ajout fonctionnalité')
  4. Pushez vers la branche (git push origin feature/amelioration)
  5. Ouvrez une Pull Request

📄 License

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.


📞 Contact

Pour toute question ou suggestion, n'hésitez pas à ouvrir une issue.


Fait avec ❀ pour la communautĂ© IA locale

⭐ Si ce projet vous est utile, n'hésitez pas à lui donner une étoile !

user257814938/VEV_RAG

🚀 Agent RAG haute performance fonctionnant 100% en local sur CPU.

Python

0

33 commits

updated Dec 13, 2025

See the code

README

Chat Interface

🚀 Installation Rapide

  1. Installer les dépendances : pip install -r requirements.txt
  2. ** Pour traiter l'audio, installer FFmpeg manuellement. Le plus simple sur Windows est d'utiliser winget dans un terminal (PowerShell ou CMD)** : 'winget install Gyan.FFmpeg'
  3. Télécharger le reranker : python src/retrieval/reranker_installer.py
  4. Installer / Lister / Changer / Supprimer un LLM : python models/llm/llm_model_installer.py
  5. Lancer l'application : streamlit run app.py
  6. Nettoyer les caches : python clear_cache.py
  7. Vérifier les chemins : python monitoring/verify_paths.py

🚀 VEV RAG - Agent RAG Haute Performance 100% Local

VEV Agent

Agent RAG (Retrieval-Augmented Generation) haute performance fonctionnant 100% en local sur CPU.

Python License CPU Only Local First


📋 Table des Matiùres


🎯 À Propos

VEV RAG est un systĂšme de recherche documentaire intelligent qui combine :

  • 🔍 Recherche sĂ©mantique avancĂ©e avec embeddings
  • đŸ€– GĂ©nĂ©ration de rĂ©ponses via LLM local (Qwen3-4B)
  • 📚 Ingestion multi-format (PDF, DOCX, TXT, Web)
  • đŸ’Ÿ Base vectorielle hybride (LanceDB)
  • ⚡ Performance CPU optimisĂ©e (ONNX, GGUF)

Le projet fonctionne entiÚrement en local, sans dépendance cloud, garantissant confidentialité et autonomie.


✹ FonctionnalitĂ©s

đŸ”„ Principales

  • ✅ Ingestion intelligente : Support PDF, Word, TXT et pages web
  • ✅ Chunking sĂ©mantique : DĂ©coupage intelligent par sens (2023)
  • ✅ Embeddings rapides : BGE-M3 via FastEmbed (ONNX)
  • ✅ Recherche hybride : Vectorielle + BM25/FTS
  • ✅ Reranking : MXBai Rerank v2 pour affiner les rĂ©sultats
  • ✅ Cache sĂ©mantique : GPTCache pour accĂ©lĂ©rer les requĂȘtes
  • ✅ LLM local : Qwen3-4B quantifiĂ© (GGUF Q4_K_M)
  • ✅ Interface Streamlit : Chat interactif avec upload de documents
  • ✅ Évaluation RAGAS : MĂ©triques de qualitĂ© automatiques

đŸ›Ąïž SĂ©curitĂ© & Performance

  • 🔒 100% Local : Aucune donnĂ©e ne quitte votre machine
  • ⚡ CPU OptimisĂ© : Fonctionne sans GPU
  • 📊 Évaluation continue : Scores de fidĂ©litĂ© et pertinence
  • đŸ§č Nettoyage avancĂ© : ftfy, clean-text, Spacy

đŸ—ïž Architecture

graph TB
    A[Documents PDF/DOCX/TXT/Web] --> B[Ingestion & Nettoyage]
    B --> C[Chunking Sémantique]
    C --> D[Embeddings BGE-M3]
    D --> E[LanceDB Vectorielle]
    F[Question Utilisateur] --> G[Query Expansion HyDE]
    G --> H[Recherche Hybride]
    E --> H
    H --> I[Reranking MXBai]
    I --> J[LLM Qwen3-4B]
    J --> K[Réponse Générée]
    L[GPTCache] -.-> H

Pipeline Complet

  1. Ingestion : Docling (IBM 2024) convertit les documents en Markdown
  2. Nettoyage : ftfy + clean-text + Spacy normalisent le texte
  3. Chunking : Segmentation sémantique intelligente
  4. Vectorisation : FastEmbed + BGE-M3 (ONNX, CPU-optimisé)
  5. Stockage : LanceDB (hybride vectoriel + BM25)
  6. Recherche : Query expansion (HyDE) + recherche hybride
  7. Reranking : MXBai Rerank v2 affine le top-5
  8. Génération : Qwen3-4B (GGUF Q4) génÚre la réponse
  9. Évaluation : RAGAS mesure la qualitĂ©

📩 Installation

Prérequis

  • Python 3.10 ou supĂ©rieur
  • 8 GB RAM minimum (16 GB recommandĂ©)
  • CPU moderne (pas de GPU requis)

Installation Rapide

# Cloner le dépÎt
git clone https://github.com/user257814938/VEV_RAG.git
cd VEV_RAG

# Créer un environnement virtuel
python -m venv venv
source venv/bin/activate  # Sur Windows: venv\Scripts\activate

# Installer les dépendances
pip install -r requirements.txt

# Télécharger les modÚles
python src/scripts/download_reranker.py

Configuration

Créez un fichier .env à la racine (optionnel) :

# Chemins personnalisés (optionnel)
DATA_DIR=./data
MODELS_DIR=./models

🚀 Utilisation

Interface Streamlit (Recommandé)

streamlit run app.py

Ouvrez votre navigateur Ă  http://localhost:8501

Utilisation Programmatique

from main import VEVRAGAgent

# Initialiser l'agent
agent = VEVRAGAgent()

# Ingérer des documents
agent.ingest_documents(["document.pdf", "article.docx"])

# Poser une question
response = agent.query("Quelle est la définition de l'IA ?")
print(response)

Tests

# Lancer les tests
pytest tests/

# Test d'ingestion
python tests/test_ingestion.py

# Test de recherche
python tests/test_retrieval.py

📁 Structure du Projet

VEV_RAG/
├── 📄 app.py                    # Interface Streamlit
├── 📄 main.py                   # Orchestration principale (VEVRAGAgent)
├── 📄 requirements.txt          # DĂ©pendances Python
├── 📂 src/
│   ├── 📂 core/
│   │   ├── config.py           # Configuration & variables d'environnement
│   │   └── schemas.py          # Structures de donnĂ©es (Pydantic)
│   ├── 📂 ingestion/
│   │   ├── loader_doc.py       # Chargement PDF/DOCX (Docling)
│   │   ├── loader_web.py       # Extraction web (Trafilatura)
│   │   └── cleaner.py          # Nettoyage texte (ftfy, Spacy)
│   ├── 📂 indexing/
│   │   ├── chunker.py          # Chunking sĂ©mantique
│   │   ├── embedder.py         # Embeddings (FastEmbed + BGE-M3)
│   │   └── vector_store.py     # Base vectorielle (LanceDB)
│   ├── 📂 retrieval/
│   │   ├── cache.py            # Cache sĂ©mantique (GPTCache)
│   │   ├── query_expansion.py  # AmĂ©lioration requĂȘtes (HyDE)
│   │   └── reranker.py         # Reranking (MXBai)
│   ├── 📂 generation/
│   │   ├── llm_engine.py       # Moteur LLM (Qwen3-4B GGUF)
│   │   └── system_prompts.py   # Prompts systùme
│   ├── 📂 evaluation/
│   │   └── ragas_eval.py       # Évaluation qualitĂ© (RAGAS)
│   └── 📂 scripts/
│       ├── download_reranker.py # TĂ©lĂ©chargement modĂšles
│       └── verify_paths.py      # VĂ©rification structure
├── 📂 data/
│   ├── raw/                    # Documents bruts
│   ├── processed/              # Documents traitĂ©s
│   └── lancedb/                # Base vectorielle
├── 📂 models/
│   ├── llm/                    # Modùles LLM (GGUF)
│   └── embeddings/             # Modùles embeddings
└── 📂 tests/
    ├── test_ingestion.py       # Tests ingestion
    └── test_retrieval.py       # Tests recherche

ïżœ Analyse ComplĂšte des Formats SupportĂ©s

CatégorieFormatExtensionMoteurStatut
Documents OfficePDF.pdfDocling (v2)✅ SupportĂ© (avec OCR & Tableaux)
Microsoft Word.docxDocling (v2)✅ SupportĂ©
Microsoft Excel.xlsxDocling (v2)✅ SupportĂ© (Conversion Markdown)
Microsoft PowerPoint.pptxDocling (v2)✅ SupportĂ©
Texte & WebTexte Brut.txtPython Natif✅ SupportĂ© (Ultra-rapide)
Markdown.mdPython Natif✅ SupportĂ© (Ultra-rapide)
HTML / XHTML.html, .htmDocling (v2)✅ SupportĂ©
XML / AsciiDoc.xml, .adocDocling (v2)✅ SupportĂ©
WebVTT.vttDocling (v2)✅ SupportĂ© (Sous-titres)
Images (OCR)Images.png, .jpg, .tiff, .bmp, .webpDocling (OCR)✅ SupportĂ©
Audio (IA)Audio.mp3, .wavWhisper Turbo✅ SupportĂ© (Transcription)
SpĂ©cialisĂ©JATS/USPTO XML.xmlDocling (v2)✅ SupportĂ©
Docling JSON.jsonDocling (v2)✅ SupportĂ©

ïżœđŸ”§ Technologies

Stack ComplĂšte

ComposantTechnologieAnnéeRÎle
IngestionDocling (IBM)2024Conversion PDF/DOCX → Markdown
Web ScrapingTrafilatura2019Extraction contenu web
Nettoyageftfy, clean-text, Spacy2012-2019Normalisation texte
ChunkingSemantic Chunking2023Segmentation intelligente
EmbeddingsFastEmbed + BGE-M32023-2024Vectorisation ONNX
Base VectorielleLanceDB2023Stockage hybride (FTS + Vector)
CacheGPTCache2023AccĂ©lĂ©ration requĂȘtes
Query ExpansionHyDE2022AmĂ©lioration requĂȘtes
RerankingMXBai Rerank v22024Affinage résultats
LLMQwen3-4B (GGUF Q4)2025Génération réponses
ÉvaluationRAGAS2023MĂ©triques qualitĂ©
InterfaceStreamlit2019UI interactive

Dépendances Principales

docling>=2.0.0
trafilatura>=1.12.0
ftfy>=6.2.0
spacy>=3.7.0
fastembed>=0.3.0
lancedb>=0.13.0
gptcache>=0.1.43
llama-cpp-python>=0.2.0
ragas>=0.1.0
streamlit>=1.35.0

đŸ€ Contribution

Les contributions sont les bienvenues ! Pour contribuer :

  1. Forkez le projet
  2. Créez une branche (git checkout -b feature/amelioration)
  3. Committez vos changements (git commit -m 'Ajout fonctionnalité')
  4. Pushez vers la branche (git push origin feature/amelioration)
  5. Ouvrez une Pull Request

📄 License

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.


📞 Contact

Pour toute question ou suggestion, n'hésitez pas à ouvrir une issue.


Fait avec ❀ pour la communautĂ© IA locale

⭐ Si ce projet vous est utile, n'hésitez pas à lui donner une étoile !