Subhadip866 commited on
Commit
b4b397f
ยท
verified ยท
1 Parent(s): 2169a72

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +229 -12
README.md CHANGED
@@ -1,14 +1,231 @@
1
- ---
2
- title: TestSpace
3
- emoji: ๐Ÿ’ป
4
- colorFrom: yellow
5
- colorTo: yellow
6
- sdk: gradio
7
- sdk_version: 5.33.1
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- short_description: test
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ # ๐Ÿ” Multi-Agent Claim Verification System
2
+
3
+ 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.
4
+
5
+ ## ๐ŸŽฏ Purpose
6
+
7
+ In an era of information overload and misinformation, this system serves as a robust fact-checking tool that:
8
+
9
+ - **Verifies claims** using multiple AI perspectives
10
+ - **Gathers real-time evidence** from web sources
11
+ - **Provides balanced analysis** with supporting and contradicting evidence
12
+ - **Makes informed decisions** based on comprehensive data analysis
13
+ - **Presents results** in an intuitive, interactive web interface
14
+
15
+ ## ๐Ÿ—๏ธ System Architecture
16
+
17
+ The system employs a **hierarchical multi-agent architecture** with specialized roles:
18
+
19
+ ### Agent Hierarchy
20
+
21
+ ```
22
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
23
+ โ”‚ Boss Agent โ”‚ โ† Final Decision Maker
24
+ โ”‚ (OpenAI) โ”‚
25
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
26
+ โ”‚
27
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”
28
+ โ”‚ โ”‚
29
+ โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”
30
+ โ”‚MultiLLMโ”‚ โ”‚Web โ”‚
31
+ โ”‚Verifierโ”‚ โ”‚Evidence โ”‚
32
+ โ”‚Agent โ”‚ โ”‚Retrieverโ”‚
33
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
34
+ ```
35
+
36
+ ### ๐Ÿค– Agent Specifications
37
+
38
+ #### 1. **Boss Agent** (Coordinator)
39
+ - **Model**: GPT-4o (OpenAI)
40
+ - **Role**: Final decision maker and coordinator
41
+ - **Responsibilities**:
42
+ - Orchestrates other agents
43
+ - Synthesizes evidence from multiple sources
44
+ - Makes final verification decisions
45
+ - Formats results in HTML for presentation
46
+
47
+ #### 2. **MultiLLM Verifier Agent**
48
+ - **Model**: Claude-3.5-Sonnet (Anthropic)
49
+ - **Role**: Cross-model evidence analysis
50
+ - **Responsibilities**:
51
+ - Coordinates multiple LLM perspectives
52
+ - Runs parallel analysis across different AI models
53
+ - Provides diverse viewpoints on claims
54
+
55
+ #### 3. **Web Evidence Retriever Agent**
56
+ - **Model**: Claude-3.5-Sonnet (Anthropic)
57
+ - **Role**: Real-time information gathering
58
+ - **Responsibilities**:
59
+ - Searches current web sources
60
+ - Retrieves up-to-date information
61
+ - Provides context-aware evidence
62
+
63
+ ## ๐Ÿ”ง Multi-LLM Analysis Engine
64
+
65
+ The system leverages **three distinct AI models** for comprehensive analysis:
66
+
67
+ | Model | Provider | Strengths |
68
+ |-------|----------|-----------|
69
+ | **GPT-4o-mini** | Kognie API | Fast reasoning, general knowledge |
70
+ | **Gemini-2.0-Flash** | Kognie API | Multimodal capabilities, recent training |
71
+ | **Open-Mistral-Nemo** | Kognie API | European perspective, specialized domains |
72
+
73
+ ### Parallel Processing Benefits
74
+ - **Diverse Perspectives**: Each model brings unique training and biases
75
+ - **Cross-Validation**: Multiple viewpoints reduce single-model limitations
76
+ - **Speed**: Asynchronous processing ensures rapid results
77
+ - **Robustness**: System continues functioning even if one model fails
78
+
79
+ ## ๐ŸŒ Web Research Integration
80
+
81
+ ### Real-Time Evidence Gathering
82
+ - **Bing Search API** integration for current information
83
+ - **News source prioritization** for recent developments
84
+ - **Automated query generation** based on claim analysis
85
+ - **Evidence categorization** (supporting vs. contradicting)
86
+
87
+ ### Search Strategy
88
+ 1. **Query Optimization**: Transforms claims into effective search terms
89
+ 2. **Source Diversification**: Gathers information from multiple web sources
90
+ 3. **Recency Prioritization**: Focuses on current and relevant information
91
+ 4. **Result Synthesis**: Analyzes and structures findings
92
+
93
+ ## ๐Ÿ’ป User Interface
94
+
95
+ ### Interactive Web Interface (Gradio)
96
+ - **Chat-based interaction** for natural claim submission
97
+ - **Real-time processing** with progress indicators
98
+ - **Collapsible analysis sections** for detailed evidence review
99
+ - **Color-coded results** (Green for TRUE, Red for FALSE)
100
+ - **Responsive design** for various devices
101
+
102
+ ### Key Features
103
+ - **Instant verification** results
104
+ - **Detailed evidence breakdown** from each agent
105
+ - **Interactive expandable sections** for in-depth analysis
106
+ - **Clean, professional presentation** of complex data
107
+
108
+ ## ๐Ÿ”„ Process Flow
109
+
110
+ ```mermaid
111
+ graph TD
112
+ A[User Submits Claim] --> B[Boss Agent Coordinates]
113
+ B --> C[MultiLLM Verifier]
114
+ B --> D[Web Evidence Retriever]
115
+
116
+ C --> E[GPT-4o-mini Analysis]
117
+ C --> F[Gemini-2.0-Flash Analysis]
118
+ C --> G[Mistral-Nemo Analysis]
119
+
120
+ D --> H[Bing Search Execution]
121
+ H --> I[Evidence Collection]
122
+
123
+ E --> J[Results Synthesis]
124
+ F --> J
125
+ G --> J
126
+ I --> J
127
+
128
+ J --> K[Boss Agent Decision]
129
+ K --> L[HTML Formatted Result]
130
+ L --> M[User Interface Display]
131
+ ```
132
+
133
+ ## ๐Ÿš€ Getting Started
134
+
135
+ ### Prerequisites
136
+ ```bash
137
+ pip install kognieLlama gradio llama-index python-dotenv asyncio
138
+ ```
139
+
140
+ ### Environment Variables
141
+ Create a `.env` file with the following:
142
+ ```env
143
+ KOGNIE_BASE_URL=your_kognie_base_url
144
+ KOGNIE_API_KEY=your_kognie_api_key
145
+ BING_SUBSCRIPTION_KEY=your_bing_api_key
146
+ BING_SEARCH_URL=your_bing_search_url
147
+ ANTHROPIC_API_KEY=your_anthropic_api_key
148
+ OPENAI_API_KEY=your_openai_api_key
149
+ MISTRAL_API_KEY=your_mistral_api_key
150
+ ```
151
+
152
+ ### Running the Application
153
+ ```bash
154
+ python app.py
155
+ ```
156
+
157
+ The system will launch a web interface accessible through your browser.
158
+
159
+ ## ๐ŸŽฏ Use Cases
160
+
161
+ ### Perfect For:
162
+ - **Fact-checking news claims**
163
+ - **Academic research verification**
164
+ - **Social media post validation**
165
+ - **Business claim analysis**
166
+ - **Educational fact verification**
167
+ - **Journalism and reporting**
168
+
169
+ ### Example Claims:
170
+ - "Company X reported record profits in Q4 2024"
171
+ - "New scientific study proves Y causes Z"
172
+ - "Political candidate made statement about policy"
173
+ - "Sports team won championship in specific year"
174
+
175
+ ## ๐Ÿ”ฎ Technical Advantages
176
+
177
+ ### 1. **Asynchronous Processing**
178
+ - Non-blocking operations for faster results
179
+ - Concurrent agent execution
180
+ - Responsive user interface
181
+
182
+ ### 2. **Error Resilience**
183
+ - Graceful handling of API failures
184
+ - Fallback mechanisms for each component
185
+ - Comprehensive error logging
186
+
187
+ ### 3. **Scalable Architecture**
188
+ - Easy addition of new AI models
189
+ - Modular agent design
190
+ - Configurable processing parameters
191
+
192
+ ### 4. **Evidence Transparency**
193
+ - Complete audit trail of analysis
194
+ - Source attribution for all evidence
195
+ - Detailed reasoning for decisions
196
+
197
+ ## ๐Ÿ›ก๏ธ Quality Assurance
198
+
199
+ ### Multi-Layer Verification
200
+ 1. **Cross-Model Validation**: Multiple AI perspectives
201
+ 2. **Real-Time Research**: Current information priority
202
+ 3. **Evidence Weighting**: Web sources prioritized for recent events
203
+ 4. **Transparent Reasoning**: Complete decision audit trail
204
+
205
+ ### Bias Mitigation
206
+ - **Model Diversity**: Different training approaches and datasets
207
+ - **Source Variety**: Multiple web sources and perspectives
208
+ - **Temporal Awareness**: Prioritizes recent information
209
+ - **Evidence Balance**: Seeks both supporting and contradicting evidence
210
+
211
+ ## ๐Ÿ”ง Customization Options
212
+
213
+ The system is designed for easy customization:
214
+ - **Add new AI models** to the MultiLLM verifier
215
+ - **Integrate additional search engines** beyond Bing
216
+ - **Modify decision-making logic** in the Boss Agent
217
+ - **Customize UI themes** and presentation styles
218
+ - **Adjust evidence weighting** algorithms
219
+
220
+ ## ๐Ÿค Contributing
221
+
222
+ This system represents a foundation for intelligent claim verification. Areas for enhancement include:
223
+ - Additional AI model integrations
224
+ - Advanced evidence scoring algorithms
225
+ - Specialized domain knowledge bases
226
+ - Multi-language support
227
+ - API endpoint creation
228
+
229
  ---
230
 
231
+ **Built with cutting-edge AI technology for reliable, transparent, and comprehensive claim verification.**