Legal Flow AI - Multi-Agent Legal Document Analysis System
🎯 Problem Statement
Legal documents are notoriously complex and difficult for ordinary people to understand. Citizens, small business owners, and even professionals struggle to navigate dense legal language, making it hard to understand their rights, obligations, and the processes they need to follow.
💡 Solution
Legal Flow AI is a multi-agent system built with Google's Agent Development Kit (ADK) that automatically transforms complex legal documents into:
- Plain language explanations that anyone can understand
- Visual workflow diagrams showing step-by-step processes
- Clear identification of stakeholders and their roles
🏗️ Technical Architecture
Our solution uses a hierarchical multi-agent architecture built with Google's Agent Development Kit:
Parent Agent: Legal Flow Agent (LlmAgent) - Orchestrates the entire workflow and coordinates sub-agents
Sub-Agents:
- Simplification Agent (LlmAgent): Parses legal text and converts complex language into plain, accessible explanations
- Workflow Diagram Agent (LlmAgent): Analyzes relationships between parties and generates Mermaid workflow diagrams, integrated with Mermaid Live Editor API for automatic image generation
This hierarchical design allows for sophisticated coordination between agents while maintaining clear separation of concerns.
🛠️ Technology Stack
- Google Cloud Agent Development Kit (ADK): Multi-agent orchestration
- Vertex AI Reasoning Engine: Agent coordination and execution
- Streamlit on Cloud Run: Web interface for user interaction
- Mermaid Live Editor API: Automated diagram generation
- Google Cloud Platform: Infrastructure, CI/CD, and deployment
🎬 Demo
Live Demo: https://legal-flow-ai-ui-62120381049.us-central1.run.app/ Video Demo: https://youtu.be/TJz2disQh_w
🚀 Key Features
- Real-time processing of Japanese legal documents with immediate feedback
- Plain language transformation - converts complex legal jargon into accessible explanations
- Visual workflow generation - automatic Mermaid diagram creation showing decision flows and processes
- Multi-tab results interface - organized display of simplified text and interactive flow diagrams
- Scalable cloud architecture with CI/CD pipeline on Google Cloud Platform
- User-friendly Japanese web interface with clear instructions and sample text options
📊 Impact
Legal Flow AI democratizes access to legal information by:
- Reducing the time needed to understand legal documents from hours to minutes
- Making legal processes transparent through visual workflows
- Enabling better compliance and decision-making for citizens and businesses
- Bridging the gap between complex legal language and practical understanding
🔗 Resources
- GitHub Repository: https://github.com/azusa-kikuike/legal-flow-ai
- Architecture Documentation: Comprehensive system design with Mermaid diagrams
- Live Deployment: Fully functional web application on Google Cloud Run
💡 What Inspired Me
When developing products that interact with legal regulations, not everyone on the team—product managers, engineers, designers—has deep legal expertise. I believe that by helping non-legal professionals grasp the overall structure of regulatory systems, we can create a world where technology products and legal frameworks work together harmoniously. Legal Flow AI represents a first step toward this vision, democratizing legal understanding across interdisciplinary teams.
🧠 What I Learned
While AI discussions often focus on coding assistance, productivity tools, or job displacement, I wanted to understand AI from a deeper product perspective: When should we choose Reasoning Engines over traditional programming?
My insight came from the Agent Development Kit YouTube tutorial, which demonstrated agents that find search keywords, store them in BigQuery, and parse HTML with Selenium. The key learning was that AI excels where traditional programming becomes unwieldy—like parsing diverse, frequently-changing website structures—while structured data operations remain better suited for conventional code.
Applying this principle, I used AI for interpreting complex legal documents and generating flowcharts, while keeping data management and API calls in traditional code. The result: prompts that transform dense legal text into accessible, visual explanations.
🛠️ How I Built It
Architecture Design: I implemented a hierarchical multi-agent system using Google's Agent Development Kit, with a parent Legal Flow Agent orchestrating two specialized sub-agents.
Development Process: As a Python newcomer, I relied heavily on Claude and Claude Code for guidance. This AI-assisted development allowed me to tackle complex tasks—from system architecture to video production—that would have been overwhelming alone.
Technology Integration: I deployed the system on Google Cloud Platform using Vertex AI Reasoning Engine, Streamlit for the frontend, and integrated Mermaid Live Editor API for diagram generation.
🚧 Challenges I Faced
The Deployment Spiral: My biggest challenge was deployment configuration across multiple Google Cloud services. I encountered what I call the "error cascade"—fixing one error would trigger another, and after several iterations, I'd circle back to the original issue. Claude could analyze and suggest fixes, but couldn't see the broader systemic patterns.
The Solution: Understanding the underlying concepts (regions, CI/CD pipelines, service interactions) was crucial. While AI provided tactical solutions, strategic thinking about why errors occurred required human insight into deployment architecture.
A Deeper Realization: AI functions like a powered exoskeleton—it dramatically reduces friction and expands capabilities, but also elevates me to tackle more complex challenges. (Interestingly, intensive AI collaboration left me craving glucose—evidence of the cognitive load involved in managing AI-augmented workflows.)
📊 Impact & Reflection
This project demonstrated that AI's true value isn't replacing human expertise, but amplifying our ability to bridge disciplines. Legal Flow AI enables technologists to understand legal frameworks and legal professionals to envision digital solutions—fostering the cross-pollination necessary for building products that truly serve society.
Built With
- agent-development-kit
- cloud-build
- cloud-run
- github
- google-cloud
- mermaid
- python
- streamlit
- terraform
- vertex-ai
Log in or sign up for Devpost to join the conversation.