| # π AI Research Assistant - Documentation ComplΓ¨te | |
|  | |
|  | |
|  | |
|  | |
| ## π― Vue d'ensemble | |
| **AI Research Assistant** est un système intelligent de recherche et d'analyse documentaire utilisant LangGraph, plusieurs agents IA spécialisés, et un système de mémoire vectorielle avancé. Le système automatise l'ensemble du processus de recherche : de la collecte d'informations sur le web jusqu'à la génération de rapports de synthèse structurés. | |
| ### β¨ FonctionnalitΓ©s principales | |
| - π **Recherche web automatisΓ©e** avec extraction de mots-clΓ©s intelligente | |
| - π **Extraction de contenu** depuis des pages web avec parsing avancΓ© | |
| - π **GΓ©nΓ©ration de rΓ©sumΓ©s** dΓ©taillΓ©s et structurΓ©s | |
| - π― **SynthΓ¨se globale** avec analyse thΓ©matique transversale | |
| - πΎ **SystΓ¨me de mΓ©moire** vectorielle et conversationnelle | |
| - π€ **Orchestration par LLM** via LangGraph | |
| - π« **DΓ©duplication automatique** des documents | |
| - β‘ **Cache intelligent** avec TTL configurable | |
| --- | |
| ## ποΈ Architecture du Projet | |
| ### Structure des dossiers | |
| ``` | |
| langGraphe-ai-research-assistant-main/ | |
| β | |
| βββ config/ # Configuration globale | |
| β βββ settings.py # ParamΓ¨tres de l'application | |
| β βββ prompts.py # Templates de prompts | |
| β | |
| βββ src/ # Code source principal | |
| β βββ agents/ # Agents spΓ©cialisΓ©s | |
| β β βββ base_agent.py # Agent de base | |
| β β βββ researcher_agent.py # Recherche web | |
| β β βββ content_extractor_agent.py # Extraction | |
| β β βββ summarizer_agent.py # RΓ©sumΓ©s | |
| β β βββ global_synthesizer_agent.py # SynthΓ¨se | |
| β β | |
| β βββ services/ # Services partagΓ©s | |
| β β βββ search_api.py # APIs de recherche (Tavily, Serper) | |
| β β βββ content_extraction.py # Extraction de contenu web | |
| β β βββ llm_service.py # Service LLM (Groq) | |
| β β βββ text_chunking.py # DΓ©coupage de texte | |
| β β | |
| β βββ models/ # ModΓ¨les de donnΓ©es | |
| β β βββ research_models.py # ModΓ¨les de recherche | |
| β β βββ document_models.py # ModΓ¨les de documents | |
| β β βββ synthesis_models.py # ModΓ¨les de synthΓ¨se | |
| β β βββ report_models.py # ModΓ¨les de rapports | |
| β β βββ state_models.py # Γtats du graphe | |
| β β | |
| β βββ graph/ # LangGraph | |
| β β βββ nodes.py # NΕuds du graphe | |
| β β | |
| β βββ core/ # FonctionnalitΓ©s de base | |
| β β βββ logging.py # Configuration des logs | |
| β β | |
| β βββ memory_system.py # SystΓ¨me de mΓ©moire vectorielle | |
| β βββ memory_integration.py # IntΓ©gration de la mΓ©moire | |
| β βββ enhanced_system_prompt.py # Prompts avancΓ©s | |
| β βββ graph.py # Graphe LangGraph principal | |
| β | |
| βββ tests/ # Tests unitaires et d'intΓ©gration | |
| β βββ test_researcher.py | |
| β βββ test_content_extractor_agent.py | |
| β βββ test_summarizer_agent.py | |
| β βββ api_tests.py | |
| β | |
| βββ logs/ # Fichiers de logs | |
| βββ .env # Variables d'environnement | |
| βββ requirements.txt # DΓ©pendances Python | |
| βββ README.md # Documentation principale | |
| ``` | |
| --- | |
| ## π§ Architecture Technique | |
| ### Diagramme du Pipeline | |
| ``` | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β UTILISATEUR β | |
| ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ | |
| β | |
| βΌ | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β LLM ORCHESTRATEUR β | |
| β (ChatGroq avec LangGraph) β | |
| β β’ Analyse la requΓͺte utilisateur β | |
| β β’ DΓ©cide des outils Γ utiliser β | |
| β β’ GΓ¨re le flow de conversation β | |
| ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ | |
| β | |
| ββββββββββββββββ΄βββββββββββββββ | |
| β β | |
| βΌ βΌ | |
| βββββββββββββββββββββββ βββββββββββββββββββββββ | |
| β RECHERCHE CACHE β β NOUVELLE RECHERCHE β | |
| β β β β | |
| β β’ VΓ©rif. cache 24h β β β’ Pipeline complet β | |
| β β’ Recherche mΓ©moire β β β’ 4 agents sΓ©quence β | |
| β β’ Topics similaires β β β’ Stockage mΓ©moire β | |
| ββββββββββββ¬βββββββββββ ββββββββββββ¬βββββββββββ | |
| β β | |
| β ββββββββββββββββββ | |
| β β | |
| βΌ βΌ | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β SYSTΓME DE MΓMOIRE β | |
| β β | |
| β βββββββββββββββββββββββ ββββββββββββββββββββββββ β | |
| β β MΓMOIRE VECTORIELLEβ β MΓMOIRE AGENT β β | |
| β β (ChromaDB) β β (Cache + Historique) β β | |
| β β β β β β | |
| β β β’ Embeddings β β β’ Conversations β β | |
| β β β’ Recherche top-k β β β’ Cache recherches β β | |
| β β β’ DΓ©duplication βββββββββββ€ β’ Topics + keywords β β | |
| β β β’ Persistance β β β’ Compression auto β β | |
| β βββββββββββββββββββββββ ββββββββββββββββββββββββ β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β | |
| β | |
| βΌ | |
| RAPPORT STRUCTURΓ | |
| (Markdown, HTML, Text, JSON) | |
| ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β PIPELINE DE RECHERCHE β | |
| β β | |
| β βββββββββββββββ βββββββββββββββ ββββββββββββββββ β | |
| β β AGENT 1 β β AGENT 2 β β AGENT 3 β β | |
| β β RESEARCHER ββββΊβ EXTRACTOR ββββΊβ SUMMARIZER β β | |
| β β β β β β β β | |
| β β β’ Tavily β β β’ Parsing β β β’ LLM β β | |
| β β β’ Serper β β β’ Nettoyage β β β’ Chunking β β | |
| β β β’ Keywords β β β’ Validationβ β β’ Points-clΓ©sβ β | |
| β βββββββββββββββ βββββββββββββββ ββββββββ¬ββββββββ β | |
| β β β | |
| β βΌ β | |
| β ββββββββββββββββββββ β | |
| β β AGENT 4 β β | |
| β βGLOBAL SYNTHESIZERβ β | |
| β β β β | |
| β β β’ ThΓ¨mes β β | |
| β β β’ Consensus β β | |
| β β β’ Rapport final β β | |
| β ββββββββββββββββββββ β | |
| ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| --- | |
| ## π€ Description des Agents | |
| ### 1. π ResearcherAgent | |
| **RΓ΄le** : Recherche web et extraction de mots-clΓ©s | |
| **ResponsabilitΓ©s** : | |
| - Extraction automatique de mots-clΓ©s via LLM | |
| - Recherche multi-API (Tavily, Serper) | |
| - Filtrage et validation des rΓ©sultats | |
| - Gestion du rate limiting | |
| **Inputs** : | |
| ```python | |
| ResearchQuery( | |
| topic: str, | |
| keywords: List[str], | |
| max_results: int = 10, | |
| search_depth: str = "basic" | |
| ) | |
| ``` | |
| **Outputs** : | |
| ```python | |
| ResearchOutput( | |
| results: List[SearchResult], | |
| total_found: int, | |
| search_engine: str, | |
| search_time: float | |
| ) | |
| ``` | |
| ### 2. π ContentExtractorAgent | |
| **RΓ΄le** : Extraction et nettoyage du contenu web | |
| **ResponsabilitΓ©s** : | |
| - Parsing HTML avec BeautifulSoup | |
| - Nettoyage et normalisation du texte | |
| - DΓ©tection du type de document | |
| - Validation de la qualitΓ© | |
| **Inputs** : | |
| ```python | |
| ResearchOutput # Provient du ResearcherAgent | |
| ``` | |
| **Outputs** : | |
| ```python | |
| ExtractionResult( | |
| documents: List[Document], | |
| successful_extractions: int, | |
| failed_urls: List[str], | |
| extraction_stats: Dict | |
| ) | |
| ``` | |
| ### 3. π SummarizerAgent | |
| **RΓ΄le** : GΓ©nΓ©ration de rΓ©sumΓ©s dΓ©taillΓ©s | |
| **ResponsabilitΓ©s** : | |
| - DΓ©coupage intelligent du texte (chunking) | |
| - RΓ©sumΓ©s exΓ©cutifs et dΓ©taillΓ©s | |
| - Extraction de points-clΓ©s et arguments | |
| - Analyse de sentiment et crΓ©dibilitΓ© | |
| **Inputs** : | |
| ```python | |
| ExtractionResult # Provient du ContentExtractorAgent | |
| ``` | |
| **Outputs** : | |
| ```python | |
| SummarizationOutput( | |
| summaries: List[DocumentSummary], | |
| total_documents: int, | |
| average_credibility: float, | |
| common_themes: List[str] | |
| ) | |
| ``` | |
| ### 4. π― GlobalSynthesizerAgent | |
| **Rôle** : Synthèse globale et génération de rapport | |
| **ResponsabilitΓ©s** : | |
| - Analyse thΓ©matique transversale | |
| - Identification de consensus et conflits | |
| - GΓ©nΓ©ration de rapport structurΓ© | |
| - Export multi-format (Markdown, HTML, Text) | |
| **Inputs** : | |
| ```python | |
| SummarizationOutput # Provient du SummarizerAgent | |
| ``` | |
| **Outputs** : | |
| ```python | |
| GlobalSynthesisOutput( | |
| final_report: FinalReport, | |
| synthesis_metadata: Dict, | |
| processing_stats: Dict, | |
| formatted_outputs: Dict[str, str] | |
| ) | |
| ``` | |
| --- | |
| ## πΎ SystΓ¨me de MΓ©moire | |
| ### Architecture de la MΓ©moire | |
| Le système utilise **deux types de mémoire complémentaires** : | |
| #### 1. ποΈ MΓ©moire Vectorielle (ChromaDB) | |
| ```python | |
| VectorMemoryManager( | |
| persist_directory="./chroma_db", | |
| collection_name="research_documents", | |
| embedding_model="sentence-transformers/all-MiniLM-L6-v2" | |
| ) | |
| ``` | |
| **FonctionnalitΓ©s** : | |
| - **Embeddings** : Modèles HuggingFace pour représentation vectorielle | |
| - **Recherche sΓ©mantique** : Top-K avec scores de similaritΓ© cosinus | |
| - **DΓ©duplication** : Hash MD5 pour Γ©viter les doublons | |
| - **Persistance** : Stockage permanent sur disque | |
| - **Nettoyage auto** : Suppression des documents > 30 jours | |
| **MΓ©thodes principales** : | |
| ```python | |
| # Ajout de documents | |
| stats = vector_memory.add_documents( | |
| documents=[{ | |
| 'content': "...", | |
| 'title': "...", | |
| 'url': "..." | |
| }], | |
| source='research', | |
| check_duplicates=True | |
| ) | |
| # Recherche sΓ©mantique | |
| results = vector_memory.semantic_search( | |
| query="intelligence artificielle", | |
| k=5, | |
| filter_dict={'source': 'research'} | |
| ) | |
| # Nettoyage | |
| deleted = vector_memory.clear_old_documents(days=30) | |
| ``` | |
| #### 2. π§ MΓ©moire d'Agent (Cache + Historique) | |
| ```python | |
| AgentMemoryManager( | |
| memory_file="./agent_memory.pkl", | |
| max_history=100, | |
| compression_threshold=50 | |
| ) | |
| ``` | |
| **FonctionnalitΓ©s** : | |
| - **Historique conversationnel** : Deque avec limite (100 entrΓ©es) | |
| - **Cache des recherches** : TTL 24h par dΓ©faut | |
| - **Keywords tracking** : Association topic β keywords | |
| - **Compression auto** : Après 50 entrées | |
| - **Persistance pickle** : Sauvegarde sur disque | |
| **MΓ©thodes principales** : | |
| ```python | |
| # Ajouter une conversation | |
| agent_memory.add_conversation( | |
| user_message="RΓ©sume l'IA", | |
| assistant_response="...", | |
| metadata={'sources': 5} | |
| ) | |
| # RΓ©cupΓ©rer du cache | |
| result = agent_memory.get_research_result( | |
| topic="intelligence artificielle", | |
| max_age_hours=24 | |
| ) | |
| # Topics similaires | |
| related = agent_memory.get_related_topics( | |
| topic="IA dans la santΓ©", | |
| threshold=0.5 | |
| ) | |
| ``` | |
| ### π SystΓ¨me IntΓ©grΓ© | |
| ```python | |
| IntegratedMemorySystem() | |
| ``` | |
| Combine les deux mΓ©moires pour : | |
| - Stockage automatique de tous les rΓ©sultats de recherche | |
| - RΓ©cupΓ©ration intelligente du contexte | |
| - VΓ©rification du cache avant nouvelle recherche | |
| - Enrichissement des rΓ©ponses avec contexte historique | |
| --- | |
| ## π οΈ Installation | |
| ### PrΓ©requis | |
| - **Python** : 3.12+ | |
| - **Pip** : version rΓ©cente | |
| - **Git** : pour cloner le projet | |
| ### Γtapes d'installation | |
| ```bash | |
| # 1. Cloner le projet | |
| git clone https://github.com/votre-repo/ai-research-assistant.git | |
| cd ai-research-assistant | |
| # 2. CrΓ©er un environnement virtuel | |
| python -m venv venv | |
| # Activer l'environnement | |
| # Windows | |
| venv\Scripts\activate | |
| # Linux/Mac | |
| source venv/bin/activate | |
| # 3. Installer les dΓ©pendances | |
| pip install -r requirements.txt | |
| # 4. Configurer les variables d'environnement | |
| cp .env.example .env | |
| # Γditer .env avec vos clΓ©s API | |
| ``` | |
| ### Configuration `.env` | |
| ```env | |
| # LLM | |
| GROQ_API_KEY=your_groq_api_key_here | |
| # Search APIs | |
| TAVILY_API_KEY=your_tavily_api_key_here | |
| SERPER_API_KEY=your_serper_api_key_here | |
| # Optional | |
| LOG_LEVEL=INFO | |
| MAX_RETRIES=3 | |
| TIMEOUT=30 | |
| ``` | |
| --- | |
| ############################################################################ | |
| ## π Utilisation | |
| ### Mode CLI Direct | |
| ```bash | |
| # Recherche simple | |
| python src/graph.py "impact de l'IA sur l'emploi" | |
| # Mode test | |
| python src/graph.py test | |
| # Statistiques mΓ©moire | |
| python src/graph.py stats | |
| ``` | |
| ### Mode Interactif | |
| ```python | |
| from src.graph import app_with_memory, run_test | |
| # Lancer une recherche | |
| run_test("RΓ©sume les Γ©nergies renouvelables", "Ma recherche") | |
| # Ou utiliser directement le graphe | |
| inputs = {"messages": [("user", "RΓ©sume l'IA dans la santΓ©")]} | |
| for state in app_with_memory.stream(inputs, stream_mode="values"): | |
| print(state["messages"][-1]) | |
| ``` | |
| ### Mode Menu Interactif | |
| ```bash | |
| python tests/test_memory_system.py | |
| ``` | |
| Menu disponible : | |
| ``` | |
| 1. Poser une question / Lancer une recherche | |
| 2. Rechercher dans la mΓ©moire | |
| 3. Voir l'historique | |
| 4. Statistiques de la mΓ©moire | |
| 5. Lancer la suite de tests | |
| 6. RΓ©initialiser la mΓ©moire | |
| 0. Quitter | |
| ``` | |
| ### IntΓ©gration dans votre code | |
| ```python | |
| from src.agents.researcher_agent import ResearcherAgent | |
| from src.agents.content_extractor_agent import ContentExtractorAgent | |
| from src.agents.summarizer_agent import SummarizerAgent | |
| from src.agents.global_synthesizer_agent import GlobalSynthesizerAgent | |
| from src.models.research_models import ResearchQuery | |
| # Initialiser les agents | |
| researcher = ResearcherAgent() | |
| extractor = ContentExtractorAgent() | |
| summarizer = SummarizerAgent() | |
| synthesizer = GlobalSynthesizerAgent() | |
| # Pipeline complet | |
| async def recherche_complete(topic: str): | |
| # 1. Recherche | |
| query = ResearchQuery( | |
| topic=topic, | |
| keywords=await researcher.extract_keywords_with_llm(topic), | |
| max_results=5 | |
| ) | |
| research_data = await researcher.process(query) | |
| # 2. Extraction | |
| extraction_data = await extractor.process_from_research_output( | |
| research_output=research_data | |
| ) | |
| # 3. RΓ©sumΓ©s | |
| summarization_data = await summarizer.process_from_extraction_result( | |
| extraction_result=extraction_data | |
| ) | |
| # 4. Synthèse | |
| synthesis = await synthesizer.process_from_summarization_output( | |
| summarization_output=summarization_data | |
| ) | |
| return synthesis.final_report.formatted_outputs['markdown'] | |
| ``` | |
| --- | |
| ## π Exemples d'Utilisation | |
| ### Exemple 1 : Recherche Simple avec Cache | |
| ```python | |
| # Première recherche (pipeline complet) | |
| inputs = { | |
| "messages": [ | |
| ("user", "RΓ©sume l'impact de l'IA sur le marchΓ© du travail") | |
| ] | |
| } | |
| for state in app_with_memory.stream(inputs): | |
| print(state["messages"][-1].content) | |
| # RΓ©sultat : Pipeline complet exΓ©cutΓ©, rΓ©sultats mis en cache | |
| # MΓͺme recherche 10 minutes aprΓ¨s (utilise le cache) | |
| inputs = { | |
| "messages": [ | |
| ("user", "Rappelle-moi ce que tu as trouvΓ© sur l'IA et l'emploi") | |
| ] | |
| } | |
| for state in app_with_memory.stream(inputs): | |
| print(state["messages"][-1].content) | |
| # RΓ©sultat : RΓ©ponse instantanΓ©e depuis le cache | |
| ``` | |
| ### Exemple 2 : Recherche dans la MΓ©moire | |
| ```python | |
| # Après plusieurs recherches sur l'IA | |
| inputs = { | |
| "messages": [ | |
| ("user", "Qu'as-tu trouvΓ© sur l'intelligence artificielle ?") | |
| ] | |
| } | |
| # Le LLM utilise automatiquement search_in_memory | |
| # au lieu de lancer une nouvelle recherche web | |
| ``` | |
| ### Exemple 3 : Historique et Statistiques | |
| ```python | |
| from src.memory_system import memory_system | |
| # Voir l'historique | |
| history = list(memory_system.agent_memory.conversation_history) | |
| for conv in history[-5:]: | |
| print(f"{conv['timestamp']}: {conv['user']}") | |
| # Statistiques | |
| print(f"Documents en mΓ©moire: {memory_system.vector_memory.collection.count()}") | |
| print(f"Recherches en cache: {len(memory_system.agent_memory.research_cache)}") | |
| ``` | |
| ### Exemple 4 : Recherche Approfondie | |
| ```python | |
| from src.memory_integration import research_complete_pipeline_with_memory | |
| # Recherche avec plus de sources | |
| result = research_complete_pipeline_with_memory( | |
| topic="Γ©nergies renouvelables et transition Γ©cologique", | |
| max_results=10, # Plus de sources | |
| use_cache=False # Forcer une nouvelle recherche | |
| ) | |
| print(result) # Rapport Markdown complet | |
| ``` | |
| --- | |
| ## π Logs et Monitoring | |
| ### Structure des logs | |
| ``` | |
| logs/ | |
| βββ agent_researcher.log # Recherche web | |
| βββ agent_content_extractor.log # Extraction | |
| βββ agent_summarizer.log # RΓ©sumΓ©s | |
| βββ agent_global_synthesizer.log # SynthΓ¨se | |
| βββ search_manager.log # APIs de recherche | |
| βββ llm_service.log # Appels LLM | |
| βββ complete_pipeline.log # Pipeline complet | |
| ``` | |
| ### Niveaux de log | |
| ```python | |
| # Dans config/settings.py | |
| LOG_LEVEL = "INFO" # DEBUG, INFO, WARNING, ERROR, CRITICAL | |
| ``` | |
| ### Exemple de logs | |
| ``` | |
| 2025-11-18 10:30:15 | INFO | agent_researcher | Recherche pour: "IA emploi" | |
| 2025-11-18 10:30:18 | INFO | agent_researcher | TrouvΓ© 5 sources | |
| 2025-11-18 10:30:20 | INFO | agent_content_extractor | Extraction: 5/5 succès | |
| 2025-11-18 10:30:45 | INFO | agent_summarizer | 5 rΓ©sumΓ©s gΓ©nΓ©rΓ©s | |
| 2025-11-18 10:31:10 | INFO | agent_global_synthesizer | Rapport: 1250 mots | |
| 2025-11-18 10:31:12 | INFO | memory_system | Stockage en mΓ©moire rΓ©ussi | |
| ``` | |
| --- | |
| ## βοΈ Configuration AvancΓ©e | |
| ### Personnaliser les prompts | |
| ```python | |
| # config/prompts.py | |
| CUSTOM_RESEARCH_PROMPT = """ | |
| Analyse approfondie sur {topic}. | |
| Focus sur les aspects suivants : | |
| - Impact Γ©conomique | |
| - Implications sociales | |
| - Perspectives futures | |
| """ | |
| # Utilisation | |
| from config.prompts import CUSTOM_RESEARCH_PROMPT | |
| prompt = CUSTOM_RESEARCH_PROMPT.format(topic="IA gΓ©nΓ©rative") | |
| ``` | |
| ### Ajuster les paramètres LLM | |
| ```python | |
| # src/services/llm_service.py | |
| class LLMService: | |
| def __init__(self): | |
| self.model = ChatGroq( | |
| model="llama-3.1-8b-instant", | |
| temperature=0.3, # CrΓ©ativitΓ© (0-1) | |
| max_tokens=2048, # Longueur max | |
| top_p=0.9, # Nucleus sampling | |
| frequency_penalty=0.5 # PΓ©nalitΓ© rΓ©pΓ©tition | |
| ) | |
| ``` | |
| ### Configurer la mΓ©moire vectorielle | |
| ```python | |
| # src/memory_system.py | |
| vector_memory = VectorMemoryManager( | |
| persist_directory="./custom_chroma_db", | |
| collection_name="my_research_docs", | |
| embedding_model="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2" # Multilingue | |
| ) | |
| ``` | |
| --- | |
| ## π IntΓ©gration API(Futur) | |
| ### REST API (FastAPI) | |
| ```python | |
| # api/main.py | |
| from fastapi import FastAPI | |
| from src.graph import app_with_memory | |
| app = FastAPI() | |
| @app.post("/research") | |
| async def research_endpoint(topic: str, max_results: int = 3): | |
| inputs = {"messages": [("user", f"RΓ©sume: {topic}")]} | |
| result = [] | |
| for state in app_with_memory.stream(inputs): | |
| result.append(state["messages"][-1].content) | |
| return {"result": result[-1]} | |
| ``` | |
| ### WebSocket (temps rΓ©el) | |
| ```python | |
| from fastapi import WebSocket | |
| @app.websocket("/ws/research") | |
| async def websocket_research(websocket: WebSocket): | |
| await websocket.accept() | |
| while True: | |
| data = await websocket.receive_text() | |
| inputs = {"messages": [("user", data)]} | |
| for state in app_with_memory.stream(inputs): | |
| await websocket.send_text( | |
| state["messages"][-1].content | |
| ) | |
| ``` | |
| --- | |
| ## π DΓ©pannage | |
| ### Problèmes courants | |
| #### 1. Erreur de clΓ© API manquante | |
| ``` | |
| ValueError: GROQ_API_KEY non dΓ©finie | |
| ``` | |
| **Solution** : VΓ©rifier le fichier `.env` et s'assurer que les clΓ©s sont prΓ©sentes. | |
| #### 3. Rate limit atteint | |
| ``` | |
| WARNING | llm_service | Rate limit atteint, attente 12s | |
| ``` | |
| **Solution** : C'est normal, le système attend automatiquement. Pour éviter : | |
| - RΓ©duire `max_results` | |
| #### 4. MΓ©moire saturΓ©e | |
| ``` | |
| MemoryError: Cannot allocate memory | |
| ``` | |
| **Solution** : Nettoyer la mΓ©moire : | |
| ``` | |
| memory_system.vector_memory.clear_old_documents(days=7) | |
| ``` | |
| --- | |
| ```bash | |
| # Build | |
| docker build -t ai-research-assistant . | |
| # Run | |
| docker run -e GROQ_API_KEY=xxx -e TAVILY_API_KEY=yyy ai-research-assistant | |
| ``` | |
| ### Production (Gunicorn) | |
| ```bash | |
| gunicorn api.main:app --workers 4 --bind 0.0.0.0:8000 | |
| ``` | |
| --- | |
| ## π Roadmap | |
| ### Version 1.1 (En cours) | |
| - [ ] Interface web avec Streamlit | |
| - [ ] Support multilingue complet | |
| - [ ] Export PDF des rapports | |
| - [ ] Notifications par email | |
| ### Version 2.0 (Futur) | |
| - [ ] Agents spΓ©cialisΓ©s par domaine (santΓ©, finance, tech) | |
| - [ ] IntΓ©gration avec bases de donnΓ©es externes | |
| - [ ] Système de fact-checking automatique | |
| - [ ] API GraphQL | |
| --- | |
| ## π€ Contribution | |
| Les contributions sont les bienvenues ! | |
| --- | |
| ## π₯ Auteurs | |
| - **Bachir** - *DΓ©veloppeur Principal* - [GitHub](https://github.com/bachir00) | |
| --- | |
| ## π Remerciements | |
| - LangChain & LangGraph pour le framework | |
| - Groq pour l'accès aux LLMs | |
| - ChromaDB pour le stockage vectoriel | |
| - Tavily & Serper pour les APIs de recherche | |
| - La communautΓ© open-source | |
| --- | |
| ## π Support | |
| - π§ Email : bassiroukane@esp.sn |