Getting started
Install Patendra and configure your first matter
Install the desktop app or run from source, add a supported model key, choose the retrieval services you want to use, and confirm the local data directory. This page covers installation, configuration, deployment, and common first-run issues.
Quickstart: desktop
Install the desktop app
The fastest path for macOS and Windows. No Python, no terminal.
-
Download the installer
Installers for macOS (
.dmg) and Windows are provided with your license. Contact us to get access. -
First launch: expect a warning
Builds are currently unsigned, so the OS will warn once. On macOS, right-click the app and choose Open instead of double-clicking. On Windows, click More info, then Run anyway at the SmartScreen prompt. If your organization forbids unsigned binaries, use the source install below.
-
Add an API key in Settings
Open the dashboard's Settings panel and paste an Anthropic (Claude) or Google (Gemini) API key. It's written to a
.envfile in your local data directory, never uploaded and never echoed back. Optional prior-art keys (USPTO, Espacenet) can be added the same way; see how keys are handled. -
Start your first run
Enter an invention disclosure and launch. The first run also downloads a sentence-transformer embedding model for the local vector store, so allow extra time and an internet connection once. Then watch the workflow stream live: retrieval, refinement, simulated examination, scoring, and a full draft.
Quickstart: source
Run from source
For Linux, locked-down environments, or anyone who wants to read the code before running it.
Source access is included with every license. You need Python 3.11 or newer. Unpack the source archive, install dependencies, and start the server:
cd patendra
pip install -r requirements.txt
python server.py
The web UI is now at http://127.0.0.1:8080 and the dashboard at http://127.0.0.1:8080/app. Prefer a native window instead of a browser tab? Run the desktop entry point:
python desktop.py
Both entry points share the same data directory and configuration. Patent figures are generated by a built-in renderer with no external dependency. Optional: install Graphviz (the dot binary) for higher-resolution raster figures.
Configuration
Environment variable reference
Everything is configured through environment variables or the .env file in your data directory. API keys can also be entered in the dashboard Settings panel, which writes to the same local .env.
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | API key for Anthropic Claude models. At least one LLM key is required to run the workflow. |
GEMINI_API_KEY / GOOGLE_API_KEY | API key for Google Gemini models (either name is accepted). |
PATENDRA_USPTO_API_KEY | Enables prior-art search against the USPTO Open Data Portal. |
PATENDRA_ESPACENET_KEY / PATENDRA_ESPACENET_SECRET | Credential pair for Espacenet (EPO OPS) worldwide prior-art search. |
PATENDRA_API_TOKEN | Shared token protecting every /api endpoint. Required before the server will bind a non-loopback address. |
PATENDRA_HOST / PATENDRA_PORT | Bind address and port. Defaults: 127.0.0.1 and 8080. |
PATENDRA_HOME | Overrides the data-directory location (runs, learning data, vector store, .env). |
PATENDRA_CORS_ORIGINS | Extends the strict localhost CORS allow-list with additional origins for remote dashboards. |
PATENDRA_LLM_TIMEOUT | Timeout for LLM provider calls. |
PATENDRA_RATE_LIMIT_PER_MINUTE | Per-client request rate limit on the API. |
PATENDRA_MAX_BODY_BYTES | Maximum request-body size (default 2 MiB). |
PATENDRA_ALLOW_INSECURE | Set to 1 to allow a non-loopback bind without a token. Use only behind a trusted authenticating proxy. |
Data directory
Where everything lives
One directory holds all state. Nothing is stored anywhere else, and nothing is uploaded to Patendra. See the security model.
Default locations:
- macOS:
~/Library/Application Support/Patendra - Windows:
%APPDATA%\Patendra - Any platform: set
PATENDRA_HOMEto relocate it to an encrypted volume, a backup-managed folder, or a Docker volume mount.
Inside it you'll find your .env (API keys and settings), a folder per run containing every artifact the workflow produced (hypotheses, prior-art search logs, examination memos, claim sets, the drafted specification, figures, and the PDF package), the learning data accumulated from your Strong/Moderate/Weak/Rejected assessments, and the ChromaDB vector store used for local semantic prior-art search. Deleting the directory resets Patendra completely; backing it up preserves everything, including scoring calibration.
Self-hosting
Remote and team deployment
Patendra is single-user local software by default, but the server is hardened for shared use when you deliberately expose it.
Expose the server with a token
The server refuses to bind a non-loopback address without PATENDRA_API_TOKEN: it fails closed rather than starting open. Set a strong token and the host together:
export PATENDRA_API_TOKEN="$(openssl rand -hex 32)"
export PATENDRA_HOST=0.0.0.0
python server.py
With a token set, every /api endpoint requires it, via the X-API-Token header or an Authorization: Bearer header. Comparison is constant-time, and requests are further bounded by the body-size cap and per-client rate limiting.
Dashboard login (cookie auth)
Browsers shouldn't keep a raw token in JavaScript. Instead, the dashboard exchanges the token once at POST /api/auth/session for an HttpOnly, SameSite=Strict session cookie. After that, team members use the dashboard normally without the token ever being readable by page scripts. If the dashboard is served from a non-localhost origin, add it to PATENDRA_CORS_ORIGINS.
Docker
A Dockerfile ships in the repository. The container requires PATENDRA_API_TOKEN when exposed; mount a volume at the data directory so runs and learning data survive restarts:
docker build -t patendra .
docker run -p 8080:8080 \
-e PATENDRA_API_TOKEN=change-me \
-v patendra-data:/data -e PATENDRA_HOME=/data \
patendra
Terminating TLS at a trusted reverse proxy? PATENDRA_ALLOW_INSECURE=1 skips the token requirement for the bind check. Use it only when the proxy itself authenticates every request. The full hardening list is on the security page.
Troubleshooting
Common first-run issues
The server won't start: port already in use
Something else is listening on 8080. Pick another port with PATENDRA_PORT=8090 python server.py (or set PATENDRA_PORT in your .env) and open http://127.0.0.1:8090 instead.
Runs fail immediately with a 400 error
No LLM API key is configured. The API rejects run requests with a clear 400 rather than failing mid-workflow. Add an ANTHROPIC_API_KEY or GEMINI_API_KEY in the dashboard Settings (or the .env file) and retry. The model picker also disables providers that have no key set.
macOS says the app "cannot be opened" / Windows SmartScreen blocks it
Installers are currently unsigned, so this warning is expected. On macOS, right-click the app in Finder and choose Open, and the dialog then offers an Open button. On Windows, click More info, then Run anyway. If policy forbids unsigned binaries, install from source or use Docker.
My draft has no figures
Figures are generated by a built-in renderer, so every run produces system diagrams, a flowchart, and a claim-dependency tree in the drafted application, with no external tool needed. Installing the Graphviz dot binary is optional and upgrades the figures to higher-resolution raster images.
It doesn't work offline
The very first run must download a sentence-transformer embedding model for the local vector store, which needs an internet connection once. After that, heavy features degrade gracefully offline. Local semantic search keeps working, while LLM calls and remote patent-data searches (USPTO, Espacenet, BigQuery) require connectivity by nature.
Installed? Create your first matter
Paste a disclosure, pick a model, and watch the workflow retrieve prior art, simulate examination, and draft a complete application. Every output is labeled for attorney review.