Inspiration

An AI finding is worthless in a courtroom without a chain of custody. "The model flagged it" is not admissible; provenance is. E-discovery — finding the responsive evidence buried in millions of documents — is one of the most expensive, high-stakes problems in law, and it's exactly where a black-box AI is least trusted.

We started from one conviction: metadata is not documentation — it is evidence. If an agent's memory is transactional, shared, and auditable, the investigation itself becomes defensible. So we took the real, public Enron corpus — 517,401 emails plus the company's SEC filings — sealed the list of who was actually convicted, and asked: can persistent memory turn five narrow agents into one investigator that beats any of them alone?

What it does

CRDB E-Discovery is a suite of five specialized legal agents that share ONE CockroachDB database:

  • Cold Case investigates the fraud blind — the 18 convicted persons of interest are sealed in an RBAC schema the agent physically cannot read. It independently flags 4 of them at 100% precision@3 (Skilling, Lay, Kopper, Hirko) using C-SPANN vector search plus a 363,000-edge communication graph.
  • Chronicle keeps a living theory-of-the-case timeline, LLM-extracted from the real SEC filings.
  • Witness builds an impeachment file of sworn contradictions.
  • Gap Hunter finds what's missing — withheld documents and off-channel gaps.
  • Hold Firewall is a real-time spoliation guard: when deletion scripts race an agent placing legal holds, CockroachDB's SERIALIZABLE isolation preserves every document.

The core idea is entwinement: because all five share one database, a single SQL statement assembles any person's complete case file across every agent. The signature moment — Andrew Fastow, the fraud's architect, is nearly invisible in email, so Cold Case never flags him. Yet the same query still surfaces his contradictions, timeline, and withheld documents from the other agents. No single agent solved the case; the shared memory did.

Every agent ships an objective memory ablation — the same experiment with persistent memory on vs. off — and in every case memory changes the result, not just the speed.

How we built it

  • CockroachDB Cloud is the memory fabric: distributed C-SPANN vector indexing (384-dim MiniLM embeddings across the 517K emails), a 363K-edge communication graph, SERIALIZABLE transactions, row-level security, follower reads, and multi-region geo-partitioning — all in one engine.
  • Vector + graph fusion in one SQL statement: vector-rank a seed set, graph-expand it over the communication edges, then re-rank — surfacing fraud-network figures that pure vector search ranks nowhere.
  • Fully local AI: a Qwen3-30B model via Ollama drives the agents — no cloud LLM, no data leaving the box.
  • AWS: Amazon S3 stores the corpus and per-session memory snapshots (agent-triggered ccloud backups), and hosts an always-on static mirror of the dashboard.
  • Managed MCP server lets a judge interrogate the case memory in plain English.
  • A FastAPI dashboard — ops board, suspect board, communication-network graph, and a memory-replay "time-travel" view over 31 CockroachDB→S3 snapshots — is served publicly, with static always-on mirrors on AWS S3 and Cloudflare Pages.

Challenges we ran into

  • Recall honesty. Cold Case's recall is 22% (4/18), and Fastow — the ringleader — is structurally invisible in email. Instead of hiding that, we made it the thesis: it is why you need entwined, multi-source memory.
  • Honest ablations. Two agents use a deterministic oracle detector, so we labeled those "memory-routing" ablations — the same detector in both arms, only persistence varies — rather than overclaim detection accuracy.
  • Apples-to-apples ACID. We added an explicit READ COMMITTED baseline on the same cluster: it destroys all 200 held documents; SERIALIZABLE destroys 0.
  • Entity resolution. Fastow appears as 5 separate records; we unified them into one identity (correctly excluding the decoy "Lea" Fastow) so the case file joins on a resolved person, not a raw name.
  • Multi-region without a paid cluster. We proved SURVIVE REGION FAILURE on a local, clearly-labeled simulated 3-region cluster — took the entire EU region offline and lost 0 legal holds.
  • A local 30B is best-effort under sustained load, so reproducible, deterministic pipelines remain the backbone the ledger depends on.

Accomplishments that we're proud of

  • The entwinement itself — one SQL statement, five agents, one database, surfacing a suspect no single agent could catch.
  • Ablations that change the outcome: Cold Case 4/18 vs. 0 · Chronicle converges to the truth (0.98) instead of oscillating to the wrong answer (0.42) · Witness keeps 12/12 contradictions vs. 3 · Gap Hunter 100% vs. 37% · Hold Firewall 0 documents destroyed vs. 200.
  • Database-native legal guarantees: SERIALIZABLE as a spoliation guard, RLS as an ethical wall (a reviewer physically cannot read another matter or a privileged document), geo-partitioning as GDPR data residency that survives a full regional outage.
  • Fully local, auditable AI with documented limitations — no cloud model, no hand-waving.

What we learned

  • Persistence changes outcomes, not just latency. The ablations are the proof — turn memory off and every agent's result collapses.
  • A database's native guarantees map directly onto legal requirements: SERIALIZABLE → spoliation defense, RLS → privilege walls, geo-partitioning → data sovereignty. A bolt-on vector store can't make those promises.
  • Entwining specialized agents through shared memory beats a monolith — and beats five independent agents that never talk to each other.
  • Honesty is a feature. Reporting the 22% recall ceiling and Fastow's invisibility made the entwinement argument stronger, not weaker.

What's next for CRDB E-Discovery: Five legal agents, one CockroachDB memory

  • Scale. Benchmark-scale ground truth and synthetic scale tests to show the pattern holds well beyond the illustrative sets.
  • Real multi-region in production, with a live regional failover shown in the demo.
  • More of the workflow: cross-matter isolation, additional agents, and a stronger reasoner where the local 30B hits its ceiling.
  • Attorney-in-the-loop validation on a live matter — and always-on HTTPS hosting on AWS (CloudFront) so the demo is up 24/7, independent of any one machine.

Built With

Share this project:

Updates