💡 Inspiration

The U.S. criminal justice system processes millions of cases annually, yet many convicted individuals lack access to a thorough legal analysis that could reveal grounds for appeal. Wrongful convictions and procedural errors often go unnoticed due to:

  • Long waiting time because of manual review of witness testimony, physical evidence, and documentary evidence
  • Limited public defender resources and overwhelming caseloads
  • Bias and inconsistencies in original trials that may be overlooked

🔍 What It Does

Hiromi is an intelligent multi-agent system that performs comprehensive criminal appeal analysis by:

🤖 Multi-Agent Evidence Analysis

  1. Parallel Evidence Processing: Three specialized AI agents analyze different evidence types simultaneously:

    • Witness Analysis Agent: Examines eyewitness testimony for bias, inconsistencies, visibility issues, timeline discrepancies, and stress factors
    • Physical Evidence Agent: Reviews forensic evidence, chain of custody, and physical proof
    • Documentary Evidence Agent: Analyzes court documents, records, and written evidence
  2. Executor Agent Debate System: Three executive agents debate the findings:

    • Each executor specializes in their evidence domain
    • Agents must reach consensus (unanimous 3/3 or majority 2/3)
    • Built-in retry mechanism ensures thorough deliberation
    • Offers a preliminary recommendation: INNOCENT (mistrial advised) or NOT INNOCENT, pending human validation.
  3. Automated Legal Memo Generation:

    • Generates comprehensive PDF memos with verdict justification
    • Cites specific evidence from all three analysis streams
    • Uploads memos to Google Cloud Storage for attorney access

📧 Gmail Integration

  • Automated email notifications to attorneys
  • PDF attachment support for authorization forms
  • OAuth2 secure authentication

🔄 Orchestration & Scalability

  • Google Agent Development Kit (ADK) powers the multi-agent architecture
  • Parallel processing for faster case analysis
  • Sequential debate coordination with loop retry mechanisms
  • Session management for a consistent state across agent interactions

🏗️ How We Built It

AI Framework: Google ADK orchestrates our 7-agent pipeline powered by Gemini 2.0 Flash. LiteLLM handles model routing while A2A SDK enables agent communication.

Backend: FastAPI REST API with PostgreSQL on Google Cloud SQL, using SQLAlchemy ORM and Cloud SQL Python Connector for secure connections.

Cloud Services: Google Cloud Storage for PDF memos, Gmail API for email automation.

Pipeline Architecture:

Evidence Collection → Parallel Analysis (3 agents) → Bridge Agent 
→ Executor Debate (3 agents) → Consensus Checker → Final Decision 
→ Memo Generation & Storage

🚧 Challenges We Ran Into

  • Simulating Lawmatic's dashboard using GitHub.

  • Implementing the multi-agent system into existing software like GitHub Project (Lawmatic Simulation).

  • Configuring Google Cloud services into a single ecosystem.

🏆 Accomplishments That We're Proud Of

✅ Successfully implemented a multi-agent pipeline with parallel processing and debate coordination

✅ Built a production-ready REST API with PostgreSQL database and Google Cloud integration

✅ Achieved automated legal analysis that would typically require months of attorney time

✅ Integrated email automation for seamless attorney communication

✅ Designed bias detection algorithms for witness testimony analysis (gender, racial, situational bias)

✅ Built secure cloud infrastructure with proper authentication and data encryption

What we learned

  • Learned how to create a multi-agent pipeline utilizing Google's Adk
  • How to utilize Google Cloud service within our multi-agent ecosystem
  • Converting our multi-agent into existing software(Github Project)

What's next for Hiromi

  • Integration with Real Case Databases
  • Expand beyond English-language transcripts and evidence
  • Collaborate with public defender organizations and legal aid nonprofits to test Hiromi on anonymized case datasets

Built With

Share this project:

Updates

Submission history