LEGAL TECHNOLOGY
Legal Discovery Intelligence Graph
A public synthetic-matter investigation workflow combines vector and graph retrieval, cited evidence, timelines, privilege/PII flags, calibrated refusal, and an auditable case brief.

STAKEHOLDER VIEW
What this project is for.
- Problem
- Legal discovery teams need to connect people, events, documents, and evidence without losing the source trail. This project demonstrates that workflow on a fully fictional matter: reviewers can search, traverse relationships, inspect a timeline, and open cited documents while the product clearly distinguishes evidence from generated structure.
- Intended user
- A legal-technology reviewer or discovery analyst evaluating evidence retrieval and relationship navigation.
- Decision supported
- Whether a relationship or event is supported by cited evidence in the fictional matter.
- Outcome
- A public, evidence-first Graph RAG case workspace built on a reproducible synthetic legal matter.
- What to try
- Open the fictional matter and choose a guided investigation question
- Important limitation
- Synthetic templated text is materially cleaner than real discovery data.
Investigate a relationship while retaining citations
- 01Open the fictional matter and choose a guided investigation question
- 02Review hybrid search results and the calibrated evidence/refusal state
- 03Traverse related entities and events in the graph and timeline
- 04Open cited synthetic documents and compare the result with committed evaluation
Technical reviewArchitecture, evidence, controls, deployment, and trade-offs
ARCHITECTURE
One source, one rendered system view.
A deterministic generator emits a 455-document corpus and gold labels. Offline pipelines extract entities/events, create pgvector embeddings, and load Neo4j relationships. The deployed Flask app uses an ONNX embedding backend within Render's memory limit, fuses vector and graph retrieval, applies a calibrated refusal threshold, and renders cited results, graphs, timelines, flags, and evaluation artifacts.
End-to-end flow
- 01Deterministic synthetic corpus and gold-label generation
- 02Real-file ingestion for PDF, DOCX, and EML
- 03Entity, event, privilege, and synthetic-PII extraction
- 04PostgreSQL pgvector indexing and Neo4j graph loading
- 05Hybrid retrieval with calibrated refusal and cited evidence
- 06Flask investigation UI with graph, timeline, evaluation, and case brief
Technology stack
Technology decisions
| Decision | Why | Alternative | Trade-off |
|---|---|---|---|
| PostgreSQL pgvector plus Neo4j | Vector similarity and explicit relationship traversal serve complementary discovery questions. | Vector search alone | Two stores add operational complexity, and graph expansion requires category-level regression measurement. |
| ONNX Runtime on Render | Fits the embedding model inside the free-tier memory envelope while preserving measured vector parity. | PyTorch sentence-transformers runtime | Requires an exported model and parity testing but avoids the deployed worker's torch memory failure. |
Evaluation and evidence
| Metric | Plain-language meaning | Score / value | Dataset / scenario | Threshold / baseline | Interpretation | Evidence |
|---|---|---|---|---|---|---|
| strict entity F1 | What strict entity F1 measures for the stated evaluation scope. | 0.887 | 2,223 entity mentions in a deterministic 455-document synthetic corpus, seed 42 | No threshold or baseline recorded. | Clean templated text materially overstates expected performance on real discovery documents. | evaluation.entity-extraction |
| relationship hit@5 | What relationship hit@5 measures for the stated evaluation scope. | 0.833 | 38 categorized retrieval queries over the 455-document synthetic corpus | No threshold or baseline recorded. | Graph expansion improves relationship queries but can dilute dense-corpus ranking at larger k. | evaluation.hybrid-retrieval |
These are deterministic local evaluation on a synthetic corpus plus a live reachability observation results, not a production service-level objective. Unknown values are shown as “Not recorded”; units and special characters retain their source meaning.
Technical terms and value conventions
| Term | Plain-language use | How this project uses it |
|---|---|---|
| Evaluation score | A measured result from a defined test or benchmark, not a general promise. | Read it with the dataset, scenario, and limitation shown in the evaluation table. |
| Unknown / null | A value that was not observed or is intentionally not claimed. | Rendered as “Not recorded” rather than silently converted to zero or omitted. |
| Special characters | Symbols such as %, currency, Unicode, and escaped input retain their source meaning. | Units and encoding are explained where they affect the decision. |
Data boundary
| Classification | Source | Permitted use | Excluded data |
|---|---|---|---|
| synthetic | Repository-generated Project Falcon synthetic legal-discovery corpus, seed 42 | Portfolio demonstration, deterministic evaluation, and engineering research | Real client, employee, custodian, matter, communication, and personal data; Production legal advice, privilege determinations, and discovery decisions |
All documents, people, companies, amounts, identifiers, and events are synthetic and fictional. Metrics are reproducible results on templated synthetic text and are not claims about real legal matters, privilege determinations, or production discovery performance.
Security and privacy controls
| Control | Implementation | Evidence | Limitation |
|---|---|---|---|
| Synthetic-only public corpus | The generator creates fictional documents, people, organizations, events, identifiers, and gold labels. | disclosure.synthetic-corpus | Synthetic templated text is cleaner than real discovery material. |
| Evidence threshold and explicit refusal | The retriever returns an explicit unsupported state when the calibrated evidence threshold is not met. | evaluation.hybrid-retrieval | A calibrated threshold on this corpus is not a legal-correctness guarantee. |
| Read-only public presentation | The public application exposes the fictional matter and aggregate evidence without a real-client upload path. | deployment.render-root, disclosure.synthetic-corpus | The demo has no authenticated matter isolation or production confidentiality posture. |
Deployment and cost boundary
| Provider | Runtime | State | Exposure | Verified | Production claim |
|---|---|---|---|---|---|
| Render | Flask + gunicorn with an ONNX embedding backend | live | anonymous | 2026-07-23T20:52:19Z | No |
| Component | Boundary | Implication |
|---|---|---|
| Render web service | Free-tier, memory-constrained, sleep-prone deployment using ONNX instead of PyTorch. | Cold starts and availability variation are expected; no SLO is claimed. |
| Supabase and Neo4j AuraDB | Portfolio-scale hosted data services for a synthetic corpus. | A real matter would require an owner-approved capacity, retention, and security budget. |
Known limitations
- Synthetic templated text is materially cleaner than real discovery data.
- The public demo has no real-client security or matter-isolation posture.
- Free-tier services can sleep or pause and do not establish an availability SLO.
- Privilege/PII flags are research aids, not legal or privacy determinations.
Scalability roadmap
- Add authenticated matter isolation, role-based access, audit retention, and encrypted document storage
- Introduce OCR and robust parsing for scans, forwarded chains, and production document variance
- Move ingestion and indexing to background workers with versioned index promotion
- Add real-world benchmark sets under appropriate legal/data agreements and revalidate thresholds
- Retire free-tier keep-alive behavior under an owner-approved paid reliability envelope
