CASE STUDY · MAILTRACE LEGAL
From mailbox data to
structured evidence intelligence.
MailTrace Legal is a full-stack investigation platform that turns a scoped email address or domain into a structured evidence workflow: ingesting communications, organising participants and issues, building timelines, detecting obligations, running semantic retrieval and generating reports.
THE PROBLEM
Large evidence sets become unmanageable very quickly.
The system needed to move beyond simple email search. It had to collect scoped evidence, preserve source context, identify people and issues, surface deadlines and obligations, support semantic retrieval, and generate investigation-ready outputs without losing traceability back to the source material.
INGESTION + AUTH
Secure mailbox access without storing passwords.
- Microsoft OAuth via MSAL with cookie-based application sessions.
- Microsoft Graph mailbox ingestion driven by user-defined trace scopes.
- Trace jobs track ingestion progress and persist evidence into case-scoped records.
- Mailbox, case, email and attachment models maintain ownership and evidence boundaries.
INTELLIGENCE PIPELINE
Deterministic extraction before model interpretation.
- Signals extracted from source emails before higher-level analysis.
- Issue clusters built from related evidence and procedural context.
- Obligation detection identifies expected actions, deadlines and overdue states.
- Chronology chains build linked timelines from source-backed events.
- Structured results are persisted into dedicated case intelligence tables rather than left as transient LLM output.
AI + RETRIEVAL
Two-domain search and structured model validation.
- Private
case_evidenceretrieval separated from globallegal_knowledge. - Embeddings and pgvector support semantic evidence search.
- Qwen/OpenRouter analysis pipeline combines deterministic signals, source facts and embeddings.
- Structured validation, critique and controlled repair stages reduce malformed or unsupported outputs.
- Evidence retrieval remains linked back to source material for review.
REPORTING + OPERATIONS
Async artifacts, billing and production controls.
- Background artifact jobs generate chronology, issue, ombudsman and evidence-index reports.
- Snapshot caching avoids unnecessary live recomputation of expensive case views.
- Stripe billing and download-quota enforcement are built into the backend.
- Health endpoints and environment-based configuration support Railway deployments.
- Frontend, API and evidence-retrieval surfaces are separated into deployable components.
ENGINEERING SCALE
A large multi-surface product, not a single demo.
The architecture includes dozens of backend route modules, more than one hundred API endpoints, a large relational model surface, dedicated intelligence services, case-workspace services, billing, health diagnostics, async report generation, a legacy-to-modular frontend transition, and an independent SvelteKit evidence-retrieval application.
WHAT THIS DEMONSTRATES
Full-stack AI, search, evidence and SaaS architecture.
MailTrace Legal demonstrates the ability to combine authentication, third-party APIs, evidence ingestion, vector search, deterministic intelligence, LLM pipelines, billing, async workers, reporting, frontend architecture and production deployment into one coherent product system.