OpenContracts Document Intelligence Platform
Open-source document intelligence you can build on — turn document repositories into programmable citation graphs.
Evidence shows: README explicitly states telemetry does not collect document contents, user identities, or query contents, and provides methods to disable (TELEMETRY_ENABLED=False, REACT_APP_POSTHOG_API_KEY unset), indicating data flow transparency. However, least privilege is not clearly defined for MCP endpoints; user confirmation mechanisms are not explicit; sensitive data handling is not detailed; dependency security lacks vulnerability scanning or lockfile evidence; external effects (e.g., network calls) are not specified; rollback mechanisms are not mentioned; source attribution is only via license and copyright. Thus, most criteria score low.
Evidence shows: CI workflow (backend.yml) runs lint, mypy, and pytest, with tests covering acceleration detection and benchmarking, indicating good self-consistency. Dependency availability is supported by Docker and pinned versions, but no lockfiles or image digests are provided. Failure messages are clear in tests with exit codes, but user docs lack troubleshooting. Therefore, self-consistency scores 2, dependency availability and failure messages score 2.
Evidence shows: README describes multiple use cases (legal, research, engineering) and provides API, MCP, and UI interfaces, indicating broad audience and scenarios. Capability boundaries are defined through modular components, but trigger precision (e.g., MCP tool permissions) is not explicit. Environment fit is supported by Docker deployment and hardware acceleration options, but no non-Docker deployment guide. Thus, audience and scenarios, capability boundaries, environment fit score 2, trigger precision scores 1.
Evidence shows: README provides clear information architecture with quick start, documentation links, and architecture overview. Install notes are detailed for dev and production. Naming stability is present via project name and version tags, but no API stability guarantee. Examples and FAQ: README has code examples but no FAQ. Known limitations are not explicitly listed. License is MIT with full text. Versioning changelog is not provided, but release notes exist. Maintenance responsibility is not explicit but implied via GitHub workflows and sponsor link. Thus, information architecture, install notes, examples and FAQ score 2; naming stability, known limitations, versioning changelog, maintenance responsibility score 1; license scores 3.
Evidence shows: Output usability is high with API, MCP, and UI, and output formats are clear (e.g., JSON). Marginal value is provided by unique citation graph feature, but no comparison with alternatives. Cost-benefit lacks performance benchmarks or cost analysis, but hardware acceleration options are provided. Thus, output usability and marginal value score 2, cost-benefit scores 1.
Evidence shows: Claims in README (e.g., features, performance) are supported by docs and code, but no independent verification. Cross-source corroboration is limited to tests and CI, no external validation. Fact-inference separation is present in README distinguishing product description and architecture, but inferences are not explicitly labeled. Thus, claim traceability scores 2, cross-source corroboration and fact-inference separation score 1.
- MCP endpoint permissions are not clearly defined, potentially exposing sensitive data.
- Dependency security lacks vulnerability scanning or lockfiles, posing supply chain risk.
- Telemetry claims anonymity but lacks data flow diagrams or detailed explanation.
- Rollback mechanisms are not mentioned, posing data loss risk.
What does this agent do, and when should you use it?
OpenContracts is a self-hosted, open-source document intelligence platform designed for builders and hackers. It exposes a GraphQL and REST API for applications, a Model Context Protocol (MCP) server for AI agents, and a React UI for teams, all sharing the same citation graph. The platform treats human annotation as ground truth, enabling precise, layout-faithful annotations on PDFs and text. It supports a wide range of formats, including PDF, DOCX, plain text, and 126 additional formats via Gotenberg conversion. Key features include corpus management with versioning, structured extraction with LLM-powered queries, collaborative discussions, multimodal search, and a pluggable pipeline for parsers, embedders, and thumbnailers. MIT-licensed and deployable via Docker Compose, it provides an MCP endpoint for agent discovery and interaction.
OpenContracts ingests documents into corpora, runs an intelligence bundle that describes and summarizes each document, and constructs a citation graph linking documents to cited statutes or regulations. It provides a Python API to create document- or corpus-scoped agents that stream grounded answers using annotations and citations. The MCP server exposes tools like search_corpus, list_documents, get_document_text, list_annotations, list_relationships, and create_thread_message for external agents. Structured extraction defines fieldsets (natural-language queries) that run across corpora via Celery workers, outputting results in a spreadsheet-style grid for human approve/reject. All operations are accessible via a typed GraphQL API, with REST for uploads and health checks.
- A legal team ingests SEC filings and automatically links them to the Delaware General Corporation Law, creating a navigable governance graph.
- A developer builds a custom document intelligence app, querying annotations and citations via the GraphQL API.
- An AI agent (e.g., Claude or Cursor) searches a contract corpus and retrieves grounded, cited answers via the MCP server.
- A researcher extracts indemnification clauses from hundreds of contracts into a spreadsheet for review.
- A team collaboratively annotates documents with discussions, @mentions, and voting, building a shared knowledge base.
What are this agent's strengths and limitations?
- Provides a complete citation graph substrate with traversable document and statute nodes, unlike static file storage.
- Exposes a built-in MCP server for direct agent integration, with standardized discovery and tools.
- Human annotations serve as ground truth, grounding AI-generated annotations and extractions.
- Complex architecture requiring Docker and multiple microservices (parser, embedder, etc.).
- Initial setup involves environment configuration and potential GPU optimization for performance.
- Some components like PDF parsing and embedding may depend on external services (Gotenberg) or hardware-accelerated images.
How do you install or deploy this agent?
Install via Docker: clone the repository, copy environment files (from docs/sample_env_files/), then run docker compose -f local.yml --profile fullstack up for development or docker compose -f production.yml up -d for production. Access http://localhost:3000 and log in with admin / Openc0ntracts_def@ult.
How do you use this agent?
For Python agents, use the agents module: call agents.for_document(123, corpus=45) and stream responses with agent.stream('Summarize the indemnification clauses'). Alternatively, connect agent clients to the MCP endpoint (/mcp/ or /mcp/me/) and use the listed tools. For structured extraction, define a fieldset and run it; extraction jobs are queued on Celery and results displayed in a grid for human review.