DEV.co
Vector Databases · Open-Source-Legal

OpenContracts

OpenContracts is an open-source document intelligence platform that automatically extracts citations, builds knowledge graphs from document repositories, and exposes them via API, GraphQL, and Model Context Protocol for AI agents. It combines human annotation, structured data extraction, and agent-driven analysis in a self-hosted, MIT-licensed system designed for teams managing large document collections.

Source: GitHub — github.com/Open-Source-Legal/OpenContracts
1.4k
GitHub stars
165
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryOpen-Source-Legal/OpenContracts
OwnerOpen-Source-Legal
Primary languagePython
LicenseMIT — OSI-approved
Stars1.4k
Forks165
Open issues16
Latest releasev3.0.0.b4 (2026-02-08)
Last updated2026-07-08
Sourcehttps://github.com/Open-Source-Legal/OpenContracts

What OpenContracts is

Python-based document processing platform with GraphQL/REST APIs, Celery-backed extraction pipelines, pluggable parsers and embedders, vector database integration, and MCP server support. Features citation graph construction, agent orchestration via LLM framework, and React UI frontend—all queryable through a unified graph data model with human annotation workflows.

Quickstart

Get the OpenContracts source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/Open-Source-Legal/OpenContracts.gitcd OpenContracts# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Legal/Regulatory Document Analysis

Ingest contracts, statutes, and SEC filings; automatically resolve statutory citations and build traversable citation graphs to surface relationships between legal documents and their governing law.

Enterprise Knowledge Graph Construction

Extract structured data from internal policy documents, standards, research archives, or technical specifications; enable AI agents and teams to query cross-document relationships and enforce consistency at scale.

AI Agent Ground Truth Infrastructure

Provide agents (Claude, Cursor, or custom) with MCP endpoints to search corpora, walk citation edges, and ground responses in human-validated annotations—reducing hallucination in document-heavy workflows.

Implementation considerations

  • Requires backend infrastructure (PostgreSQL or compatible DB, vector database, Celery broker, optional S3/cloud storage for documents); deployment via Docker or from-source setup needed.
  • Citation resolution depends on configured reference libraries; unresolved citations tracked as backlog. Completeness of knowledge graph scales with ingestible source material and custom parser registration.
  • Structured extraction (fieldsets) requires natural-language column definitions and scales horizontally via Celery workers; approval workflows are human-in-the-loop and not automated.
  • LLM agent integration (streaming chat, Pydantic-typed responses) requires external LLM API keys (not bundled). MCP server exposes public/authenticated endpoints; authorization model should be reviewed before production multi-tenant use.
  • Latest release is v3.0.0.b4 (beta, 8 Feb 2026). Active development with recent pushes; stability/breaking-change risk in pre-1.0 versions requires testing and change-log review.

When to avoid it — and what to weigh

  • Real-time or Low-latency Requirements — Extraction and citation resolution run async via Celery workers. Unsuitable for systems requiring immediate citation indexing or sub-second query response times.
  • Minimal Infrastructure Footprint — Self-hosted deployment requires database, vector store, background workers, and reverse proxy. No lightweight serverless option available; not suitable for single-machine or cost-constrained deployments.
  • Closed-Source or Proprietary Compliance — MIT license permits commercial use but requires source disclosure and license preservation. If proprietary binaries or hidden code modifications are mandated by policy, requires legal review.
  • Non-English or Complex Multi-Language Workflows — Documentation and examples focus on English; multilingual citation resolution, parsing, and NLP pipelines not explicitly addressed. May require custom embedder/parser components.

License & commercial use

MIT License (Massachusetts Institute of Technology). Permissive OSI-approved license allowing commercial use, modification, and distribution with only requirement: license and copyright notice preservation in source and binary distributions.

MIT license explicitly permits commercial use without royalties. However, source code must be retained and license notice must be included in any distribution (internal or external). If closed-source deployment or proprietary modifications are required, conduct legal review before use. No commercial support, warranty, or indemnity provided by the project.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityHigh
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No security audit, penetration test, or threat model mentioned. MCP server supports public/authenticated endpoints—authorization model and authentication mechanisms require review before exposing corpora over network. Vector database and Celery broker should be isolated from untrusted networks. Sensitive document handling (PII, confidential contracts) requires encryption at rest and in transit; no mention of built-in encryption or compliance features. Data retention and deletion policies not stated.

Alternatives to consider

Westlaw / LexisNexis

Proprietary, mature legal citation indexing with closed graph. High cost, no API-first design. Use if proprietary liability protection and white-glove support are non-negotiable.

LlamaIndex / LangChain RAG frameworks

General-purpose LLM document indexing; no citation graph, annotation, or multi-user workflows. Lighter-weight, less opinionated. Use for simpler retrieval pipelines without graph relationships.

Documentation / VectorShift

Managed document intelligence platforms with lower ops burden. Closed-source, API-first, proprietary data. Use if avoiding self-hosting and full source transparency are priorities.

Software development agency

Build on OpenContracts with DEV.co software developers

Assess infrastructure requirements, security posture, and integration approach. Schedule a technical review with our team to determine fit for your legal, regulatory, or knowledge management use case.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

OpenContracts FAQ

Does OpenContracts include LLM models or API keys?
No. Agent and extraction features require external LLM providers (OpenAI, Anthropic, etc.). API keys must be configured separately; no models are bundled.
Can I use OpenContracts in a multi-tenant SaaS application?
Technically yes, but authorization/isolation model and multi-tenancy security are not detailed in the excerpt. Requires security review before exposing customer data.
What formats does OpenContracts parse out-of-the-box?
Not explicitly listed in the excerpt. Documentation mentions pluggable parsers; default support (PDF, DOCX, etc.) should be confirmed in deployment docs.
Is there a managed/hosted version of OpenContracts?
No. Project is self-hosted only. A public demo is available at contracts.opensource.legal for evaluation, but production requires your own infrastructure.

Custom software development services

DEV.co helps companies turn open-source tools like OpenContracts into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your vector databases stack.

Evaluate OpenContracts for Your Document Workflow

Assess infrastructure requirements, security posture, and integration approach. Schedule a technical review with our team to determine fit for your legal, regulatory, or knowledge management use case.