Skip to content

bem-team/docket

Repository files navigation

Docket

The building blocks of legal AI. Docket turns a Supreme Court opinion into a structured, navigable case: the full text, an interactive knowledge graph of the parties, precedents, and authorities, and an AI agent that answers questions with citations, reading only the sections it needs.

Live demo: docket.bem.devTrump v. Barbara (No. 25-365).

Docket is a working, open-source proof of how quickly you can build a real legal AI product on bem. Everything you see, the structured opinion, the entity map, and the agent, is powered by bem.

How it was built

  1. Parse. bem turns the slip opinion into clean, labeled sections and a typed entity graph (justices, opinions, precedents, statutes, holdings), each with evidence and page numbers.
  2. Persist. The results land in a bem bucket, assigned at the time of the call.
  3. Retrieve. The agent reaches the opinion through bem's file system. It lists, searches, and reads only the sections a question touches, instead of stuffing the whole opinion into context on every turn. That efficiency is the live cost meter in the chat.
  4. Answer. Grounded, cited responses, with the full structure and graph available to the reader the whole time.

Stack

  • Next.js (App Router) + React + TypeScript
  • Vercel AI SDK for the streaming agent and tool calls
  • bem for parsing, the knowledge graph, and the file-system retrieval surface
  • Deployed on Vercel

Run locally

npm install
cp .env.example .env.local   # add your keys
npm run dev

See .env.example for the environment variables. The app ships with the parsed opinion bundled in data/, so it runs with zero backend config; point it at a live bem bucket to use your own documents.

Deploy

One click on Vercel, or:

npm run build
vercel --prod

License

MIT

About

The building blocks of legal AI. A structured legal-research demo on bem: opinion reader, entity knowledge graph, and a citation agent. Live at docket.bem.dev

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors