CoolFace
Apppublic

Agents-MCP-Hackathon/MCP_ClaimVerificationSystem

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
App README

๐Ÿ” Multi-Agent Claim Verification System using Kognie API

An intelligent, multi-agent MCP server 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.

Visit : https://kognie.com/api to create a Kognie API key to gain access to multiple LLMs with one single account.

๐Ÿ“ฝ๏ธ Demo video

We have used Github Copilot as the MCP client for our MCP server.

URL : https://drive.google.com/file/d/1-vczaQAsA9-wxwzlg91fCrQT18JYkmN6/view?usp=sharing

MCP client model : Claude 3.7 Sonnet

๐ŸŽฏ 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 Specifications

1. 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
  • โ€”Internal process: The system leverages three distinct AI models for comprehensive analysis:
ModelProviderStrengths
GPT-4o-miniKognie APIFast reasoning, general knowledge
Gemini-2.0-FlashKognie APIMultimodal capabilities, recent training
Open-Mistral-NemoKognie APIEuropean 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
2. 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
  • โ€”Internal process: ##### 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. 1.Query Optimization: Transforms claims into effective search terms
  2. 2.Source Diversification: Gathers information from multiple web sources
  3. 3.Recency Prioritization: Focuses on current and relevant information
  4. 4.Result Synthesis: Analyzes and structures findings
3. 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

๐Ÿ’ป 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

๐Ÿš€ Getting Started

Prerequisites

bash
pip install 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
gradio 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. 1.Cross-Model Validation: Multiple AI perspectives
  2. 2.Real-Time Research: Current information priority
  3. 3.Evidence Weighting: Web sources prioritized for recent events
  4. 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