The Open-Source Legal OS
One legal OS to draft, review, and take command of every contract.
Host it yourself, or have FuturixAI run it for you.
Product site · Features · Quick start · Architecture · Deployment · Enterprise
Prism is an open-source contract litigation management system for drafting, reviewing, sharing, and managing legal work. Luna is the AI assistant inside Prism. The browser application uses React and Vite. The API uses Express, Better Auth, PostgreSQL, and Drizzle ORM.
Legal work is still too fragmented. Teams draft documents, review contracts, compare versions, check compliance, and manage negotiations across different tools. Prism brings that work together in one connected workspace.
Product screenshots from the Prism Legal OS site.
Review documents, work together, and keep every clause in context.
Research, draft, and refine legal documents with your AI assistant.
Compare documents side by side and bring the details that matter into view.
Analyze legal documents with speed and precision. Extract clauses, obligations, risks, key entities, and critical information from contracts, policies, and legal documents in seconds.
Draft faster. Check smarter. Work better. Start with a template or a request to Luna, bring your documents into a shared workspace, and move drafts through review and approval. Explore the feature guide for workflows, examples, and setup requirements.
| Feature | What you can do |
|---|---|
| Shared legal workspaces | Bring primary and supporting documents into a shared legal workspace. Organize agreements, versions, and collaborators with role-based access. |
| AI-powered drafting and document assistance | Research, draft, and refine legal documents with Luna. Ask questions about your files and inspect supporting source references. |
| 61 contract and legal-document templates | Start with a legal template and refine your draft with Luna. Use 54 Word and seven HTML templates with guided fields. |
| Multi-document tabular review | Extract and compare key terms across multiple documents in a configurable review table. |
| AI-assisted contract review | Identify legal risks before they become problems. Spot missing clauses, compliance gaps, conflicting terms, and potential risks with supporting context. |
| Custom review playbooks | Check contracts against your team's review playbooks. Keep review criteria consistent across matters. |
| Document editing and version history | Edit clauses, resolve comments, and keep a history of every version. Export Word or PDF documents ready for the next step. |
| Collaborative review and approvals | Bring the whole team into the conversation. Discuss clauses, share feedback, resolve comments, and approve or reject drafts with activity history. |
All your legal work, one connected workspace:
- Organize. Bring primary and supporting documents into a shared legal workspace.
- Research. Explore your sources with AI-assisted answers and supporting references.
- Draft. Start with a legal template and refine your draft with Luna.
- Analyze. Extract and compare key terms across multiple documents.
- Review. Check contracts against your team's review playbooks.
- Refine. Edit clauses, resolve comments, and keep a history of every version.
- Approve. Bring your team together to review and approve the final draft.
- Export. Export your document in Word or PDF, ready for the next step.
AI features require a configured provider. Indexed source retrieval also requires Qdrant and an OpenAI key, and background analysis requires the worker. Each feature guide explains its prerequisites. AI output and templates need qualified legal review before use.
Important
Deploy on your terms
Self-hosted: your infrastructure, your control. Get the source, customize Prism, and run it wherever you choose. Managed by FuturixAI: we deploy, maintain, and run Prism for your team. You focus on legal work.
For private infrastructure, custom integrations, migration support, or managed rollouts, contact connect@futurixai.com.
The repository has three application processes and two data services:
frontend/contains the React 19 and Vite 8 single-page application.backend/src/index.tsstarts the Express API.backend/src/worker.tsprocesses PostgreSQL-backed jobs and email outbox events.- PostgreSQL 16 stores application data, Better Auth records, queues, and outbox events.
- Qdrant stores the document search index.
The shared event contract lives in packages/protocol/. Uploaded and generated files live in an S3-compatible object store. Compose runs MinIO for it, and host development can use local files.
Install Docker Engine with Docker Compose. You need a Resend API key for sign-in email. An OpenAI API key enables Luna and document search.
git clone https://github.com/FuturixAI-and-Quantum-Works/Prism.gitRun the remaining commands from the new Prism directory.
cp .env.example .envSet RESEND_API_KEY and OPENAI_API_KEY in .env, then start Prism.
docker compose up -dOpen http://localhost:8080 and sign in with your email address. The six-digit sign-in code arrives by email through Resend.
The default sender, onboarding@resend.dev, delivers only to the email address of your Resend account. To invite other people, set MAIL_FROM in .env to an address on a domain you have verified in Resend, then run docker compose up -d again.
Compose starts PostgreSQL, Qdrant, MinIO, the API, the worker, and the frontend. MinIO stores uploaded and generated files in the prism bucket, which Compose creates on first start. The backend container runs migrations automatically before it starts the API. It also seeds approval policies, workflows, the AI model catalog, and all 61 bundled templates. Prism generates its application secrets on first start and keeps them in the prism_secrets volume.
The API listens on http://localhost:8003, with API documentation at http://localhost:8003/api-docs. To grant an existing account the global administrator role, run:
docker compose exec backend node dist/scripts/seedAdmin.js --email admin@example.comStop Prism without deleting data:
docker compose downAdding -v deletes the database, stored files, search index, and generated secrets.
Install Node.js 22.x, npm 11.19.0, and Docker Engine with Docker Compose. Install LibreOffice if you need DOC or DOCX to PDF conversion. Puppeteer installs its Chromium build with the normal dependency install.
Complete the .env step from the quick start, then run:
npm ci
docker compose up -d postgres qdrant
cp backend/.env.example backend/.env
npm run setup --workspace @prism/backend
npm run devsetup builds the backend, applies migrations, and runs every seed. Rerun it after you pull new migrations. The backend generates its secrets into backend/.secrets.env on first start.
Open http://localhost:5173. The API listens on http://localhost:3001. The worker does not open a network port.
The baseline at backend/drizzle/0000_prism_baseline.sql is for a new database. Do not apply it over a private database created before the baseline. Use the pre-baseline database migration guide.
- Luna uses the server OpenAI connection when
OPENAI_API_KEYis set. Users can add their own Anthropic, Google, OpenAI, and OpenAI-compatible connections under Settings > AI settings. - Document search needs Qdrant and
OPENAI_API_KEY. Compose runs Qdrant for you. Without both, uploads still work, but source indexing and source-backed search do not. - Storage uses MinIO under Compose and the local filesystem for host development. Production requires S3-compatible storage and rejects local storage.
- Without
RESEND_API_KEY, mail records delivery as suppressed and does not expose email contents or sign-in codes. - DOC and DOCX conversion uses LibreOffice. HTML to PDF conversion uses Puppeteer Chromium.
- The worker handles document indexing, compliance runs, tabular generation, email delivery, health checks, and storage reconciliation.
Read provider setup and deployment operations for the complete configuration.
Run the documentation check first.
node scripts/check-docs.mjsRun the publication blocker scan.
npm run check:publicationRun the full local CI sequence.
npm run ciThe full sequence verifies the publication rules, authentication migration guard, database baseline, seed data, formatting, lint, types, unit and security tests, production dependency audit, builds, and mocked browser journeys.
- The quick start runs Prism with Docker Compose.
- Contribute to Prism.
- Report and handle security issues.
- Configure AI providers.
- Back up and restore Prism.
- Move a pre-baseline private database.
- Deploy and operate Prism.
- Template packs, jurisdictions, and licensing.
- Bundled DOCX license and redistribution permission.
- Frontend design system.
See our contributors list in CONTRIBUTORS.md. You can also view the full list of contributors tracked by GitHub.
Prism is licensed under GNU Affero General Public License version 3 only. If you modify Prism and let users interact with that modified version over a network, section 13 requires you to offer those users the Corresponding Source of the running version at no charge through a standard method. Sections 4 through 6 also contain notice and source requirements for distribution.
The application does not add a source-code link for an operator. A host of a modified version must provide an appropriate source offer that matches the deployed version. Keep the license and notices with redistributed copies.
This paragraph summarizes repository obligations. It is not legal advice. Read the license and ask qualified counsel how it applies to your deployment.



