Model or dataset
Open-Source-Legal/OpenContracts avatar
Open-Source-Legal/OpenContracts

The citation graph OpenContracts builds, and the statutes it leaves as placeholders

The open document intelligence platform for builders and hackers - DMS for the agentic world

1,551 stars201 forksPythonMIT

At a glance

What is it?
OpenContracts is a self-hosted, MIT-licensed document intelligence platform: a citation graph exposed through a GraphQL and REST API, an MCP server and a React UI. The corpus build is shown in a recorded clip, and the citations the library cannot resolve stay as backlog nodes.
Who is it for?
OpenContracts is worth evaluating for a legal or compliance team that already holds a document corpus and needs the citation edges, because the graph, the MCP server and the fieldset extraction are the parts carrying real work.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • Open-Source-Legal/OpenContracts1,551 ★ · +79
Star history
Repository2026-09-102026-11-22
Open-Source-Legal/OpenContracts1.5k1.6k

79 Stars in the last 73 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Set up wires 36 SEC filings to Delaware law in a recorded clip

Create a corpus, drop in documents, click Set up. That one click installs what the project calls the intelligence bundle: agents describe and summarize every document, and the reference web starts weaving itself, with each statutory citation detected, resolved, and drawn as an edge. The worked example in the README is 36 SEC filings, and by the end of the recording those filings are a navigable graph, wired section by section to the Delaware General Corporation Law, the Securities Act, and the SEC rules they cite.

Two things about that sequence deserve a second look. The first is the timing. The section heading promises documents to citation graph in about a minute, and that minute belongs to a screen recording of the stock product against a local install with no custom code. No figure for documents per minute appears anywhere in the project, the only corpus size given is 36, and there is no worker count or hardware description attached to the claim. The clip demonstrates SEC filings resolving into federal corporate law. It does not measure ingestion.

The second is that the only runnable snippet in the README does not touch the clip's corpus. It names a document id of 123 and a corpus id of 45, two placeholder integers attached to no dataset a reader could assemble.

Cites the library does not hold become dashed nodes with nothing behind them

Not every citation can be resolved at ingest, and the project is explicit about it. Law the library does not hold yet is not dropped on the floor; it is tracked as a backlog automatically, until it is ingested. In the frozen artifact the README points to, those unresolved references are drawn as dashed nodes, edges reaching a body of law the system knows exists but cannot yet quote.

That choice has consequences to plan around. An edge exists before the cited text does, so edge counts, backlink counts and anything else computed over the reference web will count references to documents nobody can read through the product. The click-through path belongs to cites that resolve: the References panel lists what a document cites, and clicking a cite opens the statute with its own cross-references and everything that cites it back. A dashed node offers none of that.

The v3.0.0 release, published 2026-08-10, is titled Corpus Intelligence, Authority Linking and Deep Research, and the repository tree carries a test.authority-e2e.yml workflow, so authority handling has automated coverage. What the README does not spell out is how a backlog item is promoted to an ingested statute, or who clears the queue.

The MCP endpoint serves public corpuses anonymously and one of its seven tools writes

Every corpus is exposed over the Model Context Protocol, so Claude, Cursor or any other MCP client can search it, walk its citation edges and, when authorized, propose annotations of its own. The endpoint layout is the part to read twice. There are two paths: /mcp/ is anonymous and covers public corpuses, while /mcp/me/ is the authenticated one. Discovery runs through /llms.txt and /.well-known/mcp.json, both reachable without credentials.

Seven tools are named: search_corpus, list_documents, get_document_text, list_annotations, list_relationships, list_threads, create_thread_message. Six read. The seventh, create_thread_message, writes into the same namespace the other six read from, and get_document_text returns the full text of a document rather than a summary or an excerpt.

Two gaps follow from the project's own wording. The prose says an authorized client can propose annotations, yet no annotation-creation tool appears in the list, so proposals must arrive through the GraphQL or REST path instead, or the enumeration is incomplete. And nothing states what makes a corpus public, who can change that flag, or whether public means readable by any unauthenticated MCP host on the internet.

Agent answers are grounded in annotations the team already built

Two surfaces run agents: a corpus-scoped ask bar in the UI, and a Python client. The claim attached to both is that answers come back grounded and cited. The Python guide makes the dependency explicit, saying every answer is grounded in the annotations and citations your team has built. Grounding here is not a property of the model or of the extractor. It is a property of the annotation layer, which is human work.

The Set up path blurs that line. There, agents describe and summarize every document themselves, so machine-written text enters the corpus at ingest. Human annotation is the other stream, and the two are never described as equivalent. The evidence an answer draws on is enumerable from the client side, since list_annotations and list_relationships are exposed as tools. Nothing states that a citation is mandatory on every answer, or what an agent returns when the annotations behind a corpus are still empty.

python
agent = await agents.for_document(123, corpus=45)
async for chunk in agent.stream("Summarize the indemnification clauses"):
    print(chunk.content, end="")

The snippet is short because the surface is small: scope to a document and a corpus, then stream chunks or take a typed object back through Pydantic. It is also the only executable example in the document, and both of its ids are placeholders.

A fieldset fans out over Celery workers and stops at a human on every cell

Structured extraction is the part designed for volume. A fieldset is a set of columns, each column a natural-language query. Running one across an entire corpus fans out over Celery workers and lands in a spreadsheet-style grid, hundreds of documents at a time, with human approve and reject on every cell.

The scale claim and the approval gate sit in tension, and the README does not resolve them. There is no worker count, no queue configuration, no batch size and no timing for the extraction path. The one number nearby, hundreds of documents at a time, sits next to a requirement that a person touch every cell, so the cost of a run scales with documents multiplied by columns, with a human decision as the unit. The about-a-minute figure belongs to the graph build in the demo, not to extraction.

Where the worker pool gets configured is not explained in prose. The repository root holds local.yml and production.yml, a compose directory and an .envs directory, so a Celery and database deployment is at least sketched in file names. The README gives no compose command and no environment variable list to go with them.

Self-hosted is the pitch, and the self-hosting steps are not in the README

The project calls itself self-hosted and MIT-licensed, with a hosted demo at contracts.opensource.legal for comparison. In the README as published there is no installation command at all: no clone step, no compose invocation, no package install, no environment variable table. The only fenced example in the document is the three-line Python agent call. A reader who wants to run this against their own documents is pointed at a demo and at a documentation tree, not at a sequence of commands.

The root of the repository does hint at the shape of a deployment. local.yml and production.yml sit beside a compose directory, an .envs directory, a .dockerignore and a script named merge_production_dotenvs_in_dotenv.py. That last file is a small warning sign: a merge step exists because environment files are expected to differ per deployment. manage.py at the root and a schema.graphql checked into the tree both point to a Django service with a generated API surface, and cloudflare-og-worker indicates that link previews depend on a Cloudflare Worker, which is one more service to account for in a private install.

The four documentation paths the README links to are the rest of the handoff: an LLM framework guide, MCP documentation, a page on writing your own extractors, and a pipeline overview. None of them is named in the root file listing, so the operational details live one level down from a homepage rather than beside the install steps the page advertises.

The pipeline is swappable by registration, with no compatibility contract stated

Parsing, embedding and thumbnailing are swappable components. Register a custom parser, embedder or thumbnailer for a format the project does not handle, and everything downstream, meaning search, annotation and agents, keeps working unchanged. That is a strong promise stated in one sentence, and the sentence is all there is. No interface signature, no versioning rule for the built-in components, no statement about what happens to documents already embedded by the previous embedder.

The wider surface claim has the same shape. The README says every surface the UI touches is also reachable over the API and MCP server. Counting what is actually named, the MCP tool list covers seven operations, while the GraphQL layer is described as exposing the whole graph of corpuses, documents, annotations, relationships and extracts, with REST reserved for uploads and health checks. Sets like extracts have no MCP counterpart named, and REST is explicitly not a general query surface, so the equivalence holds for the listed tools and stops there.

Thumbnailing sits in the same category. It is listed as one of three swappable stages, yet it is the only one of the three with no visible artifact type in the root tree, no configuration key and no named output. A custom thumbnailer can be registered; where its output is expected to land is left to the pipeline overview.

The case for the product stops one clause short of its strongest claim

The closing section argues that most repositories store files rather than the graph that connects them, that a PDF in a folder is a leaf with no edges, and that the closed citators, named as Westlaw, Lexis and JSTOR, keep that graph shut. Then the argument reaches its sharpest point and stops: an agent reading a document with no citation graph hallucinates. The sentence ends there, with nothing after it.

What sits on either side of that gap is worth measuring. The competitors named are closed commercial research databases, so the project has positioned itself against paywalled tools rather than against the open-source document pipelines a reader would actually compare it to. There is no benchmark, no ingestion figure and no comparison of any kind in the repository, and 1492 stars with 191 forks and 15 open issues is the extent of the public signal.

The release record tells a different story from the unfinished page. v3.0.0 landed 2026-08-10, v3.1.0 on 2026-09-08 and v3.1.1 on 2026-09-10, with the last push on 2026-09-29. Three tags in a month, two of them point releases days apart, on a project whose README still ends mid-argument.

Editorial conclusion

OpenContracts is worth evaluating for a legal or compliance team that already holds a document corpus and needs the citation edges, because the graph, the MCP server and the fieldset extraction are the parts carrying real work. Before committing, check three things against your own holdings: whether the statutes and rules your documents cite are actually present in the library, since everything else becomes a backlog node; what makes a corpus public, because /mcp/ serves it without a token; and whether the annotation layer is staffed, because grounding is a function of annotation volume rather than of the model. For anyone shopping on measured ingestion throughput, the repository does not offer it, and the demo clip is not a substitute for a benchmark.

Frequently asked questions

What is OpenContracts?

OpenContracts is a self-hosted, MIT-licensed document intelligence platform written in Python that turns a repository of documents into a programmable citation graph. That graph is exposed through a GraphQL and REST API, a Model Context Protocol server, and a React UI over the same data.

What is meant by open contract, and is that what OpenContracts does?

No. The repository does not define open contract as a contract type or as an employment status. Its unit of work is the document: corpuses hold documents, documents carry annotations and relationships, and citations between documents become the edges of a graph.

Is OpenContracts aimed at military or government contracting?

The project says nothing about military contracting. Its one worked example is a corpus of 36 SEC filings wired to the Delaware General Corporation Law, the Securities Act and the SEC rules they cite.

What are the four types of contracts in OpenContracts?

The project ships no contract type taxonomy. The GraphQL graph is described in terms of corpuses, documents, annotations, relationships and extracts, and a fieldset is defined as a set of columns where each column is a natural-language query rather than a document class.

What does an open term contract mean here, and can agents read clause text?

The phrase has no definition in this repository. What exists is document text: get_document_text is one of the seven MCP tools, and the agent example in the README asks a document-scoped agent to summarize the indemnification clauses.

Does OpenContracts need human approval before a citation edge is usable?

Not for edges. Approve and reject appear on every cell of a fieldset extraction, while the Set up path resolves citations into edges with no documented approval step, and cites the library cannot resolve are tracked as a backlog instead.

Official sources

  1. License: MIT
  2. Open-Source-Legal/OpenContracts on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/open-source-legal-opencontracts.svg)](https://hysenlabs.com/projects/open-source-legal-opencontracts)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/open-source-legal-opencontracts.svg)](https://hysenlabs.com/projects/open-source-legal-opencontracts)

Was this useful?