Inspiration

  • 80+ million Americans qualify for civil legal aid but cannot access it due to cost, language barriers, or geographic isolation
  • Traditional legal intake takes 2–4 weeks — a critical gap when eviction deadlines are 3 days away
  • Most legal aid tools are text-heavy, complex, and inaccessible to non-English speakers or people with disabilities
  • We asked: what if a scared tenant could just speak their problem aloud and receive immediate, expert guidance?
  • The Amazon Nova portfolio — especially Nova 2 Sonic's real-time speech-to-speech capability — made a voice-first legal assistant genuinely feasible for the first time

What it does

  • 🎙️ Speaks with users in real time via Amazon Nova 2 Sonic — no typing, no forms, no barriers
  • 🧠 Classifies legal issues (housing, employment, immigration, family law) and assesses urgency using a multi-agent reasoning pipeline
  • ✍️ Drafts legal letters — tenant rights letters, wage claim letters, demand letters — personalized to the user's situation
  • 📎 Analyzes uploaded documents — eviction notices, lease agreements, pay stubs — extracting key dates, amounts, and rights violations
  • 🌐 Supports English and Spanish, with a mobile-first UI accessible from any smartphone
  • ⚖️ Zero cost to users — built entirely on serverless AWS infrastructure

How we built it

Architecture: Four Amazon Nova Models Working Together

User speaks
    │
    ▼
Nova 2 Sonic ──────────────────────────────► Voice response + transcript
    │
    ├── Transcript ──► Strands Agents Orchestrator (Nova Lite APAC)
    │                       ├── Legal Classifier Agent
    │                       ├── Eligibility Assessor Agent
    │                       └── Document Drafter Agent
    │
    ├── Uploaded docs ──► Titan Embeddings → OpenSearch Serverless (RAG)

Backend Stack

  • FastAPI with WebSocket endpoint for real-time bidirectional voice streaming
  • Nova 2 Sonic (amazon.nova-2-sonic-v1:0) via the aws-sdk-bedrock-runtime Smithy SDK — handles mic → PCM → Sonic → PCM → speaker at 16kHz/24kHz
  • Nova Lite (apac.amazon.nova-lite-v1:0) via Strands Agents SDK with three specialist sub-agents using the @tool decorator pattern
  • Amazon Titan Text Embeddings v2OpenSearch Serverless (k-NN with FAISS, 1024 dimensions, cosine similarity) for document RAG
  • PyMuPDF + Pillow for PDF text extraction and image preprocessing

Frontend Stack

  • React 18 + Vite with Tailwind CSS
  • Web Audio APIScriptProcessor for mic capture, downsampled from 48kHz → 16kHz; AudioContext + BufferSource for seamless 24kHz PCM playback

Challenges we ran into

  • Regional access from IndiaAWS_DEFAULT_REGION=ap-south-1 silently routed Nova Sonic to the wrong endpoint; required splitting into NOVA_SONIC_REGION=us-east-1 vs NOVA_LITE_REGION=ap-south-1 per service
  • Nova Act geo-restriction — API key portal inaccessible outside US; implemented a production-quality simulation layer that activates automatically and mirrors the real workflow's step structure
  • Python 3.14 + PyAudio — no pre-built wheel exists; replaced with sounddevice using RawInputStream/RawOutputStream for Python 3.14 compatibility

Accomplishments that we're proud of

  • Real-time bidirectional voice streaming with transcript, analysis card, and legal document rendering in the same UI
  • Document intelligence pipeline — upload a PDF eviction notice and receive structured analysis of key dates, amounts, parties, urgency flags, and rights violations within seconds

What we learned

  • Nova 2 Sonic is remarkably natural for conversational AI — the warmth and pacing of the agent's voice makes a genuinely empathetic experience
  • AWS regional availability is a first-class architectural concern — building a region-aware config layer from day one would have saved significant debugging
  • Simulation layers are legitimate — a well-designed simulation that mirrors the real workflow's step structure is valid for demonstrating architecture even when an API is geographically restricted

What's next for Echo Legal AI

  • 🌍 Expand language support — Regional languages using Nova Sonic's multilingual capabilities
  • 🤖 Autonomously file intake forms with legal aid organizations via Nova Act browser automation
  • 🔐 User accounts + case history — DynamoDB-backed session persistence so users can return to ongoing cases
  • ☁️ Production deployment — AWS CDK stack with CloudFront + Lambda + ECS, CI/CD via GitHub Actions

Built With

  • amazon-bedrock
  • amazon-nova-2-sonic
  • amazon-nova-lite
  • amazon-titan-text-embeddings
  • fastapi
  • python
  • react
  • tailwindcss
  • vite
  • websockets
Share this project:

Updates