CaseGraph

Inspiration

Personal injury legal research is often expensive, fragmented, and time-consuming. Relevant motor-vehicle statutes are scattered across state government websites, while many valuable legal datasets remain locked behind costly subscription platforms. Attorneys and paralegals spend significant time searching multiple sources, verifying citations, and organizing research before they can even begin analyzing a case.

We built CaseGraph to make reliable legal information easier to discover, verify, and organize. Rather than relying on closed databases or AI-generated answers without citations, we wanted every result to be backed by an official public source that users could immediately verify themselves.


What it does

CaseGraph is an AI-powered legal research and data-intelligence platform designed for personal injury attorneys and paralegals.

Its primary research interface, Specter Search, enables users to:

  • Search motor-vehicle statutes using natural language.
  • Filter statutes by U.S. state and 17 accident contributing factors.
  • Compare statutory coverage across multiple jurisdictions.
  • Open every statute directly from its official government source.
  • Save statutes, notes, and authorities into matter-specific research projects.
  • Reuse saved project materials as context for future legal research workflows.

Beyond legal search, CaseGraph includes an intelligent three-agent Negotiator pipeline that continuously expands the platform's legal knowledge base.

The pipeline consists of:

  • Gap Analyzer — identifies missing or incomplete legal-data categories.
  • Source Discovery Agent — finds organizations that publish relevant legal information while verifying their websites and contact information.
  • Outreach Agent — researches each organization and drafts personalized partnership or data-access emails.

Together, these agents create a feedback loop where CaseGraph can automatically identify missing legal information, discover trusted organizations that maintain that data, and prepare outreach needed to improve the platform's coverage.


How we built it

CaseGraph consists of two major systems: a legal research platform and an AI-powered data acquisition pipeline.

The Harvester pipeline collects statutes directly from official legislative portals, stores complete provenance information, generates semantic embeddings, and classifies every statute against a fixed 17-factor motor-vehicle taxonomy.

To provide accurate and flexible legal search, Specter Search combines multiple retrieval strategies:

  • Citation lookup
  • Keyword matching
  • Semantic similarity search
  • Optional AI-generated synthesis

Every legal record stores:

  • Statute text
  • Jurisdiction
  • Official citation
  • Contributing-factor classifications
  • Ingestion history
  • Official public source URL

This ensures every search result remains transparent, traceable, and verifiable.

The Negotiator backend was built using FastAPI, Python, and Pydantic, with structured Claude tool calls powering each AI agent. Agent progress is streamed to the frontend using Server-Sent Events (SSE), allowing users to watch each stage of the pipeline—from gap detection to source discovery and personalized outreach—execute in real time.


Challenges we ran into

One of the biggest technical challenges was normalizing statutes collected from dozens of government websites, each using different structures, formatting, and citation conventions. While standardizing the data, we also needed to preserve exact citations and official source URLs so every legal authority remained verifiable.

Another challenge involved accurately distinguishing similar legal concepts. For example, statutes concerning failure to maintain a lane and improper lane of travel often appear similar but belong to different legal categories. At the same time, many statutes legitimately apply to multiple contributing-factor categories, requiring a flexible classification pipeline.

The AI agent workflow presented another challenge. Since legal professionals depend on trustworthy information, preventing hallucinated organizations, contact details, or unsupported claims was essential. We addressed this through verified web research, structured outputs with Pydantic validation, confidence indicators, and strict provenance requirements before data enters the platform.


What we learned

Building CaseGraph taught us that trustworthy AI begins with trustworthy data.

High-quality legal search isn't just about semantic retrieval or large language models—it's about preserving provenance, validating every source, and making every answer explainable. We learned that transparency is just as important as intelligence, especially in domains where users must verify every authority they rely on.

We also learned how to combine traditional search techniques, semantic embeddings, structured databases, and AI agents into a single workflow that not only answers questions but continuously improves its own knowledge base over time.


Accomplishments that we're proud of

  • Designed a source-first legal database where unsupported records cannot be inserted.
  • Built an idempotent ingestion, embedding, and classification pipeline.
  • Created hybrid legal search across citations, keywords, semantic similarity, states, and accident contributing factors.
  • Implemented matter-based research organization with source-linked statute views.
  • Built a complete AI-powered data acquisition workflow that identifies missing information, discovers trusted organizations, and drafts personalized outreach.
  • Added live progress streaming so users can observe every stage of the multi-agent pipeline in real time.

Built With

  • React 19
  • TypeScript
  • Vite
  • Tailwind CSS
  • TanStack Router
  • TanStack Query
  • FastAPI
  • Python
  • Pydantic
  • SQLite
  • Claude API
  • Voyage AI Embeddings
  • OpenAI Embeddings
  • Semantic Search
  • Hybrid Retrieval
  • Server-Sent Events (SSE)
  • AI Agents

What's next for CaseGraph

We're expanding statute coverage across all U.S. jurisdictions while adding case law, verdicts, settlements, court rules, expert directories, and injury statistics.

Future versions will connect uploaded case documents directly to relevant authorities, automatically retrieve comparable cases, generate fully cited legal research memoranda, and provide AI-assisted litigation analysis—all while maintaining the same commitment to transparency, provenance, and verifiable legal research.

Built With

  • 19
  • ai
  • api
  • claude
  • css
  • embeddings
  • events
  • fastapi
  • hybrid
  • openai
  • pydantic
  • python
  • query
  • react
  • router
  • search
  • semantic
  • server-sent
  • sqlite
  • sse)
  • tailwind
  • tanstack
  • typescript
  • vite
  • voyage
Share this project:

Updates