Spaces:
Configuration error
Configuration error
| # ๐ Multi-Agent Claim Verification System | |
| An intelligent, multi-agent system designed to verify claims using diverse AI models and real-time web research. This system combines the power of multiple language models with web search capabilities to provide comprehensive fact-checking and evidence analysis. | |
| ## ๐ฏ Purpose | |
| In an era of information overload and misinformation, this system serves as a robust fact-checking tool that: | |
| - **Verifies claims** using multiple AI perspectives | |
| - **Gathers real-time evidence** from web sources | |
| - **Provides balanced analysis** with supporting and contradicting evidence | |
| - **Makes informed decisions** based on comprehensive data analysis | |
| - **Presents results** in an intuitive, interactive web interface | |
| ## ๐๏ธ System Architecture | |
| The system employs a **hierarchical multi-agent architecture** with specialized roles: | |
| ### Agent Hierarchy | |
| ``` | |
| โโโโโโโโโโโโโโโโโโโโโโโ | |
| โ Boss Agent โ โ Final Decision Maker | |
| โ (OpenAI) โ | |
| โโโโโโโโโโโโฌโโโโโโโโโโโ | |
| โ | |
| โโโโโโโโดโโโโโโโ | |
| โ โ | |
| โโโโโผโโโโโ โโโโโผโโโโโโ | |
| โMultiLLMโ โWeb โ | |
| โVerifierโ โEvidence โ | |
| โAgent โ โRetrieverโ | |
| โโโโโโโโโโ โโโโโโโโโโโ | |
| ``` | |
| ### ๐ค Agent Specifications | |
| #### 1. **Boss Agent** (Coordinator) | |
| - **Model**: GPT-4o (OpenAI) | |
| - **Role**: Final decision maker and coordinator | |
| - **Responsibilities**: | |
| - Orchestrates other agents | |
| - Synthesizes evidence from multiple sources | |
| - Makes final verification decisions | |
| - Formats results in HTML for presentation | |
| #### 2. **MultiLLM Verifier Agent** | |
| - **Model**: Claude-3.5-Sonnet (Anthropic) | |
| - **Role**: Cross-model evidence analysis | |
| - **Responsibilities**: | |
| - Coordinates multiple LLM perspectives | |
| - Runs parallel analysis across different AI models | |
| - Provides diverse viewpoints on claims | |
| #### 3. **Web Evidence Retriever Agent** | |
| - **Model**: Claude-3.5-Sonnet (Anthropic) | |
| - **Role**: Real-time information gathering | |
| - **Responsibilities**: | |
| - Searches current web sources | |
| - Retrieves up-to-date information | |
| - Provides context-aware evidence | |
| ## ๐ง Multi-LLM Analysis Engine | |
| The system leverages **three distinct AI models** for comprehensive analysis: | |
| | Model | Provider | Strengths | | |
| |-------|----------|-----------| | |
| | **GPT-4o-mini** | Kognie API | Fast reasoning, general knowledge | | |
| | **Gemini-2.0-Flash** | Kognie API | Multimodal capabilities, recent training | | |
| | **Open-Mistral-Nemo** | Kognie API | European perspective, specialized domains | | |
| ### Parallel Processing Benefits | |
| - **Diverse Perspectives**: Each model brings unique training and biases | |
| - **Cross-Validation**: Multiple viewpoints reduce single-model limitations | |
| - **Speed**: Asynchronous processing ensures rapid results | |
| - **Robustness**: System continues functioning even if one model fails | |
| ## ๐ Web Research Integration | |
| ### Real-Time Evidence Gathering | |
| - **Bing Search API** integration for current information | |
| - **News source prioritization** for recent developments | |
| - **Automated query generation** based on claim analysis | |
| - **Evidence categorization** (supporting vs. contradicting) | |
| ### Search Strategy | |
| 1. **Query Optimization**: Transforms claims into effective search terms | |
| 2. **Source Diversification**: Gathers information from multiple web sources | |
| 3. **Recency Prioritization**: Focuses on current and relevant information | |
| 4. **Result Synthesis**: Analyzes and structures findings | |
| ## ๐ป User Interface | |
| ### Interactive Web Interface (Gradio) | |
| - **Chat-based interaction** for natural claim submission | |
| - **Real-time processing** with progress indicators | |
| - **Collapsible analysis sections** for detailed evidence review | |
| - **Color-coded results** (Green for TRUE, Red for FALSE) | |
| - **Responsive design** for various devices | |
| ### Key Features | |
| - **Instant verification** results | |
| - **Detailed evidence breakdown** from each agent | |
| - **Interactive expandable sections** for in-depth analysis | |
| - **Clean, professional presentation** of complex data | |
| ## ๐ Process Flow | |
| ```mermaid | |
| graph TD | |
| A[User Submits Claim] --> B[Boss Agent Coordinates] | |
| B --> C[MultiLLM Verifier] | |
| B --> D[Web Evidence Retriever] | |
| C --> E[GPT-4o-mini Analysis] | |
| C --> F[Gemini-2.0-Flash Analysis] | |
| C --> G[Mistral-Nemo Analysis] | |
| D --> H[Bing Search Execution] | |
| H --> I[Evidence Collection] | |
| E --> J[Results Synthesis] | |
| F --> J | |
| G --> J | |
| I --> J | |
| J --> K[Boss Agent Decision] | |
| K --> L[HTML Formatted Result] | |
| L --> M[User Interface Display] | |
| ``` | |
| ## ๐ Getting Started | |
| ### Prerequisites | |
| ```bash | |
| pip install kognieLlama gradio llama-index python-dotenv asyncio | |
| ``` | |
| ### Environment Variables | |
| Create a `.env` file with the following: | |
| ```env | |
| KOGNIE_BASE_URL=your_kognie_base_url | |
| KOGNIE_API_KEY=your_kognie_api_key | |
| BING_SUBSCRIPTION_KEY=your_bing_api_key | |
| BING_SEARCH_URL=your_bing_search_url | |
| ANTHROPIC_API_KEY=your_anthropic_api_key | |
| OPENAI_API_KEY=your_openai_api_key | |
| MISTRAL_API_KEY=your_mistral_api_key | |
| ``` | |
| ### Running the Application | |
| ```bash | |
| python app.py | |
| ``` | |
| The system will launch a web interface accessible through your browser. | |
| ## ๐ฏ Use Cases | |
| ### Perfect For: | |
| - **Fact-checking news claims** | |
| - **Academic research verification** | |
| - **Social media post validation** | |
| - **Business claim analysis** | |
| - **Educational fact verification** | |
| - **Journalism and reporting** | |
| ### Example Claims: | |
| - "Company X reported record profits in Q4 2024" | |
| - "New scientific study proves Y causes Z" | |
| - "Political candidate made statement about policy" | |
| - "Sports team won championship in specific year" | |
| ## ๐ฎ Technical Advantages | |
| ### 1. **Asynchronous Processing** | |
| - Non-blocking operations for faster results | |
| - Concurrent agent execution | |
| - Responsive user interface | |
| ### 2. **Error Resilience** | |
| - Graceful handling of API failures | |
| - Fallback mechanisms for each component | |
| - Comprehensive error logging | |
| ### 3. **Scalable Architecture** | |
| - Easy addition of new AI models | |
| - Modular agent design | |
| - Configurable processing parameters | |
| ### 4. **Evidence Transparency** | |
| - Complete audit trail of analysis | |
| - Source attribution for all evidence | |
| - Detailed reasoning for decisions | |
| ## ๐ก๏ธ Quality Assurance | |
| ### Multi-Layer Verification | |
| 1. **Cross-Model Validation**: Multiple AI perspectives | |
| 2. **Real-Time Research**: Current information priority | |
| 3. **Evidence Weighting**: Web sources prioritized for recent events | |
| 4. **Transparent Reasoning**: Complete decision audit trail | |
| ### Bias Mitigation | |
| - **Model Diversity**: Different training approaches and datasets | |
| - **Source Variety**: Multiple web sources and perspectives | |
| - **Temporal Awareness**: Prioritizes recent information | |
| - **Evidence Balance**: Seeks both supporting and contradicting evidence | |
| ## ๐ง Customization Options | |
| The system is designed for easy customization: | |
| - **Add new AI models** to the MultiLLM verifier | |
| - **Integrate additional search engines** beyond Bing | |
| - **Modify decision-making logic** in the Boss Agent | |
| - **Customize UI themes** and presentation styles | |
| - **Adjust evidence weighting** algorithms | |
| ## ๐ค Contributing | |
| This system represents a foundation for intelligent claim verification. Areas for enhancement include: | |
| - Additional AI model integrations | |
| - Advanced evidence scoring algorithms | |
| - Specialized domain knowledge bases | |
| - Multi-language support | |
| - API endpoint creation | |
| --- | |
| **Built with cutting-edge AI technology for reliable, transparent, and comprehensive claim verification.** |