
Open source document intelligence. Self-hosted, AI-powered, and built for teams who need to own their data.
| Backend CI/CD | |
| Meta |
OpenContracts is an AGPL-3.0 licensed platform for document analysis, annotation, and collaboration. It combines document management with AI-powered analysis tools, discussion threads, and structured data extraction.




Browse the full documentation at jsv4.github.io/OpenContracts or in the repo:
| Guide | Description |
|---|---|
| Quick Start | Get running with Docker in minutes |
| Key Concepts | Core workflows and terminology |
| PDF Data Format | How text maps to PDF coordinates |
| LLM Framework | PydanticAI integration and agents |
| Vector Stores | Semantic search architecture |
| Pipeline Overview | Parser and embedder system |
| Custom Extractors | Build your own data extraction tasks |
| v3.0.0.b3 Release Notes | Latest features and migration guide |
OpenContracts uses a standardized format for representing text and layout on PDF pages, enabling portable annotations across tools:
The modular pipeline supports custom parsers, embedders, and thumbnail generators:
Each component inherits from a base class with a defined interface: - Parsers — Extract text and structure from documents - Embedders — Generate vector embeddings for search - Thumbnailers — Create document previews
See the pipeline documentation for details on creating custom components.
git clone https://github.com/JSv4/OpenContracts.git
cd OpenContracts
docker compose -f local.yml up
Run migrations before starting services:
# Apply database migrations
docker compose -f production.yml --profile migrate up migrate
# Start services
docker compose -f production.yml up -d
The migration service runs once to avoid race conditions and ensures all tables are created before dependent services start.
OpenContracts collects anonymous usage data to guide development priorities. We collect: - Installation events (unique installation ID) - Feature usage statistics (analyzer runs, extracts created) - Aggregate counts (documents, users, queries)
We do not collect document contents, extracted data, user identities, or query contents.
Backend telemetry (server-side events): Set TELEMETRY_ENABLED=False in your Django settings.
Frontend analytics (browser-side tracking via PostHog): Leave REACT_APP_POSTHOG_API_KEY unset or empty in frontend/public/env-config.js. The frontend also respects the browser's Do Not Track setting and requires explicit user consent before any tracking occurs.
Currently supported: - PDF (full layout and annotation support) - Text-based formats (plaintext, Markdown)
Coming soon: DOCX viewing and annotation powered by Docxodus, an open source in-browser Word document viewer. This will enable the same annotation and analysis workflows for Word documents that currently exist for PDFs.
This project builds on work from:
The data extraction grid UI draws inspiration from NLMatics' innovative approach to document querying:

AGPL-3.0 — See LICENSE for details.
$ claude mcp add OpenContracts \
-- python -m otcore.mcp_server <graph>