zentri-server CLI
zentri-server is the coordinator. zentri-server serve runs the HTTP API that the CLI, agents and integrations talk to.
Every command also takes -h or --help, and zentri-server --version prints the same as zentri-server version. Cobra’s built-in zentri-server help [command] prints a command’s help and is left out.
Environment variables are on Environment variables.
zentri-server
Section titled “zentri-server”The Zentri coordinator.
zentri-server [command]zentri-server audit
Section titled “zentri-server audit”Inspect the audit log.
zentri-server audit [command]zentri-server audit verify
Section titled “zentri-server audit verify”Check the audit log’s hash chain.
Walk the audit log in order and recompute every hash.
Prints the number of rows checked and the hash of the last one. Keep that head hash somewhere else: comparing it later shows whether rows were removed from the end, which the chain alone cannot show. Exits 1 when the chain is broken. Connects with ZENTRI_DATABASE_URL.
zentri-server audit verify [flags]zentri-server intents
Section titled “zentri-server intents”Maintain the intent pipeline.
zentri-server intents [command]zentri-server intents calibrate
Section titled “zentri-server intents calibrate”Score the classifier on a labeled dataset.
Replay a labeled dataset of prompt pairs (examples/intents/pairs.jsonl) through extraction, embedding, and classification, and print precision and recall for each class. It reports the shipped defaults for the embedder, the best thresholds a sweep finds on the set, and a two-fold held-out score that shows how much the sweep overfits. With –heldout it also scores a separate set with the defaults and the swept thresholds, and fits nothing on it. It needs no database.
The embedder comes from ZENTRI_EMBEDDER and its variables, or –embedder. –extract and –judge use the chat model from ZENTRI_LLM_BASE_URL and its variables. –cache keeps model answers on disk so a rerun is fast; latency is only meaningful without it.
zentri-server intents calibrate [flags]Flags:
| Flag | Type | Default | Description |
|---|---|---|---|
--cache |
string |
directory that keeps model answers between runs | |
--dataset |
string |
examples/intents/pairs.jsonl |
labeled pairs, JSON Lines |
--embed-prefix |
string |
text put before each prompt the ollama embedder reads (an experiment) | |
--embedder |
string |
hash, ollama, or openai (default ZENTRI_EMBEDDER) | |
--extract |
bool |
false |
run the LLM extractor on both prompts |
--heldout |
stringArray |
a labeled set to score without fitting on it; repeat for more sets | |
--json |
bool |
false |
print the full report as JSON |
--judge |
bool |
false |
ask the LLM judge about each pair at or above –judge-floor |
--judge-ceiling |
float64 |
0 |
cosine from which the judge is not asked, as duplicate_cosine is in a check; 0 asks at any cosine |
--judge-existing |
string |
raw |
what the judge reads of the existing task: raw or stored |
--judge-floor |
float64 |
0.3 |
lowest cosine the judge reads; the sweep places judge_cosine at or above it |
--judge-top |
int |
0 |
score each pair as a check: the judge reads the closest N of the set’s existing tasks and the most blocking class wins; 0 judges only the pair’s own task |
--text |
string |
normalized |
what is embedded: normalized, raw, or summary |
zentri-server intents reembed
Section titled “zentri-server intents reembed”Embed intents that have no vector from the configured embedder.
Embed every active, queued, or done intent that has no vector: those stored while the embedder was down. The coordinator also does this in the background. With –all, also replace vectors from other embedding models, which is how a project moves to a new embedder: matching compares only vectors of the same model.
Connects with ZENTRI_DATABASE_URL and reads the model variables that serve reads.
zentri-server intents reembed [flags]Flags:
| Flag | Type | Default | Description |
|---|---|---|---|
--all |
bool |
false |
also replace vectors from other embedding models |
zentri-server migrate
Section titled “zentri-server migrate”Manage the database schema.
zentri-server migrate [command]zentri-server migrate up
Section titled “zentri-server migrate up”Apply every pending migration.
Connects with ZENTRI_MIGRATE_DATABASE_URL, or ZENTRI_DATABASE_URL when that is unset. Migrations are forward-only.
zentri-server migrate up [flags]zentri-server overlap
Section titled “zentri-server overlap”Maintain symbol overlap matching.
zentri-server overlap [command]zentri-server overlap calibrate
Section titled “zentri-server overlap calibrate”Pick the near-duplicate symbol threshold from labeled name pairs.
Score labeled symbol name pairs with Postgres pg_trgm similarity(), the function the coordinator matches with, and pick the threshold with the best F0.5 from 0.30 to 0.95 in steps of 0.01 on –dataset alone; a tie goes to the higher threshold. Each –heldout set is then scored at that threshold and at the shipped one, with 95% Wilson intervals on precision and recall.
Connects with ZENTRI_DATABASE_URL and only runs SELECT similarity($1, $2); any Postgres with pg_trgm installed will do.
zentri-server overlap calibrate [flags]Examples:
zentri-server overlap calibrate --dataset examples/symbols/pairs.jsonl \ --heldout examples/symbols/heldout/pairs.jsonlFlags:
| Flag | Type | Default | Description |
|---|---|---|---|
--dataset |
string |
examples/symbols/pairs.jsonl |
labeled pairs that pick the threshold |
--heldout |
stringArray |
labeled pairs scored at the picked threshold only (repeatable) | |
--json |
bool |
false |
print the report, with the whole sweep, as JSON |
zentri-server overlap calibrate-docs
Section titled “zentri-server overlap calibrate-docs”Pick the doc-text threshold for near-duplicate symbols from labeled pairs.
Score labeled symbol pairs with doc comments as the coordinator matches a snapshot (ADR-0017). A pair is flagged when its names match, by Normalize or by pg_trgm similarity() at the shipped name threshold, or when the cosine of its two doc texts reaches a threshold. The doc threshold with the best F0.5 from 0.30 to 0.99 in steps of 0.01 on –dataset alone is picked, among those that flag at most 0.1% of the dataset’s unlabeled pairs (two symbols of one kind from different labeled pairs); a tie goes to the higher threshold. Each –heldout set is then scored by names alone, at the picked threshold, and at the shipped one, with 95% Wilson intervals on precision and recall.
The doc scorer follows the embedder, from ZENTRI_EMBEDDER and its variables or –embedder: the offline hash embedder gets the lexical scorer, and any other embedder reads the docs itself. Name similarity comes from the Postgres at ZENTRI_DATABASE_URL, which only runs SELECT similarity(). –cache keeps embedder answers on disk so a rerun is fast.
zentri-server overlap calibrate-docs [flags]Examples:
ZENTRI_EMBEDDER=ollama ZENTRI_EMBED_MODEL=embeddinggemma:300m \ zentri-server overlap calibrate-docs --dataset examples/symbols/docs/pairs.jsonl \ --heldout examples/symbols/docs/heldout/pairs.jsonlFlags:
| Flag | Type | Default | Description |
|---|---|---|---|
--cache |
string |
directory that keeps embedder answers between runs | |
--dataset |
string |
examples/symbols/docs/pairs.jsonl |
labeled doc pairs that pick the threshold |
--embedder |
string |
hash, ollama, or openai (default ZENTRI_EMBEDDER) | |
--heldout |
stringArray |
labeled doc pairs scored at the picked threshold only (repeatable) | |
--json |
bool |
false |
print the report, with the whole sweep, as JSON |
zentri-server serve
Section titled “zentri-server serve”Run the coordinator HTTP API.
Environment: ZENTRI_DATABASE_URL Postgres URL the coordinator serves with (required) ZENTRI_MIGRATE_DATABASE_URL Postgres URL of the schema owner, for migrations (default ZENTRI_DATABASE_URL) ZENTRI_ADDR Listen address (default :8080) ZENTRI_BOOTSTRAP_ADMIN_TOKEN_FILE File holding the first admin token. Without it, the token is generated and printed once. ZENTRI_SLACK_RETRY_BASE First retry delay of a Slack delivery, doubling up to 15m (default 10s) OTEL_EXPORTER_OTLP_ENDPOINT Turns on OpenTelemetry trace export ZENTRI_EMBEDDER hash (default, offline), ollama, or openai ZENTRI_EMBED_BASE_URL Embedder URL: Ollama's root, or an OpenAI-compatible URL ending in /v1 ZENTRI_EMBED_MODEL Embedding model (ollama default nomic-embed-text; required for openai) ZENTRI_EMBED_API_KEY_FILE File holding the embedder's API key (openai, optional) ZENTRI_LLM_BASE_URL OpenAI-compatible URL ending in /v1. Turns on the LLM steps. ZENTRI_LLM_MODEL Chat model for the LLM steps (required with ZENTRI_LLM_BASE_URL) ZENTRI_LLM_API_KEY_FILE File holding the LLM's API key (optional) ZENTRI_LLM_RESPONSE_FORMAT json_schema (default) or json_object ZENTRI_LLM_STEPS Comma list of extract, judge, and phrase (default judge) ZENTRI_LLM_REASONING_EFFORT Sent as reasoning_effort when set; "none" turns off a model's thinking ZENTRI_DATA_KEY_FILE 32-byte key that encrypts raw prompts. Without it, raw prompts are not kept. ZENTRI_MODEL_TIMEOUT Per-call model timeout (default 5s)zentri-server serve [flags]Flags:
| Flag | Type | Default | Description |
|---|---|---|---|
--addr |
string |
:8080 |
listen address (env ZENTRI_ADDR) |
--no-migrate |
bool |
false |
skip applying migrations at start |
--reembed-interval |
duration |
1m0s |
how often to embed intents stored while the embedder was down |
--sweep-interval |
duration |
1m0s |
how often to abandon stale sessions, expire claims, prune idle claim rate buckets, run the question and decision sweeps, and prune Slack deliveries older than 30 days |
zentri-server version
Section titled “zentri-server version”Print version information.
zentri-server version [flags]