Skip to main content
Version: 1.1.0

Environment variables

Every variable is optional — the default pipeline is fully local and needs none of them.

Legacy GRAPHIFY_* configuration names remain fallback inputs where supported. Backend activation is an exception: only ASTRIA_LLM_BACKEND or the CLI --backend flag opts into LLM enrichment; GRAPHIFY_LLM_BACKEND does not activate it.

LLM semantic enrichment​

Activates the enrich_with_semantics() pipeline stage (docs, papers, images → concept nodes). See Semantic enrichment for behavior.

VariablePurpose
ASTRIA_LLM_BACKENDRequired opt-in selection: claude (or anthropic), openai (or openai-compatible/openai_compatible), azure (or azure-openai), bedrock (or aws), kimi (or moonshot), or gemini (or google); none disables enrichment
ASTRIA_LLM_API_KEYAPI key for the explicitly selected backend; does not select or activate a backend
ASTRIA_LLM_BASE_URLEndpoint for any OpenAI-compatible provider (OpenAI, DeepSeek, Ollama, LM Studio, custom)
ASTRIA_LLM_MODELOverrides the default model for the selected backend (for Bedrock: the full model id, e.g. anthropic.claude-3-5-sonnet-20241022-v2:0)
ASTRIA_LLM_CONCURRENCYSize of the parallel LLM worker pool (default 4, clamped to 1–8)
ASTRIA_LLM_BUDGETTotal LLM token budget (input + output) per run; 0 or unset = unlimited. When the budget is exhausted, extraction stops loudly before publishing; engine calls, judge calls, and usage-less responses all count toward it
ASTRIA_LLM_MAX_CHUNKSPer-file semantic extraction chunk cap (default 8, clamped to 1–64). Content needing more chunks fails loudly instead of being truncated and cached as complete — raise this for oversized generated files
ASTRIA_LLM_COMMUNITY_MAXCap on community-naming LLM calls per run for --label-communities (default 48)
ASTRIA_SNAPSHOT_CACHE_ENTRIESProcess-wide graph snapshot cache capacity (default 3, clamped to 1–16). Each entry holds one project's full node+edge snapshot, keyed by database path and publication generation; raise it for MCP servers alternating across many repositories, lower it to bound memory
OPENAI_API_KEYFallback key for the OpenAI-compatible backend
OPENAI_BASE_URLFallback base URL for the OpenAI-compatible backend when ASTRIA_LLM_BASE_URL is unset
GEMINI_API_KEY / GOOGLE_API_KEYKey for the Gemini backend

Azure OpenAI backend​

ASTRIA_LLM_BACKEND=azure authenticates with Azure's api-key header against a resource deployment (the OpenAI-compatible backend cannot produce this auth shape). Requests go to {endpoint}/openai/deployments/{deployment}/chat/completions?api-version={version}.

VariablePurpose
ASTRIA_AZURE_ENDPOINTResource endpoint, e.g. https://my-resource.openai.azure.com (fallback AZURE_OPENAI_ENDPOINT)
ASTRIA_AZURE_DEPLOYMENTDeployment name hosting the chat model — the deployment, not the model name (fallback AZURE_OPENAI_DEPLOYMENT_NAME)
ASTRIA_AZURE_API_KEYResource API key (fallback AZURE_OPENAI_API_KEY)
ASTRIA_AZURE_API_VERSIONAPI version query parameter (default 2024-10-21)

AWS Bedrock backend​

ASTRIA_LLM_BACKEND=bedrock calls the Bedrock Converse API with real SigV4 request signing, so standard AWS credentials (static keys or AWS_SESSION_TOKEN temporary credentials) work directly — no bearer-token proxy required. Requires ASTRIA_LLM_MODEL to name a Bedrock model id.

VariablePurpose
ASTRIA_AWS_REGIONAWS region for the Bedrock runtime endpoint (fallbacks: AWS_REGION, AWS_DEFAULT_REGION)
ASTRIA_AWS_ACCESS_KEY_IDIAM access key (fallback AWS_ACCESS_KEY_ID)
ASTRIA_AWS_SECRET_ACCESS_KEYIAM secret key (fallback AWS_SECRET_ACCESS_KEY)
ASTRIA_AWS_SESSION_TOKENOptional session token for temporary credentials (fallback AWS_SESSION_TOKEN)

Kimi (Moonshot) backend​

ASTRIA_LLM_BACKEND=kimi is the OpenAI-compatible surface pointed at Moonshot's endpoint. Default model kimi-k2-0905-preview.

VariablePurpose
ASTRIA_KIMI_BASE_URLOverrides the endpoint (default https://api.moonshot.cn/v1)
MOONSHOT_API_KEY / KIMI_API_KEYKimi API key (also honors ASTRIA_LLM_API_KEY, then OPENAI_API_KEY)

Cost reporting​

Every run/update writes .astria/cost.json with the run's measured token spend plus lifetime totals. These two optional rates add a dollar estimate:

VariablePurpose
ASTRIA_COST_INPUT_PER_MTOKUSD per 1M input tokens; both rates must be set for an estimate to appear
ASTRIA_COST_OUTPUT_PER_MTOKUSD per 1M output tokens

MCP HTTP serving​

VariablePurpose
ASTRIA_MCP_TOKENDefault bearer token for astria mcp --http (the --token flag overrides). Required whenever the server binds a non-loopback host

Keys and endpoint variables do not activate enrichment. Without explicit backend selection, the pipeline makes no LLM calls. Per-run overrides without env vars: astria run . --backend openai --model gpt-4o-mini.

Keys are sent in request headers (the Gemini key never goes in the URL, where it would leak into logs and history). When ASTRIA_LLM_BASE_URL points at a plain-http endpoint that is not local (localhost, 127.0.0.1, [::1] — Ollama/LM Studio setups are silent) and an API key is set, a warning is printed because the API key travels unencrypted.

Jev judge layer​

Optional decision layer over the selected backend (--judge jev / ASTRIA_LLM_JUDGE=jev). Requires an explicit backend; judge calls count toward ASTRIA_LLM_BUDGET and fingerprint into the extraction cache. See Semantic enrichment.

VariablePurpose
ASTRIA_LLM_JUDGEJudge selection: jev (TypeSafe System One). Requires ASTRIA_LLM_BACKEND; the judge wraps an engine and cannot generate extractions on its own
ASTRIA_LLM_JUDGE_API_KEYJudge API key (falls back to TYPESAFE_API_KEY)
ASTRIA_LLM_JUDGE_MODELJudge model (default jev-latest)
ASTRIA_LLM_JEV_VERIFYoff disables the per-file verification pass (relation/node-type re-choice + edge existence)
ASTRIA_LLM_JEV_MIN_EDGE_PROBABILITYEdges whose existence probability is below this are dropped (default 0.40)
ASTRIA_LLM_JEV_GATEoff disables the batched trivial-file gate
ASTRIA_LLM_JEV_GATE_CACHEoff re-judges every run. Default on: gate verdicts are cached per (file content hash, judge configuration), so judge-gated runs are reproducible and unchanged files cost no judge calls on re-runs
ASTRIA_LLM_JEV_GATE_MAX_BYTESFiles larger than this skip the gate and are always enriched (default 65536)
ASTRIA_LLM_JEV_GATE_DROP_THRESHOLDGate drop probability above this skips the file (default 0.40)
ASTRIA_LLM_JEV_GATE_BATCHFiles judged per gate request (default 50, clamped to 1–200)
ASTRIA_QUERY_DEBUG_SCORES1 (or true/on) dumps the top scored nodes with their match components and the final seed list to stderr — diagnose a retrieval miss from one query run
ASTRIA_QUERY_MIN_SEMANTIC_CONFIDENCEHard floor for SEMANTIC edges at query time (default 0.0 = off). Verified edges whose calibrated keep-probability falls below the floor are excluded from traversal; structural and inferred edges are never filtered. Lets graph consumers act on the judge's verdicts at query time
ASTRIA_QUERY_SEED_FLOORoff disables the no-confident-match guard. Default on: when no node matches any of the question's key (highest-IDF) terms and no node matched even half of the effective terms, the query returns an explicit miss (naming the missing vocabulary) instead of a full budget of incidental word matches — one common word fully covering one label is real evidence, but it does not identify an answer. A qualifying embedding candidate, entry-intent questions, and docs-majority corpora always bypass the guard
ASTRIA_CORPUS_MODEPins the corpus mode docs or code instead of auto-detection from the prose share (default auto: ≥95% prose nodes → docs-majority, which opens the doc-seed quota and ranks chunks like documents). Unrecognized values warn and fall back to auto. The active non-default mode is disclosed in the query header

Local embeddings​

VariablePurpose
ASTRIA_EMBED_CACHE_DIROverrides where the embedding model is cached (default ~/.astria-embed-cache; ~615 MB downloaded once, then offline)
ASTRIA_EMBEDoff (or 0/false/no) stops queries from auto-merging embedding seeds. Build-side --embed still computes vectors; this only turns off consuming them, so a graph that carries vectors can still be queried structurally. The astria query --no-embed flag sets the same switch per call.
ASTRIA_CHUNK_CHARSOverrides the document chunk size in characters (default 1200, clamped to 400–8000). Larger chunks mean fewer, coarser document nodes; smaller chunks mean finer evidence granularity. Takes effect on the next fresh extraction — delete the graph directory (or change it before the first build) after changing it.

Media transcription​

run/update transcribe video and audio files (mp4, mov, webm, mkv, avi, mp3, wav, m4a, flac, ogg, opus, aac, wma) through the external whisper-cli binary (whisper.cpp); video files also need ffmpeg on PATH to demux the audio track, audio-only repositories transcribe without it. Transcripts enter the graph as document nodes like any markdown file. Without the binaries or a model the files are skipped with a one-line notice — the pipeline never fails because of media. See CLI reference.

VariablePurpose
ASTRIA_WHISPER_MODELPath to a whisper.cpp ggml .bin model file. Unset, astria uses the first *.bin in <project>/.astria/models/, then in ~/.astria/models/

Google Workspace​

.gdoc/.gsheet/.gslides shortcut files are resolved to Drive file ids and exported through the Drive API v3 (files.export). Missing credentials skip the file with a one-line notice — builds never fail on Google Workspace files.

VariableMeaning
ASTRIA_GDRIVE_ACCESS_TOKENOAuth bearer token with the Drive read-only scope. Unset, astria refreshes via a gcloud Application Default Credentials file (authorized_user JSON from gcloud auth application-default login), honoring GOOGLE_APPLICATION_CREDENTIALS when set

Query logging​

Appends a JSONL line (ts, kind, question, nodes, duration_ms) per query for agent/tooling consumption. Logging never breaks a query — it fails silent.

VariablePurpose
ASTRIA_QUERY_LOGPath of the JSONL log file; any non-empty value is used verbatim as the path (there is no =1 shortcut — use ASTRIA_QUERY_LOG_ENABLE for the default location)
ASTRIA_QUERY_LOG_ENABLE1 turns logging on with the default path (~/.cache/astria-queries.log)
ASTRIA_QUERY_LOG_DISABLE1 always wins — logging is off regardless of the other two

Export targets​

VariablePurpose
NEO4J_USERNAMEUsername for astria export --neo4j-push (default neo4j; the --neo4j-user flag overrides)
NEO4J_PASSWORDPassword for astria export --neo4j-push (empty by default; the --neo4j-pass flag overrides)

Live Neo4j integration tests​

Credentials for the #[ignore]d astria-bolt integration tests, runnable against a local Neo4j with cargo test -p astria-bolt --test live_neo4j -- --ignored. Never read by the CLI or pipeline.

VariablePurpose
ASTRIA_BOLT_TEST_USERUsername for the live tests (default neo4j)
ASTRIA_BOLT_TEST_PASSPassword for the live tests (default testpassword)

Hook guard​

The editor PreToolUse guard (see Agent integration). These are read by the hook process, so set them in your editor/agent environment, not your shell profile.

VariablePurpose
ASTRIA_HOOK_STRICT1 enables strict mode (gates un-indexed reads); 0 disables it and overrides the --strict flag; the --strict flag alone also enables strict mode when the variable is unset
ASTRIA_HOOK_STRICT_TTLSeconds a graph stays considered fresh in strict mode (default 1800)