CoolFace
Apppublic

Agents-MCP-Hackathon/Misty_Climate_Agent

sourceHugging Faceupdated 1y agoView on Hugging Face
3likes
App README

MistyClimate Agent ๐Ÿ“ˆ

This is an advanced multi-agent system created using Mistral models, designed to process climate-related documents, analyze images, perform JSON data analysis, and convert text to speech. It provides a comprehensive climate intelligence platform with document processing, image analysis, JSON analysis, and text-to-speech functionalities, all integrated into a user-friendly Gradio interface.

Video Overview

Watch our comprehensive video demonstration to understand the purpose and usage of the MistyClimate Agent:

![Watch the Demo Video](https://youtu.be/b9HGT9l5bcg)

Click the image above or [watch the demo video on YouTube](https://youtu.be/b9HGT9l5bcg) to see:

  • โ€”How to use the climate chat assistant(Used Agent API)
  • โ€”### Agent API [image]
  • โ€”Document processing capabilities(OCR Model)
  • โ€”Image analysis features(Pixtral Model)
  • โ€”JSON data analysis and speech generation(Large Model)
  • โ€”Text-to-speech functionality(Large Model)
  • โ€”Complete workflow demonstrations(Large Model)

๐Ÿ“ท Preview Images

Below are preview images showcasing key functionalities and model usage:

Mistral Tokens Usage

[image]

Mistral Agents and OCR Usage

[image]

Key Features

Climate Chat Assistant

  • โ€”Specialized Climate Intelligence: Interact with an AI assistant trained on climate science and sustainability topics
  • โ€”Expert Guidance: Get accurate information on climate change, environmental policies, and sustainability practices
  • โ€”Interactive Interface: User-friendly chat interface with emoji avatars and sample questions

Document Processing

  • โ€”Climate Document Analysis: Extract structured data from climate-related PDFs using OCR capabilities
  • โ€”Multi-format Support: Process various document types including climate reports, analysis papers, and data sheets
  • โ€”Structured Output: Get JSON-formatted results for easy integration

Image Analysis

  • โ€”Visual Data Processing: Analyze image-based documents (PNG, JPG, PDF) to extract text, charts, and tables
  • โ€”Chart Recognition: Specialized analysis of climate charts and graphs
  • โ€”Text Extraction: OCR capabilities for extracting text from images
  • โ€”Table Processing: Extract structured data from tabular images

JSON Analysis & Speech

  • โ€”Climate Data Analysis: Analyze JSON data to extract insights and patterns with focus on climate data
  • โ€”Audio Generation: Convert analysis results into speech using advanced TTS
  • โ€”Statistical Analysis: Perform content, statistical, and structural analysis of climate datasets
  • โ€”Multi-modal Output: Get both text analysis and audio summaries

Text-to-Speech

  • โ€”Natural Voice Synthesis: Convert climate-related text into natural-sounding speech
  • โ€”gTTS Integration: High-quality text-to-speech using Google Text-to-Speech
  • โ€”Audio Export: Generate downloadable audio files

Technical Architecture

MCP Server Integration

The MistyClimate Agent utilizes MCP (Model Context Protocol) servers for enhanced functionality:

  • โ€”Document Agent MCP Server: Handles PDF processing and document analysis
  • โ€”Image Agent MCP Server: Manages image analysis and OCR operations
  • โ€”Server Link: MCP Server Implementation

Multi-Agent System

  • โ€”Document Agent: Specialized in climate document processing
  • โ€”Image Agent: Handles visual data analysis
  • โ€”JSON Analyzer Agent: Processes structured climate data
  • โ€”Speech Agent: Manages text-to-speech conversion
  • โ€”Climate Chat Agent: Provides interactive climate intelligence

Setup and Installation

Prerequisites

  • โ€”Docker (for containerized deployment)
  • โ€”A Mistral API key (obtain from Mistral AI)
  • โ€”Python 3.10+ (for local development)

Quick Start

  1. 1.Clone the Repository:
bash
   git clone <repository-url>
   cd <repository-directory>
  1. 1.Install Dependencies:
bash
   pip install -r requirements.txt
  1. 1.Set Up Mistral API Key:
  2. 2.Obtain your API key from Mistral AI
  3. 3.Input your API key in the Gradio interface
  1. 1.Run with Docker (Recommended):
bash
   # Build the Docker image
   docker build -t mistyclimate-agent .
   
   # Run the container
   docker run -p 7860:7860 mistyclimate-agent
  1. 1.Access the Application:
  2. 2.Open http://localhost:7860 in your browser
  3. 3.Enter your Mistral API key when prompted

Deployment on Hugging Face Spaces

This project is configured for seamless deployment on Hugging Face Spaces:

  1. 1.Fork/clone this repository to your Hugging Face account
  2. 2.Create a new Space with sdk: docker
  3. 3.Push your code to the Space repository
  4. 4.The Space will automatically build and deploy

Usage Guide

1. Climate Chat Assistant

  • โ€”Start by entering your Mistral API key
  • โ€”Use the chat interface to ask climate-related questions
  • โ€”Try sample questions provided in the interface
  • โ€”Get expert guidance on climate science, sustainability, and environmental policies

2. Document Processing

  • โ€”Upload a PDF document (climate reports, research papers)
  • โ€”Select the document type (climate_report, analysis, data)
  • โ€”Click "Process Document" to extract structured data
  • โ€”Review the JSON-formatted output

3. Image Analysis

  • โ€”Upload an image file (PNG, JPG, or PDF)
  • โ€”Choose analysis focus (text extraction, chart analysis, table extraction)
  • โ€”Click "Analyze Image" to process the visual data
  • โ€”Get structured results from the image content

4. JSON Analysis & Speech

  • โ€”Input climate-related JSON data
  • โ€”Select analysis type (statistical, content, structural)
  • โ€”Click "Run Analysis & Generate Speech"
  • โ€”Get both text analysis and audio summary

5. Text-to-Speech

  • โ€”Enter text related to climate topics
  • โ€”Click "Generate Speech" to create audio
  • โ€”Download and play the generated audio file

File Structure

โ”œโ”€โ”€ agent.py              # Core multi-agent system logic
โ”œโ”€โ”€ app.py                # Gradio interface and workflow orchestration
โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ”œโ”€โ”€ Dockerfile           # Docker configuration
โ”œโ”€โ”€ README.md           # Project documentation
โ””โ”€โ”€ ...             # Preview images and media

Configuration

Environment Variables

  • โ€”MISTRAL_API_KEY: Your Mistral API key (can be set via environment or interface)

Supported File Formats

  • โ€”Documents: PDF
  • โ€”Images: PNG, JPG, JPEG, PDF
  • โ€”Data: JSON format for climate datasets

Performance Metrics

  • โ€”Document Processing: Handles climate PDFs up to 50MB
  • โ€”Image Analysis: Supports images up to 10MB
  • โ€”Response Time: Typically 2-5 seconds per request
  • โ€”Audio Generation: High-quality TTS output

Privacy and Security

  • โ€”API keys are handled securely and not stored
  • โ€”All processing is done in real-time without data persistence
  • โ€”Files are temporarily stored only during processing

API Reference

For detailed API documentation and integration examples, visit our MCP Server Implementation.

Tags

  • โ€”agent-demo-track
  • โ€”climate-intelligence
  • โ€”multi-agent-system
  • โ€”mistral-ai
  • โ€”document-processing
  • โ€”image-analysis
  • โ€”text-to-speech

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments


Built with โค๏ธ by Samudrala Dinesh Naveen Kumar

Making climate intelligence accessible through advanced AI technology