Skip to content

The web edition — The Counsel

The browser face of AI Legal UK is The Counsel — a legal assistant rendered as an editorial broadsheet rather than a SaaS dashboard. No command line needed. Open it in your browser, drop in a document, and watch the panel work clause by clause via SSE streaming. It looks like a premium legal title; it is completely free and open source.

What you'll see

  • A warm-cream broadsheet — masthead, marginalia, drop-caps and Roman-numeral cells
  • Six primary navigation entries: Chambers · Review · Generate · Caselaw · Library · Docs
  • Drop a PDF, DOCX or paste text on /review; SSE streaming as the panel reasons
  • A score gauge with the Contract Safety Score (0–100) and per-clause risk pills
  • Marginalia from the Senior Counsel persona suggesting replacement language
  • One-click PDF export of any completed review for your records

Under the hood

The Counsel is a Next.js 14 App Router application. The editorial design system lives in dashboard/components/counsel/ and is shared by every page. It runs locally on your machine and supports two operating modes.

Design language

TokenValueNotes
Paper#f5f0e6Warm cream — the page itself
Ink#1a1410Headlines and body type
Accent#8b1f1fOxblood — used for italic display, drop-caps, risk underlines
Display / serifSource Serif 4Italic for titles, drop-caps and the wordmark
MonoIBM Plex MonoEditorial kickers and masthead vol. lines
SansIBM Plex SansButtons and small UI chrome

Two Modes

ModeAPI Key RequiredData SourceCost
DemoNoPre-loaded fixture dataFree
LiveYes (Anthropic or OpenAI for review analysis)Real provider-backed analysis via SSE streamingPer-token

Switch between modes using the toggle in the page header.

Pages

The editorial nav is six entries; everything else is auxiliary.

SectionPathPurpose
Chambers/chambersHome of active matters — recent activity, draft reviews, queued instruments
Review/reviewDrop a PDF / DOCX / paste text. SSE streaming as the panel works clause by clause
Generate/generateDraft NDAs, terms, privacy policies, agreements, board packs from facts
Caselaw/caselawJudgment search via the Lex Graph; opens at /judgment
Library/skillsFull register of 38 skills across 10 editorial categories
Docs/docsQuickstarts, concepts, reference, architecture, and contribution guides
Matter detail/matter/[id]Per-matter workspace — playbooks, document set, panel verdicts
Compare/compareSide-by-side contract diff with change highlighting
Legislation/legislationBrowse and search statute via legislation.gov.uk
History/historyLocal-storage review history with per-filter empty states
Pricing/pricingPlans, what's included, and the always-free open-source build
Onboarding/onboardingFirst-run walk-through for demo vs. live
Settings/settingsAPI key, mode, self-host link
The Panel/counsel/agentsAll twelve agents and their orchestration weights

Key features

  • SSE streaming for real-time analysis progress in live mode
  • PDF export from review detail and compare pages via the browser print dialog
  • Client-side persistence — reviews and settings stored in browser localStorage
  • Statute linking — citations are auto-linked to legislation.gov.uk inline
  • Demo / live mode indicator in the masthead so a sample is never confused with a live opinion

API Key Handling

Your Key Never Leaves Your Browser Unnecessarily

The dashboard server does not hold or persist any API key. The browser stores your provider key in localStorage under the key ai-legal-uk-api-key. Each request sends the key in the request body to the dashboard's own API route, which passes it directly to the selected provider adapter. The server never logs, stores, or forwards the key anywhere else.

Quick Start — hosted

The hosted edition is at the-counsel.co.uk. Sign up with email or Google, complete the brief onboarding, and you land in your Chambers with a personalised welcome and quick-instrument tiles.

Quick Start — local

bash
cd dashboard
npm install
npm run dev

Open http://localhost:3000. The dashboard starts in Demo mode by default — no API key needed to explore every feature. Authenticated routes (/chambers, /matter/*, /history, /settings, /onboarding) require Clerk env vars; without them the auth-gated pages will simply redirect to /sign-in.

For a fresh production deployment to your own domain (Vercel + Clerk + Neon + R2 + Resend), see the deployment guide.

Tech stack

  • Framework: Next.js 14 (App Router)
  • Design system: components/counsel/ — editorial broadsheet primitives (masthead, nav, marginalia, score gauges, risk pills)
  • Typography: Source Serif 4 + IBM Plex Mono + IBM Plex Sans
  • AI: provider adapters in lib/model-providers/ (Anthropic, OpenAI, OpenAI Codex CLI)
  • Document parsing: TXT, DOCX, PDF text extraction with optional OCR fallback (OpenAI / Firecrawl)
  • Auth: Clerk (@clerk/nextjs) for sign-up, sign-in, and the production session token. Email/password + Google OAuth.
  • Database: Neon Postgres via Drizzle ORM. Tables: users, matters, reviews, documents. Schema in lib/db/schema.ts.
  • Storage: Cloudflare R2 for document uploads and cached audio briefings via presigned URLs.
  • Email: Resend for the welcome dispatch (triggered by Clerk's user.created webhook at /api/webhooks/clerk).
  • Local-only state: the original demo flow still uses browser localStorage for unauthenticated users — review history, API keys, and mode toggle. Authenticated users see a server-backed view.

AI Legal UK · The Counsel — Established MMXXVI · Built for England & Wales · Not legal advice.