Architecture
System architecture
A living loop. OpenLegal watches a local case repository, turns files into structured intelligence, researches authority, produces strategy — and routes every consequential step through a human gate with a full audit trail.
The loop
Watch & bootstrap
A watcher detects new and changed matter files and bootstraps them into the intelligence ledger.
Every change is an event
Matters emit idempotent, serializable realtime events — each carrying a provenance record — that trigger the next stage.
Classify & connect
Extraction produces legal issues, entities, facts, and epistemic status; knowledge fabric keeps them connected and current.
Plan work
Case intelligence, research planning, and a decision engine convert gaps into research work items.
Authority with provenance
Research consults an authority store; gaps, risks, and opportunities are surfaced with source provenance.
Debate, then plan
Specialist roles debate and red-team; a strategy engine produces options, war games, and contingencies.
You decide
Approvals, drafts, and pause/resume are surfaced through the operations layer. Nothing proceeds unapproved.
Proven, then repeat
Hash-only invocation audit plus checkpoint memory close the loop: observe → act → learn → re-observe.
Operator surfaces
Three interfaces, one system. They share the same ledger, governance, and audit chain.
CLI
openlegal provides 12 commands covering health, diagnostics, status, analysis, audit, privacy, models, and the engine itself.
API + Browser
A FastAPI application exposes 150+ routes for status, intelligence, research, council, strategy, living systems, and agents.
Browser UITUI
An interactive operations console for live monitoring. Present in the codebase; interactive session coverage is still being automated.
TUIResilience
| Property | Behavior |
|---|---|
| Idempotent events | Re-applying an event yields the same state — no double counting, no drift. |
| Deterministic reruns | Re-running a synthetic workflow reproduces the same result. |
| Recovery | Kill-and-restart resumes a healthy system; the loop re-initializes from the ledger. |
| Fail-closed routing | Unknown model providers are blocked, never silently bypassed. |
| Honest status | Diagnostics report verified, partial, and blocked states without fabrication. |
Boundaries
OpenLegal is a legal-intelligence operating system — it is not a lawyer and takes no irreversible action autonomously. The public website documents the product; the application runs locally; case data stays in the operator’s own repository.