Skip to content

A FastAPI-based intelligent document processing system that automatically classifies and extracts information from multiple document types (PDFs, Emails, JSON) using AI. Features Redis-backed persistence, detailed metadata tracking, and a flexible multi-agent architecture for handling various document formats and business rules.

Notifications You must be signed in to change notification settings

Milan323-debug/multi_Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Multi-Agent Document Processing System

A powerful FastAPI-based system that automatically processes, classifies, and extracts information from multiple document types using AI agents and Redis-backed storage.

✨ Features

  • 📄 Multi-Format Support: Process PDFs, Emails (plain/HTML), and JSON documents
  • 🧠 Intelligent Classification: AI-powered document type and intent detection
  • 💾 Redis Persistence: Reliable data storage with metadata tracking
  • 🔍 Smart Extraction: Automatically extracts key information and embedded JSON
  • 🚀 Modern API: FastAPI with async support and automatic OpenAPI documentation

🛠️ Quick Start

  1. Clone and Install
git clone https://github.com/Milan323-debug/multi_Agent
cd multi_agent_system
pip install -r app/requirements.txt
  1. Set Up Environment
# Copy example env file and edit with your values
Copy-Item .env.example .env
# Edit .env with your Google API key and Redis configuration
  1. Run the Server
uvicorn app.main:app --reload

🌐 API Endpoints

Process Documents

POST /process/
Content-Type: application/json

{
    "id": "doc_id",
    "content": "your_content",
    "content_type": "email|json|pdf_base64",
    "metadata": { "source": "your_source" }
}

Get Document History

GET /document/{id}

📝 Example Usage

Process an Email

{
    "id": "email_001",
    "content": "From: user@example.com\nSubject: Quote Request\n\nNeed pricing for 10 units.",
    "content_type": "email"
}

Process a JSON Document

{
    "id": "json_001",
    "content_type": "json",
    "json": {
        "order_id": "ORD123",
        "items": ["item1", "item2"]
    }
}

🔧 Requirements

  • Python 3.8+
  • Redis
  • Google AI API Key
  • FastAPI
  • Additional dependencies in requirements.txt

🔒 Security

  • API keys and sensitive data are stored in .env (not committed to git)
  • Input validation and error handling for all endpoints
  • Secure metadata tracking and storage

📚 Documentation

Full API documentation available at:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Made with ❤️ using FastAPI, Redis, and Google AI

About

A FastAPI-based intelligent document processing system that automatically classifies and extracts information from multiple document types (PDFs, Emails, JSON) using AI. Features Redis-backed persistence, detailed metadata tracking, and a flexible multi-agent architecture for handling various document formats and business rules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published