Arke Terminal
AI document search for legal teams. Privilege-safe, on-premise.
Cloud AI breaks attorney-client privilege (United States v. Heppner, Hamid v SSHD). Arke runs on your server. Your documents never leave your network.
How it works
Arke is a single Python process with two pipes.
Vertical pipe — digestion. Drop documents into digest/. Arke detects the change, loads every file (PDF, DOCX, MSG, TXT), chunks and embeds it, keeps everything in memory and on local disk. On the next question, the answers are already there.
Horizontal pipe — query. A question arrives — from email, terminal, or CLI. Arke embeds the query, runs hybrid search (cosine + BM25), passes the top results to the LLM, and returns a cited answer. No round-trips, no external services: the LLM runs in the same process via llama-cpp-python.
The document is a seed on disk (plain JSON) and a tree in memory (chunks, embeddings, full text). The tree is always rebuilt from the seed. Nothing clever lives on disk.
Install
pip install arke-terminal
cp .env.example .env # fill in model paths or cloud API key
arke-server # start the engine
No Docker. No Postgres. No Ollama daemon.
Interfaces
Email (Microsoft 365)
Arke connects to a shared mailbox via Graph API webhooks. A lawyer sends a question to ask@yourfirm.legal, Arke replies with an answer and citations. Runs with arke-mail.
Requires: Azure AD app registration, cloudflared tunnel for the webhook endpoint.
M365_TENANT_ID, M365_CLIENT_ID, M365_CLIENT_SECRET
M365_MAILBOX, M365_WEBHOOK_URL
Terminal
arke ask "What are the termination clauses?"
Eval sweep — find the best retrieval config (chunk size, overlap, alpha, k) by running MRR benchmarks across presets:
python -m arke.eval.sweep --space legalbench --level medium --limit 50
Backends
| Backend | When to use |
|---|---|
local |
Production. GPU server, .gguf models. Zero external calls. |
cloud |
Eval and development. OpenAI-compatible API. |
# local
BACKEND=local
EMBED_MODEL_PATH=/models/nomic-embed.gguf
INFERENCE_MODEL_PATH=/models/mistral.gguf
# cloud
BACKEND=cloud
CLOUD_API_KEY=sk-...
CLOUD_EMBED_MODEL=text-embedding-3-small
CLOUD_INFERENCE_MODEL=gpt-4o
Input formats
PDF, DOCX, MSG (Outlook), TXT, Markdown. Drop files into digest/, Arke picks them up automatically.
Configuration
All via environment variables (.env):
| Variable | Default | Description |
|---|---|---|
ARKE_SPACE |
default |
Dataspace name (isolates documents per client) |
CHUNK_SIZE |
600 |
Characters per chunk |
OVERLAP |
0.0 |
Overlap fraction (0–0.5) |
ALPHA |
0.7 |
Blend: 1.0 = pure semantic, 0.0 = pure keyword |
K |
5 |
Top-k results passed to LLM |
Metadata
Release files for arke-legal 0.1.204
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| arke_legal-0.1.204.tar.gz | 121.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arke_legal-0.1.204-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 152.3 kB
Release files / arke_legal-0.1.204.tar.gz
| Download URL | arke_legal-0.1.204.tar.gz |
|---|---|
| Size | 121.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a22aad92d13d21177b0744bd58778601cdaf8c936c639c311b0e52ff29202a9a
|
|
BLAKE2b-256 checksum How to use checksums |
d299e1df90a128d356c883352cacd06f511c3b1a8d9079d7d51f4d1fb2ada224
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / arke_legal-0.1.204-py3-none-any.whl
| Download URL | arke_legal-0.1.204-py3-none-any.whl |
|---|---|
| Size | 31.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8cbb6d3354aa26e55efbcadc6481effa9be4dbe282716f966749940901a4d41b
|
|
BLAKE2b-256 checksum How to use checksums |
f3df471b654955770c5417e8912e5bd4bdeedcb486eb13ce578b357ee0c9060a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for arke-legal 0.1.204
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.