LegalFlow
Three legal AI workflows — client updates, billing narratives, deadline extraction
3 specialized workflows
Claude Sonnet for accuracy
Structured JSON output
No document storage
01The Problem
Most legal AI demos show a chatbot you can ask questions to. That's a feature, not a workflow. The difference matters: a workflow takes a specific input, processes it through a specialized system, and produces a specific output in the right format for downstream use — an email, a billing entry, a calendar event. I wanted to build three of these workflows for real legal use cases, demonstrating the pattern that production legal AI actually needs.
02The Approach
Three workflows on a single dark-mode UI with tab navigation. Each workflow uses Claude Sonnet with a highly specialized system prompt tuned for that task. The Deadline Extractor returns structured JSON (calendar events with date, title, description, owner, priority); the other two return structured markdown. No document storage — all context passed per-request.
03Architecture Decisions
Workflow-specific system prompts
Each workflow has a distinct system prompt optimized for its output format. The Client Update prompt instructs Claude to write like a senior lawyer emailing a client — plain English, warm tone, clear 'what's next' section. The Billing Narrative prompt uses legal billing conventions ('Attended to', 'Conducted research regarding', 'Participated in examination'). The Deadline Extractor prompt specifies an exact JSON schema and priority classification rules. A general chatbot can't reliably produce any of these; specialized prompts can.
Structured JSON for the Deadline Extractor
The Deadline Extractor returns a typed JSON object — not markdown — with priority-classified calendar events. Priority (critical/high/medium) is determined by consequence: missed hearing dates and lien deadlines are critical; response deadlines are high. The frontend parses this JSON and renders a card-based deadline list rather than raw markdown, making it integration-ready for calendar systems.
Model choice: Sonnet over Haiku
This app uses Claude Sonnet rather than Haiku. Legal content requires precision — a billing narrative that mischaracterizes work, or a missed deadline extraction, has real consequences. The accuracy premium of Sonnet is worth it here. This is the opposite decision from Pipeline Demo (which uses Haiku for cost-efficient document summarization), demonstrating intentional model selection rather than defaulting to the same model everywhere.
No SDK — raw fetch to Anthropic API
The Anthropic Node SDK has known compatibility issues with Vercel's edge runtime. Raw fetch avoids all SDK compatibility problems and makes the integration explicit: one POST to api.anthropic.com/v1/messages, parse the response, return the content. No abstraction layers, no hidden behavior.
04Key Insight
The three workflows in this app mirror real AI features that Clio shipped in early 2026: court documents → calendar events, matter activity → client updates, time entries → billing narratives. Building these independently demonstrates that the pattern is learnable and repeatable, not magic — and that the interesting engineering is in the system prompt design and output format, not in the API call itself.
05Why It Matters
The most domain-specific demo in the portfolio. Built specifically to show the exact kind of AI workflow that legal tech companies are building — and to prove that the pattern can be implemented quickly and correctly. The README explicitly names the legal AI trend it's responding to.