OpenContracts

Open-Source-Legal/OpenContracts

Open-source document intelligence platform for scalable document management and AI-driven insights.

1.4k
Stars
166
Forks
18
Open issues
5
Watchers
Python MITLast pushed Jul 7, 2026

Overview

OpenContracts is an open-source document intelligence solution that converts unstructured documents into a programmable citation graph. It supports human annotation, structured extraction, AI agents, and comes with a built-in MCP server accessible via a single API. The platform is self-hosted and MIT-licensed, designed for teams operating at scale.

Categories

Tags

Similar tools

Install

pip install OpenContracts

README

OpenContracts (Demo)

Open-source document intelligence you can build on.

Point OpenContracts at a repository of documents and get a programmable citation graph — human annotation, structured extraction, AI agents, and a built-in MCP server, all behind one API. Self-hosted, MIT-licensed, and built for teams working at scale.

Same graph, three surfaces: a GraphQL + REST API for your apps, a Model Context Protocol server for your agents, and a React UI for your team.

Backend coverage
Frontend coverage
Meta

From documents to a citation graph — in about a minute

Create a corpus, drop in your documents, and click Set up. That one click installs the intelligence bundle: agents describe and summarize every document, and the reference web starts weaving — every statutory citation detected, resolved, and drawn as an edge.

By the end of the clip, 36 SEC filings are a navigable graph — wired to the Delaware General Corporation Law, the Securities Act, and the SEC rules they cite, section by section. Law the library doesn't hold yet isn't dropped on the floor: it's tracked as a backlog, automatically, until you ingest it.

Then explore it — and ask it questions

Citations are highlighted inline on the filings themselves. The References panel lists everything a document cites — click any cite to open the statute, with its own cross-references and everything that cites it back. The ask bar runs a corpus-scoped agent whose answers come back grounded and cited.

Everything in both clips is the stock product against a local install — no custom code, and every surface the UI touches is also reachable over the API and MCP server below.

Here's the artifact those clips produce, frozen so you can read it — every filing wired to the exact section of law it cites, with bodies of law the library doesn't hold yet drawn as dashed nodes, tracked until you ingest them:


Build on it

OpenContracts is a platform, not a black box. Everything the UI does runs on surfaces you can call yourself — point it at the documents you already have and build your own tooling on top.

AI agents in Python

Spin up a document- or corpus-scoped agent in a couple of lines. Stream a chat response, or get a typed object back through a Pydantic model — every answer grounded in the annotations and citations your team has built.

agent = await agents.for_document(123, corpus=45)
async for chunk in agent.stream("Summ