返回资讯中心
外部精选
软件工程
#社区热议

Harvey raised 500M for legal AI, I built the same and open sourced it

CaseCite is a source-available, self-hosted legal research platform. Upload your firm's documents, ask questions, and research cases & judges — on infrastructure you control. Documents, the search index and chat history…

Hacker Newszztopisgreat2026/10/28 · 2 天前25 分钟阅读

以下正文同步自 Hacker News,版权归原站所有,已转换为易读排版。

CaseCite is a source-available, self-hosted legal research platform. Upload your firm's documents, ask questions, and research cases & judges — on infrastructure you control. Documents, the search index and chat history are stored on your own servers. AI features send your questions and the relevant document text to the AI providers you configure, under your own API keys (BYOK); nothing is sent to the CaseCite maintainers, and there is no telemetry. See What leaves your infrastructure.

Eight tools behind one login, all reading from the same document corpus.

Practice profile. Nothing about any practice area is baked into the product. You state what you practice, CaseCite drafts a profile of what matters in that practice, and you edit and own it (saved via Settings). It then rides along with every review, redline, and draft as standing context.

Every AI-generated answer, analysis and draft carries a notice to verify it against the source documents and current law before relying on it. CaseCite is a research aid, not a substitute for a lawyer's judgment or for a citator.

Documents, the vector index, chat history and analyses are stored only on your deployment. Using the AI features transmits content to third parties you choose:

To keep document text entirely on your network, run both models yourself: set OPENAI_BASE_URL (chat) and EMBEDDING_BASE_URL (embeddings) to OpenAI-compatible servers you host. Setting only the first still sends document text to OpenAI for embedding. The full list of outbound data flows, and how to restrict them, is in docs/subprocessors.md.

CaseCite is licensed under the Elastic License 2.0 (LICENSE). In plain terms:

For paid private installs, support contracts, or hosted-SaaS licensing, contact the maintainer, @thomasunise, through GitHub. See SUPPORT.md.

"Source-available," not OSI "open source." See LICENSE for the full terms.

Prerequisites

Docker + Docker Compose

openssl (to generate secrets)

An AI provider API key (OpenAI is the simplest start: it covers both chat and embeddings). Optional at the server level — users can each save their own.

Run it (self-contained: bundles Postgres, Redis, and an HTTPS proxy)

git clone https://github.com/thomasunise/casecite.git && cd casecite cp .env.example .env

1. Generate the three REQUIRED secrets (the .env.example placeholders

intentionally refuse to boot). Copy each value into .env:

openssl rand -hex 32 # -> SECRET_KEY openssl rand -hex 32 # -> AUDIT_HMAC_KEY openssl rand -hex 16 # -> ENCRYPTION_SALT

2. In .env also set OPENAI_API_KEY (or leave it empty and save a key under

Settings after signing in), then uncomment and set DOMAIN,

POSTGRES_PASSWORD and REDIS_PASSWORD in the "Bundled production stack"

section (generation hints are in the file; use DOMAIN=localhost to try it

on your machine). CORS_ORIGINS and ALLOWED_HOSTS default from DOMAIN.

Set REGISTRATION_BOOTSTRAP_TOKEN too (openssl rand -hex 16) — you need it

to create the first account.

3. Set DISK_ENCRYPTION_ACKNOWLEDGED=true in .env (required to boot).

What this acknowledges: the app encrypts BYOK keys and uploaded documents

at the application layer (AES-256-GCM), but derived text (vector chunks,

chat history, analyses) is stored in cleartext in the app, Postgres and

Redis volumes — full-disk encryption of the host is YOUR responsibility.

4. Start the full stack (bundled Postgres + Redis + Caddy):

docker compose -f docker-compose.prod.yml up -d

python3 scripts/setup_production.py --create-env --domain <host> does steps 1–2 for you (it generates every secret and writes .env with mode 0600).

Then open https://$DOMAIN (with DOMAIN=localhost: https://localhost). On a localhost trial Caddy redirects HTTP to HTTPS and serves a certificate from its own self-signed local CA — the browser warning on first visit is expected. See "TLS on Internal Networks" in docs/deployment.md to trust that CA or bring your own certificate.

The first account you register becomes the admin, and registering it requires the REGISTRATION_BOOTSTRAP_TOKEN from .env — so nobody else who reaches a fresh instance can claim it. The exact command is under "Create the admin account" in docs/deployment.md. After that, invite colleagues from Settings → Users; self-service registration is off by default.

Deploying behind an existing reverse proxy (Coolify/Traefik)? Use the root docker-compose.yml instead (it expects an external Postgres and Redis and declares the persistent data volume), and read deploy/COOLIFY-SETUP.md — you must also set TRUSTED_PROXIES to the proxy's subnet or client IPs collapse to one.

Users provide AI provider keys via the Settings modal. What firm evaluators should know about custody:

Required env vars

The stack fails closed on startup if any of these are missing or left as placeholders.

Not required to boot, but the product does little without them:

Using the root docker-compose.yml (external DB/Redis) instead of the bundled stack? Then DATABASE_URL, REDIS_URL, CORS_ORIGINS, and ALLOWED_HOSTS are required directly, and set DB_SSL=require for a managed database.

Variable Default Description

ANTHROPIC_API_KEY — Claude access

VOYAGE_API_KEY — Voyage AI legal embeddings

OPENAI_BASE_URL — OpenAI-compatible endpoint for chat (self-hosted model or gateway)

EMBEDDING_BASE_URL — OpenAI-compatible endpoint for embeddings; set with OPENAI_BASE_URL to keep document text on your network

VECTOR_DB chroma chroma (local) or pinecone (stores document text with Pinecone)

TRUSTED_PROXIES 127.0.0.1 Reverse-proxy IP/CIDR — required behind a proxy

REQUIRE_MFA false Require every password account to enrol TOTP MFA

SESSION_ABSOLUTE_TIMEOUT_HOURS / SESSION_IDLE_TIMEOUT_MINUTES 8 / 120 Session lifetime and idle timeout

ALLOW_REGISTRATION false Allow self-service sign-up after the first account

SENDGRID_API_KEY — Enables password-reset emails (change-password works without it)

.env.example documents every setting.

The sync API imports one folder (folder_id) or, with an explicit sync_all, the whole account. The UI has no folder picker yet: "Sync Now" imports the whole connected account after a second confirmation that says so. To bring in selected files, use the file pickers instead. Clio's listing is account-wide, so Clio cannot sync a single folder.

Filevine uses one firm-wide API key, so it is off until FILEVINE_ENABLED=true and is then available to admins only.

The iManage and NetDocuments connectors are implemented against the vendors' published APIs but have not been validated against a live tenant. Test them in your environment before relying on them.

Microsoft and Google connections request read-only scopes. Connections made before this release keep their broader grant until reconnected.

CourtListener API token

Legal tools, Judge intel, Case view, and the case-law side of the strategy engine all read from CourtListener. CourtListener is the only case-law source in the app. The app starts without a token, but the case-law half of the product is not usable without one:

Get a free token at https://www.courtlistener.com/help/api/rest/#permissions, then either set COURTLISTENER_API_TOKEN in .env, or save it instance-wide as an admin (Settings → API Keys, or POST /api/v1/admin/integrations/courtlistener) — the stored token overrides the .env value at runtime without a restart.

backend/ app/ main.py FastAPI app, middleware, health config.py Pydantic settings routers/ API routers services/ rag/ RAG pipeline (search, generation, citations, intent) vectordb.py ChromaDB/Pinecone abstraction embeddings.py Multi-provider embeddings auth.py JWT auth strategy.py Matter strategy briefs courtlistener.py CourtListener API ... middleware/ Security, CSRF migrations/ Alembic migrations frontend/ src/ App.tsx api/ Per-domain API clients views/ Page views stores/ Zustand stores components/ Shared components + modals layout/ App shell scripts/ Backup/restore, production setup, key rotation, NOTICE generator docs/ Deployment, data flows, secret rotation, incident response, ADRs Dockerfile Unified image (frontend + backend) docker-compose.prod.yml Bundled stack: Caddy + Postgres + Redis + backend docker-compose.yml Behind an existing proxy (Coolify/Traefik); external Postgres + Redis docker-compose.dev.yml Local development

API-only (no UI yet)

These are implemented and reachable over the API, but the frontend does not expose them yet. Treat them as preview:

Everything else in the feature table above, plus user administration and the audit log (Settings, admins only), has a UI.

Password sign-in (PBKDF2-SHA256) with optional or mandatory TOTP MFA and recovery codes; password reset by email and change-password in the app

JWT access tokens with rotating refresh tokens in httpOnly cookies, JTI revocation in Redis (required in production), "sign out everywhere"

Sessions capped at 5 per user, with an 8-hour absolute lifetime and an idle timeout

Role-based permissions (require_permission), adjustable per role by an admin

Per-user (and per-matter) scoping on every document, chat and analysis

CSRF double-submit cookies, HMAC-signed; per-IP rate limiting; account lockout

AES-256-GCM at-rest encryption for uploaded originals, API keys, connector tokens and MFA secrets. The vector index and database rely on disk encryption that you provide

CSP, HSTS, X-Frame-Options, Permissions-Policy headers

Audit log with HMAC-SHA256 chain hashing, verified at startup and on demand

CaseCite holds no security certification (SOC 2, ISO 27001, HIPAA). What it does and does not do is described in SECURITY.md, which also explains how to report a vulnerability; known gaps are listed in ROADMAP.md.

See CONTRIBUTING.md. PRs welcome for the source-available product. Note that contributions are licensed under ELv2.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →