LEGAL TECHNOLOGY

AI/MLAnalyticsData Engineering

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.

Abstract investigation graph with connected entities and evidence paths

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

  1. 01Open the fictional matter and choose a guided investigation question
  2. 02Review hybrid search results and the calibrated evidence/refusal state
  3. 03Traverse related entities and events in the graph and timeline
  4. 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.

System architecture showing a reviewer, synthetic discovery inputs, validation and extraction, vector and graph stores, hybrid retrieval, security boundary, observability, Render deployment, cited outputs, and the evaluation loop.
Pan to inspect the system; zoom controls are available when detail is needed.

End-to-end flow

  1. 01Deterministic synthetic corpus and gold-label generation
  2. 02Real-file ingestion for PDF, DOCX, and EML
  3. 03Entity, event, privilege, and synthetic-PII extraction
  4. 04PostgreSQL pgvector indexing and Neo4j graph loading
  5. 05Hybrid retrieval with calibrated refusal and cited evidence
  6. 06Flask investigation UI with graph, timeline, evaluation, and case brief

Technology stack

PythonFlaskLangChainsentence-transformersONNX RuntimePostgreSQL + pgvectorNeo4j AuraDBSupabasePlotly

Technology decisions

DecisionWhyAlternativeTrade-off
PostgreSQL pgvector plus Neo4jVector similarity and explicit relationship traversal serve complementary discovery questions.Vector search aloneTwo stores add operational complexity, and graph expansion requires category-level regression measurement.
ONNX Runtime on RenderFits the embedding model inside the free-tier memory envelope while preserving measured vector parity.PyTorch sentence-transformers runtimeRequires an exported model and parity testing but avoids the deployed worker's torch memory failure.

Evaluation and evidence

MetricPlain-language meaningScore / valueDataset / scenarioThreshold / baselineInterpretationEvidence
strict entity F1What strict entity F1 measures for the stated evaluation scope.0.8872,223 entity mentions in a deterministic 455-document synthetic corpus, seed 42No threshold or baseline recorded.Clean templated text materially overstates expected performance on real discovery documents.evaluation.entity-extraction
relationship hit@5What relationship hit@5 measures for the stated evaluation scope.0.83338 categorized retrieval queries over the 455-document synthetic corpusNo 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

TermPlain-language useHow this project uses it
Evaluation scoreA 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 / nullA value that was not observed or is intentionally not claimed.Rendered as “Not recorded” rather than silently converted to zero or omitted.
Special charactersSymbols such as %, currency, Unicode, and escaped input retain their source meaning.Units and encoding are explained where they affect the decision.

Data boundary

ClassificationSourcePermitted useExcluded data
syntheticRepository-generated Project Falcon synthetic legal-discovery corpus, seed 42Portfolio demonstration, deterministic evaluation, and engineering researchReal 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

ControlImplementationEvidenceLimitation
Synthetic-only public corpusThe generator creates fictional documents, people, organizations, events, identifiers, and gold labels.disclosure.synthetic-corpusSynthetic templated text is cleaner than real discovery material.
Evidence threshold and explicit refusalThe retriever returns an explicit unsupported state when the calibrated evidence threshold is not met.evaluation.hybrid-retrievalA calibrated threshold on this corpus is not a legal-correctness guarantee.
Read-only public presentationThe public application exposes the fictional matter and aggregate evidence without a real-client upload path.deployment.render-root, disclosure.synthetic-corpusThe demo has no authenticated matter isolation or production confidentiality posture.

Deployment and cost boundary

ProviderRuntimeStateExposureVerifiedProduction claim
RenderFlask + gunicorn with an ONNX embedding backendliveanonymous2026-07-23T20:52:19ZNo
ComponentBoundaryImplication
Render web serviceFree-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 AuraDBPortfolio-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

  1. Add authenticated matter isolation, role-based access, audit retention, and encrypted document storage
  2. Introduce OCR and robust parsing for scans, forwarded chains, and production document variance
  3. Move ingestion and indexing to background workers with versioned index promotion
  4. Add real-world benchmark sets under appropriate legal/data agreements and revalidate thresholds
  5. Retire free-tier keep-alive behavior under an owner-approved paid reliability envelope

All projects