Open Contracts (Demo)
Backend CI/CD | |
Meta |
OpenContracts is an Apache-2 Licensed enterprise document analytics tool. It supports multiple formats - including PDF and txt-based formats (with more on the way). It also supports multiple document ingestion pipelines with a pluggable architecture designed to make supporting new formats and ingestion engines easy - see our Docling Integration for an example. Writing your own custom document analytics tools where the results get displayed beautifully over the original document is easy. We also support mass document data extraction with a LlamaIndex wrapper.
Timeline | Milestone | Description |
---|---|---|
π January 2025 | Document Format Expansion |
|
π February 2025 | Benchmarking Suite |
|
π March 2025 | Extract Enhancement |
|
π April 2025 | Streaming & Filtering |
|
π May 2025 | Government Data Integration |
|
ποΈ Summer 2025 | Enterprise DMS Features |
|
π‘ This roadmap represents our current plans and is subject to change based on community feedback and evolving requirements.
OpenContracts provides several key features:
- Manage Documents - Manage document collections (
Corpuses
) - Layout Parser - Automatically extracts layout features from PDFs
- Automatic Vector Embeddings - generated for uploaded PDFs and extracted layout blocks
- Pluggable microservice analyzer architecture - to let you analyze documents and automatically annotate them
- Pluggable Parsing Pipelines - to let you support new document formats and ingestion engines.
- Human Annotation Interface - to manually annotated documents, including multi-page annotations.
- LlamaIndex Integration - Use our vector stores (powered by pgvector) and any manual or automatically annotated features to let an LLM intelligently answer questions.
- Data Extract - ask multiple questions across hundreds of documents using complex LLM-powered querying behavior. Our sample implementation uses LlamaIndex + Marvin.
- Custom Data Extract - Custom data extract pipelines can be used on the frontend to query documents in bulk.
We recommend you browse our docs via our Mkdocs Site. You can also view the docs in the repo:
- Quickstart Guide - You'll probably want to get started quickly. Setting up locally should be pretty painless if you're already running Docker.
- Basic Walkthrough - Check out the walkthrough to step through basic usage of the application for document and annotation management.
- PDF Annotation Data Format Overview - You may be interested how we map text to PDFs visually and the underlying data format we're using.
- Django + Pgvector Powered Hybrid Vector Database We've used the latest open source tooling for vector storage in postgres to make it almost trivially easy to combine structured metadata and vector embeddings with an API-powered application.
- LlamaIndex Integration Walkthrough - We wrote a wrapper for our backend database and vector store to make it simple to load our parsed annotations, embeddings and text into LlamaIndex. Even better, if you have additional annotations in the document, the LLM can access those too.
- Write Custom Data Extractors - Custom data extract tasks (which can use LlamaIndex or can be totally bespoke) are automatically loaded and displayed on the frontend to let user's select how to ask questions and extract data from documents.
The core idea here - besides providing a platform to analyze contracts - is an open and standardized architecture that makes data extremely portable. Powering this is a set of data standards to describe the text and layout blocks on a PDF page:
OpenContracts features a powerful, modular pipeline system for processing documents. The architecture supports easy creation and integration of custom parsers, embedders, and thumbnail generators:
Each pipeline component inherits from a base class that defines a clear interface:
- Parsers: Extract text and structure from documents
- Embedders: Generate vector embeddings for semantic search
- Thumbnailers: Create visual previews of documents
Learn more about:
The modular design makes it easy to add custom processors - just inherit from the appropriate base class and implement the required methods. See our pipeline documentation for details on creating your own components.
At the moment, we only support PDF and text-based formats (like plaintext and MD). With our new parsing pipeline, we can easily support other ooxml office formats like docx and xlsx, HOWEVER, open source viewers and editors are a rarity. One possible route is to leverage the many ooxml --> MD tools that now exist. This will be a reasonably good solution for the majority of documents once we add a markdown viewer and annotator (see our roadmap).
Special thanks to AllenAI's PAWLS project and Nlmatics nlm-ingestor. They've pioneered a number of features and flows, and we are using their code in some parts of the application.
NLmatics was also the creator of and inspiration for our data extract grid and parsing pipeline UI/UX:
The company was ahead of its time, and, while the product is no longer available, OpenContracts aims to take some of its best and most innovative features and make them open source and available to the masses!