Inspiration

What it does

🧠 TenderPilot β€” AI Legal Ops Platform

Human-in-the-Loop AI Assistant for Legal Operations

Next.js React TypeScript Supabase Gemini


πŸš€ Overview

TenderPilot is a next-generation AI platform for legal case management β€” built using Google’s Agent Development Kit (ADK) principles. It demonstrates advanced multi-agent orchestration, parallel processing, and agent-to-agent (A2A) communication for streamlined legal workflows.

At its core, TenderPilot transforms chaotic client communications into clean, actionable tasks that legal teams can approve and execute with confidence.


βš™οΈ Key Features

πŸ€– Multi-Agent Orchestration

  • Evidence Sorter Agent β€” Extracts and structures billing or medical records.
  • Client Communications Agent β€” Drafts empathetic and professional client updates.
  • Classifier Agent β€” Routes new messages to the correct specialists.
  • Orchestrator β€” Dispatches all AI agents in parallel, tracking every step.

🧍 Human-in-the-Loop Workflow

  • Approval System β€” Attorneys review AI proposals before execution.
  • Confidence Scoring β€” Displays the model’s certainty on each task.
  • Execution Preview β€” See exactly what the AI intends to do before confirming.

πŸ“ˆ Real-Time Monitoring

  • Audit Timeline β€” Every decision logged for transparency.
  • Telemetry Dashboard β€” Live metrics for tasks, handoffs, and loop ticks.
  • Task Watcher β€” Continuous background monitoring for new messages.

🧩 Modern UI / UX

  • Gradient-based design (Blue β†’ Purple)
  • Framer Motion animations
  • Lucide icons + TailwindCSS responsive layout

🧱 ADK Patterns Implemented

Pattern Description How It Works
πŸ”€ Parallelism Multiple agents run concurrently Evidence Sorter + Client Comms execute in parallel
🀝 A2A Communication Agents share knowledge between runs Client Comms imports the latest Evidence Sorter results
πŸ”„ Continuous Loop Background monitoring & auto-classification Watcher pings /api/loop/tick every few seconds

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Inbox      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Classifier   β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Parallel Agents    β”‚
β”‚  (Evidence & Comms) β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Approvals   β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Execution   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧩 Tech Stack

Frontend

  • Next.js 16 (App Router)
  • React 19.2
  • TypeScript
  • TailwindCSS v4
  • Framer Motion
  • Lucide React

Backend

  • Next.js API Routes
  • Supabase (PostgreSQL)
  • Google Gemini 2.5 Pro

Infrastructure

  • Vercel (deployment)
  • Supabase Cloud (DB + hosting)

⚑ Getting Started

Prerequisites

Installation

git clone https://github.com/tomiwaaluko/tenderpilot.git
cd tenderpilot
npm install

Environment Setup

Create .env.local:

GEMINI_API_KEY=your_gemini_api_key_here
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_SITE_URL=http://localhost:3000
TP_USE_MOCKS=false

πŸ’‘ Tip: During testing, set TP_USE_MOCKS=true to use mock Gemini outputs.

Start the Server

npm run dev
# open http://localhost:3000

🧠 Usage Guide

1. Submit a Message β†’ /inbox

Paste a case ID and client message (email/text). TenderPilot classifies and creates structured tasks.

2. Start Watcher β†’ /tasks

Enables the continuous ADK loop. Automatically detects new messages and classifies them.

3. Run Orchestrator

Dispatches agents in parallel (Evidence Sorter + Client Comms). Creates a parallel_dispatch entry in the audit log.

4. Review & Approve β†’ /approvals

Attorneys approve AI-generated proposals. Client Comms uses A2A handoff from Evidence Sorter.

5. Monitor Everything

  • /audit β†’ Action timeline (loop ticks, handoffs, dispatches)
  • /telemetry β†’ Live metrics for ADK activity

πŸ§ͺ Testing (Quick Validation)

# Create a new message
curl -X POST http://localhost:3000/api/ingest \
  -F "caseId=case-101" \
  -F "text=Client sent new bills from Orlando Health"

# Run orchestrator
curl -X POST http://localhost:3000/api/orchestrator/run

# Simulate watcher loop
curl -X POST http://localhost:3000/api/loop/tick

Check /audit for:

  • parallel_dispatch
  • a2a_handoff
  • loop_tick

πŸ“Š Telemetry Metrics

Metric Description
Pending / Proposed / Approved / Executed Task pipeline counts
Parallel Dispatches Number of ADK multi-agent runs
A2A Handoffs Agent-to-agent data transfers
Last Loop Tick Time of last watcher activation

🧾 Project Structure

app/
 β”œβ”€β”€ api/
 β”‚   β”œβ”€β”€ agents/
 β”‚   β”‚   β”œβ”€β”€ client-comms/       # Client communication agent
 β”‚   β”‚   └── evidence-sorter/    # Evidence extraction agent
 β”‚   β”œβ”€β”€ classify/               # Message classification
 β”‚   β”œβ”€β”€ ingest/                 # Message ingestion
 β”‚   β”œβ”€β”€ loop/tick/              # Continuous watcher
 β”‚   └── orchestrator/run/       # Parallel dispatcher
 β”œβ”€β”€ inbox/                      # Inbox UI
 β”œβ”€β”€ tasks/                      # Orchestration dashboard
 β”œβ”€β”€ approvals/                  # Human review UI
 β”œβ”€β”€ audit/                      # System timeline
 └── telemetry/                  # ADK metrics dashboard

🧰 Troubleshooting

Issue Fix
β€œIngest failed” Check Supabase connection + disable RLS
β€œGemini API error” Verify GEMINI_API_KEY or use mocks
Tasks missing Ensure classification + orchestrator ran
Watcher inactive Confirm /api/loop/tick returns 200
Telemetry empty Run through one full workflow first

🌐 Deployment (Vercel)

  1. Push to GitHub:
   git push origin main
  1. Import to Vercel
  2. Add .env variables under project settings
  3. Deploy β†’ open https://your-domain.vercel.app

🀝 Contributing

Pull requests are welcome! Follow standard TypeScript + ESLint rules, commit semantically, and document new routes or agents.


🧭 Roadmap

Phase Features Status
1. Core System Classification, Approvals, Telemetry βœ…
2. ADK Integration Parallel Agents, A2A, Continuous Loop βœ…
3. Future Auth, File Uploads, Analytics, Tests 🚧

πŸ” Security

Development:

  • RLS disabled for demo simplicity
  • API keys stored safely in .env.local

Production:

  • Enable RLS
  • Add authentication (NextAuth.js)
  • Enforce HTTPS
  • Rate-limit endpoints

πŸ† Credits & Acknowledgments

  • Google Gemini β€” LLM powering intelligent classification
  • Supabase β€” Realtime database and backend
  • Vercel β€” Hosting & deployment
  • Next.js Team β€” Framework excellence

πŸ’‘ Built For

Google AI Hackathon 2025 β€” Showcasing multi-agent ADK architecture in real legal workflows. β€œHuman judgment + AI efficiency = Better justice.”

Last updated: **October 26, 2025**

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for TenderPilot

Built With

  • framer-motion
  • google-agent-development-kit-(adk)
  • google-gemini-2.5-pro-api
  • lucide-react
  • next.js
  • node.js
  • react-19
  • shadcn/ui
  • supabase-(postgresql)
  • tailwind-css
  • typescript
  • vercel
Share this project:

Updates