LegalMindz Nova - AI Legal Infrastructure for 120 Million People
Inspiration
120 million people. 3,000 lawyers.
That is Ethiopia today. One lawyer for every 40,000 citizens. In the United States, the ratio is 1:250 -- Ethiopia's is 160 times worse. If you are a small business owner in Addis Ababa, a coffee farmer in Sidama, a startup founder in Hawassa - you have almost certainly never consulted a lawyer. You have never had a contract reviewed. You signed what was placed in front of you, or you signed nothing at all.
2.5 million Ethiopian businesses. 83% have never had a single legal document reviewed. When disputes arise - and they do - these businesses lose. Not because they were wrong. Because they had no documentation. No protection. No legal infrastructure.
One contract costs $500. A typical Ethiopian SME earns less than that in a month.
This is not a technology gap. It is an access gap. And access gaps are exactly what AI was built to close.
LegalMindz delivers Fortune 500-grade legal infrastructure to a market where it has never existed -- powered entirely by Amazon Nova. #AmazonNova
What It Does
LegalMindz is a full-stack AI legal platform that gives every Ethiopian business access to contract drafting, risk analysis, legal research, voice consultation, and workflow automation -- in both English and Amharic - powered end-to-end by Amazon Nova models through Amazon Bedrock.
1. Multi-Agent Contract Drafting (4 Specialized Agents)
A four-agent pipeline generates legally compliant Ethiopian contracts with real-time token streaming. You watch the contract materialize word by word as each agent completes its phase.
The Pipeline:
- Research Agent (Nova Pro) - Embeds the query via Nova Embed, retrieves relevant Ethiopian law articles from pgvector via cosine similarity, and identifies the legal requirements for the specific contract type
- Compliance Agent (Nova Pro) - Cross-references the research output against Ethiopia's Civil Code (1960), Commercial Code (Proclamation 1243/2021), and Labour Proclamation 1156/2019 to produce a mandatory clause checklist
- Drafting Agent (Nova Pro) -- Generates the complete contract via
streamText, token by token via SSE, incorporating the research findings and compliance requirements. Full bilingual support -- the entire contract can be drafted in Amharic with Ge'ez script legal citations - Review Agent (Nova Pro) -- Performs adversarial compliance audit on the finished contract, checking for gaps, ambiguities, and missing mandatory provisions
49 contract templates spanning employment (standard, fixed-term, part-time, probationary, managerial, domestic worker, construction, internship), commercial and residential leases, sales agreements (goods, vehicle, business, property, export, installment), service contracts (consulting, IT, construction, transport, cleaning, security, catering, training, accounting, marketing), NDAs (mutual, employee, investor, vendor), partnership and joint venture, and specialized instruments (agency, franchise, loan, supply, maintenance, software license, distribution, power of attorney, guarantee, settlement, MOU, share purchase).
2. Contract Risk Analysis (Streaming 3-Step Pipeline)
Upload a PDF or paste any contract text. A streaming SSE pipeline reviews the document against Ethiopian law in real time:
- Step 1: Structure Review -- Parses the document structure and identifies clause boundaries
- Step 2: Compliance Check (Nova Pro) -- Evaluates every clause against Ethiopian federal law. Uses structured JSON output (
generateObjectpattern) with severity ratings, specific article violations, and missing mandatory clauses - Step 3: Risk Scoring -- Produces an actionable report: risk level (High/Medium/Low), clause-by-clause issues with the specific Ethiopian law violated (e.g., "Labour Proclamation 1156/2019, Article 42"), and recommended compliant replacement language
Full Amharic analysis available -- every field, every recommendation, rendered in Ge'ez script.
3. Voice Legal Consultation in Amharic (Amazon Nova Sonic)
A small business owner in rural Ethiopia opens LegalMindz on their phone, taps the microphone, and asks a legal question in Amharic -- the language 120 million Ethiopians actually speak. The AI listens, understands, and speaks the answer back in Amharic, grounded in Ethiopian law, citing specific proclamation articles.
No app literacy required. No English required. No lawyer required.
Technical architecture:
- Amazon Nova Sonic (
amazon.nova-sonic-v1:0) viaInvokeModelWithBidirectionalStreamCommand - Custom Sonic Bridge -- a dedicated Node.js WebSocket server running on EC2 that translates between the browser's audio stream and Bedrock's bidirectional streaming API
- Audio pipeline: Browser microphone → 16kHz/16-bit/mono PCM → base64 → WebSocket → Sonic Bridge → Bedrock Nova Sonic → 24kHz/16-bit/mono PCM audio response → WebSocket → custom PCMPlayer with gapless AudioContext scheduling
- System prompts in both English and Amharic (full Ge'ez script:
"አንተ "LegalMindz" ነህ — የኢትዮጵያ ሕግ ባለሙያ AI") - Animated AI persona with state transitions: idle → listening → thinking → speaking
- Graceful degradation: if Nova Sonic WebSocket is unreachable (e.g., HTTPS/WSS mismatch), automatically falls back to Nova Pro SSE streaming via
/api/voice
This is the first Amharic-language legal voice AI ever built.
4. Deep Research (Nova Pro + Nova Act + Tool Use)
Complex legal questions trigger a Deep Research pipeline that goes far beyond a chatbot summary:
- Step 1: Research Planning (Nova Pro,
generateObject) -- Creates a structured research plan with 2-4 topics, each with 2-4 specific search queries - Step 2: Agentic Execution (Nova Pro,
generateTextwith tool use) -- The model autonomously decides when and how to call two tools:browseEthiopianLaw-- Calls the Nova Act sidecar (Flask on EC2, port 8001) which uses Amazon Nova Act browser automation to navigate negarit.gov.et (Ethiopia's official Federal Negarit Gazette) and extract authoritative legal textwebSearch-- Calls the Tavily API for supplementary analysis, commentary, and comparative law
- Up to 6 agentic steps (
stepCountIs(6)stop condition), with real-time progress streaming via SSE - Output: structured research plan, collected sources with URLs, and synthesized findings with citations
This is a researched legal brief, not a chatbot response.
5. Workflow Automation (4-Agent Pipeline × 8 Workflow Types)
Eight pre-built legal workflows, each executing a four-agent pipeline:
| Workflow | What It Produces |
|---|---|
| Due Diligence | Corporate structure review, regulatory compliance status, risk ratings, recommended actions |
| Contract Review | Clause-by-clause analysis, compliance issues, risk assessment with law references |
| Business Registration | Step-by-step registration guide with documents, offices, timelines, fees |
| Employment Law Audit | Labour Proclamation 1156/2019 compliance check across contracts, hours, benefits, termination |
| Tax Compliance | Income tax, VAT, withholding tax, pension review with gap analysis |
| IP Protection | Trademark, copyright, patent strategy with EIPO filing procedures |
| Real Estate Advisory | Land lease, property transfer, construction permits, EIA requirements |
| Dispute Resolution | Negotiation/mediation/arbitration/litigation strategy with cost and timeline analysis |
Each workflow executes:
- Legal Research Agent (Nova Pro + Tavily tool use) -- Retrieves applicable Ethiopian law
- Document Analysis Agent (Nova Pro) -- Extracts key entities, obligations, risks
- Compliance Check Agent (Nova Lite) -- Fast compliance verification
- Report Generation Agent (Nova Pro) -- Produces the final deliverable with markdown formatting
All workflows support bilingual output (English/Amharic) and downloadable reports.
6. Legal Chat with RAG (7 Model Options)
RAG-enhanced legal chat grounded in Ethiopian federal law:
- Embedding pipeline: User query → Nova Embed (
amazon.nova-embed-v1:0) with Titan Embed v2 (amazon.titan-embed-text-v2:0) fallback → 1024-dimensional vector - Vector search: Cosine similarity search against pgvector (IVFFlat index) over Ethiopian law articles covering Labour Proclamation 1156/2019, Civil Code 1960, Commercial Code 1243/2021, Tax Law, IP Law, Investment Proclamation, Constitutional Law, Family Law, Environmental Law, Banking, Telecom, Mining, Consumer Protection, and Arbitration Law
- RAG citations: Sources are returned as message metadata and displayed as inline citations with relevance percentages
- Optional web search: Tavily integration for live supplementary sources
- Bilingual system prompts: Amharic mode triggers Ge'ez script citation format (
የሠራተኛ አዋጅ ቁጥር 1156/2019 አንቀጽ 42)
7 selectable models -- all Amazon Bedrock:
| Model | ID | Use Case |
|---|---|---|
| Nova Pro | us.amazon.nova-pro-v1:0 |
Deep legal reasoning |
| Nova 2 Lite | amazon.nova-2-lite-v1:0 |
Fast chat responses |
| Nova Lite v1 | us.amazon.nova-lite-v1:0 |
Lightweight queries |
| Nova Micro | us.amazon.nova-micro-v1:0 |
Ultra-fast single-turn |
| Titan Text Premier | us.amazon.titan-text-premier-v2:0 |
AWS Titan reasoning |
| Titan Text Express | us.amazon.titan-text-express-v1 |
AWS Titan fast |
| Titan Text Lite | us.amazon.titan-text-lite-v1 |
AWS Titan lightweight |
7. Document OCR (Nova Pro Vision)
Upload a PDF or image of any legal document:
- PDF: Extracted via pdf-parse v2 (class-based API, serverless-compatible)
- Image: Processed by Nova Pro Vision (
us.amazon.nova-pro-v1:0multimodal) usingInvokeModelCommandwith base64-encoded image input -- extracts all text verbatim, preserving clause numbers, section headers, and legal formatting - Fallback chain: pdf-parse v2 → pdf-parse v1 → Nova Pro Vision → error with diagnostics
How We Built It
The Amazon Nova Stack
Every user interaction in LegalMindz flows through Amazon Bedrock. This is not one model bolted onto an existing application. Amazon Nova IS the platform. Every feature, every agent, every pipeline runs on Nova.
| Capability | Amazon Nova Model | Model ID |
|---|---|---|
| Multi-agent reasoning (drafting, analysis, workflows, research) | Nova Pro | us.amazon.nova-pro-v1:0 |
| Fast chat, compliance checking | Nova 2 Lite | amazon.nova-2-lite-v1:0 |
| Lightweight queries | Nova Lite v1 | us.amazon.nova-lite-v1:0 |
| Ultra-fast single-turn | Nova Micro | us.amazon.nova-micro-v1:0 |
| Real-time bidirectional voice (Amharic + English) | Nova Sonic | amazon.nova-sonic-v1:0 |
| Text embeddings for RAG vector search | Nova Embed | amazon.nova-embed-v1:0 |
| Embedding fallback | Titan Embed v2 | amazon.titan-embed-text-v2:0 |
| Document OCR (multimodal vision) | Nova Pro Vision | us.amazon.nova-pro-v1:0 (multimodal) |
| Deep research browser automation | Nova Act | Via EC2 sidecar |
| AWS Titan reasoning | Titan Text Premier | us.amazon.titan-text-premier-v2:0 |
| AWS Titan fast | Titan Text Express | us.amazon.titan-text-express-v1 |
| AWS Titan lightweight | Titan Text Lite | us.amazon.titan-text-lite-v1 |
11 Amazon models. One platform. Zero external LLM dependencies.
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Vercel (Next.js 16, React 19) │
│ │
│ /chat — RAG legal chat (7 model selector) │
│ /draft — Multi-agent contract drafting (4 agents, SSE) │
│ /analyze — Contract risk analysis (streaming pipeline) │
│ /upload — Document OCR (pdf-parse + Nova Pro Vision) │
│ /voice — Real-time voice consultation (Nova Sonic) │
│ /workflow — 8 workflow types (4-agent pipelines) │
│ /dashboard — Usage metrics │
│ │
│ Deep Research: Nova Pro + Nova Act + Tavily (tool use, SSE) │
└──────┬──────────────────┬──────────────────┬────────────────────┘
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌────────────────────────────┐
│ Neon Postgres│ │ SQLite │ │ Amazon Bedrock │
│ (pgvector) │ │ (local) │ │ │
│ Ethiopian │ │ contracts │ │ Nova Pro Nova 2 Lite │
│ law articles │ │ analyses │ │ Nova Lite Nova Micro │
│ 1024-dim │ │ documents │ │ Nova Sonic Nova Embed │
│ vectors │ │ metrics │ │ Titan Premier/Express/Lite │
│ IVFFlat idx │ │ │ │ Nova Pro Vision (OCR) │
└──────────────┘ └──────────────┘ └──────────────┬─────────────┘
│
┌───────────────┴──────────────┐
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Nova Act Sidecar│ │ Sonic Bridge │
│ (Flask, EC2) │ │ (Node.js, EC2) │
│ Port 8001 │ │ Port 8002 │
│ Browser auto- │ │ WSS bidirection │
│ mation for │ │ al audio stream │
│ negarit.gov.et │ │ 16kHz→24kHz PCM │
└─────────────────┘ └─────────────────┘
Tech Stack
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router), React 19, TypeScript 5 |
| AI/LLM | Amazon Bedrock (Vercel AI SDK @ai-sdk/amazon-bedrock) |
| Voice | Amazon Nova Sonic via custom WebSocket bridge on EC2 |
| Browser Automation | Amazon Nova Act via Flask sidecar on EC2 |
| Vector Database | Neon PostgreSQL + pgvector (1024-dim, IVFFlat, cosine) |
| Local Database | SQLite (contracts, analyses, documents, metrics) |
| Embeddings | Nova Embed v1 + Titan Embed v2 fallback |
| Web Search | Tavily API |
| PDF Processing | pdf-parse v2 + Nova Pro Vision OCR fallback |
| Auth | NextAuth v4 (JWT sessions) |
| UI | shadcn/ui, Radix UI, Framer Motion, Tailwind CSS 4 |
| Deployment | Vercel (frontend) + EC2 (Sonic Bridge + Nova Act sidecar) |
| TLS | Nginx + Let's Encrypt via nip.io |
Challenges We Ran Into
Nova Sonic bidirectional streaming. The official SDK requires a specific async iterable pattern with queue-based [Symbol.asyncIterator] -- not an async generator. Getting the event flow right (sessionStart → promptStart → contentStart(SYSTEM) → textInput → contentEnd → then user audio content blocks) took significant reverse-engineering of the AWS samples. The Sonic Bridge server is 682 lines of carefully orchestrated WebSocket-to-Bedrock translation.
Amharic language fidelity. LLMs tend to "drift" back to English mid-response when generating Amharic text. We solved this with aggressive system prompt engineering: "CRITICAL: Draft the ENTIRE contract in Amharic (አማርኛ). Every section, heading, clause, and term must be in Amharic script." Internal agent-to-agent communication runs in English to preserve reasoning quality; Amharic translation is applied at the output layer.
HTTPS/WSS mixed content. Vercel serves over HTTPS, but our EC2 Sonic Bridge initially ran on raw WebSocket. Browsers block ws:// from https:// pages. We deployed Nginx with Let's Encrypt TLS certificates via nip.io (wss://98.92.77.193.nip.io/sonic) and implemented automatic fallback detection -- if the WebSocket handshake fails, the UI silently switches to SSE streaming via Nova Pro.
Gapless PCM audio playback. Nova Sonic returns 24kHz/16-bit/mono PCM chunks. Simply feeding them into AudioContext produces clicks between chunks. We built a custom PCMPlayer that schedules buffers on the AudioContext timeline (source.start(startAt) where startAt = Math.max(ctx.currentTime, nextPlayTime)), achieving gapless voice output.
Accomplishments That We're Proud Of
Real-time Amharic legal voice AI. To our knowledge, no one has built a voice-based legal consultation system in Amharic before. A language spoken by 120 million people, rendered accessible to legal AI for the first time, powered by Amazon Nova Sonic.
11 Amazon models in one coherent product. This is not a demo with one model attached. Nova Pro reasons. Nova Sonic speaks. Nova Embed searches. Nova Act browses. Nova Pro Vision reads documents. Titan models provide speed tiers. Every model has a specific, justified role in a production architecture.
49 contract templates grounded in Ethiopian federal law. Each template is backed by the RAG corpus and validated through the multi-agent pipeline against specific proclamation articles. Labour Proclamation 1156/2019 Article 26 requires written employment contracts in Amharic -- LegalMindz enforces this.
$500 → $5. 3 days → 30 seconds. That is the before and after. A contract that costs a small Ethiopian business their entire monthly revenue now costs less than a cup of coffee and is delivered while they wait.
What We Learned
Building for a market with 120 million people and virtually zero existing legal technology taught us that the highest-impact AI applications are not in markets where AI is a convenience -- they are in markets where AI is the only viable path to access.
Ethiopia doesn't need a marginally better legal tool. It needs legal infrastructure that never existed. Amazon Nova's model diversity -- from Sonic for voice to Act for browser automation to Pro for reasoning -- made it possible to build that entire infrastructure as one platform, rather than stitching together five different vendor APIs.
We also learned that voice is not a feature -- in a country where many business owners have limited written literacy but full oral fluency, voice is the interface. Nova Sonic's support for Amharic made that interface possible.
What's Next for LegalMindz
- Court document filing automation -- generating properly formatted submissions for Ethiopian federal courts
- Legal marketplace -- connecting verified Ethiopian lawyers with SMEs for cases that require human counsel, with AI-drafted briefs as the starting point
- Tigrinya and Oromo language support -- expanding beyond Amharic to Ethiopia's other major languages via Nova Sonic
- Offline-first mobile app -- pre-cached contract templates and voice interaction for areas with intermittent connectivity
- Government partnerships -- working with the Ethiopian Ministry of Justice to integrate LegalMindz into the SME registration pipeline
Why This Matters
| Before LegalMindz | After LegalMindz |
|---|---|
| $500+ for one contract | $5 or free |
| 3 days minimum turnaround | 30 seconds |
| English-only legal resources | Full Amharic + English |
| Urban lawyer offices only | Any device, any village, via voice |
| Reactive -- after disputes escalate | Proactive -- before you sign |
| 83% of SMEs have zero legal docs | Every business gets a contract |
| 1 lawyer per 40,000 people | 1 AI platform for 120 million people |
Try It
Live: legalmindznova.vercel.app
Guest access: Click "Continue as Guest" on the login page.
What to try:
- Draft → Select "Employment Contract" quick start → Switch language to አማርኛ → Hit Generate → Watch the four-agent pipeline stream a complete Amharic employment contract in real time
- Analyze → Click "Get started with demo contract" → Watch the streaming risk analysis with severity ratings and law citations
- Chat → Ask: "What are the mandatory clauses in an Ethiopian employment contract under Labour Proclamation 1156/2019?" → See RAG citations with relevance scores
- Voice → Tap the mic → Ask a question in English or Amharic → Hear the AI respond
- Deep Research → On the chat page, click "Try Deep Research" → Ask a complex legal question → Watch Nova Act browse Ethiopian legal databases
- Workflow → Select "Employment Law Audit" → Watch the four-agent pipeline produce a compliance report
Built With
amazon-bedrock, amazon-nova-pro, amazon-nova-sonic, amazon-nova-act, amazon-nova-embed, amazon-titan-text, framer-motion, javascript, neon-postgres, next.js, pgvector, react, shadcn-ui, tailwindcss, typescript, vercel, websockets
Team
Built by a solo developer who understands this problem firsthand - because they live in the country where it exists.
Legal protection is not a privilege. It is a right that 120 million Ethiopians have been denied by economics, geography, and scarcity.
LegalMindz exists to end that.
One platform. Eleven Amazon Nova models. 120 million people who finally have access.
Built with Amazon Nova. Built in Ethiopia. For Ethiopia. For every country where justice is priced out of reach. #AmazonNova
Built With
- amazon-web-services
- bedrock
- nextjs
- nova
Log in or sign up for Devpost to join the conversation.