AbihaCodes

Junior Kamran — AI Legal Research & Drafting Assistant

A production multi-agent backend for legal research and document drafting.

$ overview

A production AI assistant built for a Karachi-based law firm, handling legal research and document drafting for a practicing advocate. Architected as a custom multi-agent backend — no LangChain, no agent framework — with a hand-built triage layer routing between a Research Agent and an 8-document-type Drafter Agent (legal notices, constitutional petitions, bail applications, and more), both grounded in real-time web search for citation verification rather than relying on model memory alone.

The UI streams live agent status to the user in real time via a custom NDJSON event protocol — showing exactly when the system is searching, reading results, or writing — instead of a static loading spinner. It also accepts photographed handwritten case notes via multimodal vision input, extracts and analyzes PDF documents, and persists full session history to a relational database.

Delivered end-to-end as a first client project: password-gated auth, full-stack deployment (Next.js 14 + FastAPI), and now on a recurring maintenance contract.

$ architecture_highlights

  • ▸Hand-built triage layer (no agent framework) routing requests between a Research Agent and a Drafter Agent
  • ▸Drafter Agent covers 8 legal document types, including notices, constitutional petitions, and bail applications
  • ▸Real-time web search grounding for citation verification instead of relying on model memory
  • ▸Custom NDJSON event protocol streams live agent status — searching, reading, writing — in place of a loading spinner
  • ▸Multimodal vision input for photographed handwritten case notes
  • ▸PDF ingestion and analysis via PyMuPDF
  • ▸Full session history persisted to a relational database
  • ▸Password-gated authentication for a private, single-client deployment

$ tech_stack

Next.js 14TypeScriptFastAPIPythonAnthropic Claude APISupabase (PostgreSQL)Tailwind CSSPyMuPDF

→ First paid client → recurring monthly contract

Private client system — the firm and advocate have asked to remain anonymous, so no live demo is available.