Skip to main content

Documentation Index

Fetch the complete documentation index at: https://astron-bb4261fd.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Configuration

Z3rno is configured entirely through environment variables. This page documents every available setting.

Database

VariableDefaultDescription
DATABASE_URLpostgresql://z3rno:z3rno@localhost:5432/z3rnoPostgreSQL connection string
DATABASE_POOL_SIZE10Connection pool size
DATABASE_MAX_OVERFLOW20Maximum overflow connections beyond pool size
DATABASE_POOL_TIMEOUT30Seconds to wait for a connection from the pool
DATABASE_POOL_RECYCLE3600Seconds before a connection is recycled
DATABASE_ECHOfalseLog all SQL statements (for debugging)
The PostgreSQL instance must have pgvector and Apache AGE extensions installed and enabled. Z3rno runs CREATE EXTENSION IF NOT EXISTS on startup.

Valkey

VariableDefaultDescription
VALKEY_URLredis://localhost:6379/0Valkey connection URL (falls back to REDIS_URL for backward compat)
VALKEY_MAX_CONNECTIONS20Maximum connections in the Valkey pool
CELERY_BROKER_URLSame as VALKEY_URLCelery task broker URL (defaults to VALKEY_URL if not set)
CELERY_RESULT_BACKENDSame as VALKEY_URLCelery result backend URL

Embedding

VariableDefaultDescription
EMBEDDING_PROVIDERopenaiEmbedding provider: openai, cohere, local
EMBEDDING_MODELtext-embedding-3-smallModel name for the embedding provider
EMBEDDING_DIMENSIONS1536Vector dimensions (must match model output)
OPENAI_API_KEYAPI key for OpenAI embeddings
COHERE_API_KEYAPI key for Cohere embeddings
EMBEDDING_BATCH_SIZE100Number of texts to embed per API call
When switching embedding providers or models, you must re-embed all existing memories. Vectors from different models are not compatible.

Server

VariableDefaultDescription
Z3RNO_HOST0.0.0.0Host to bind the server to
Z3RNO_PORT8000Port to bind the server to
Z3RNO_WORKERS4Number of Uvicorn workers
Z3RNO_API_KEYz3rno_sk_test_localdevAPI key for authenticating requests
Z3RNO_CORS_ORIGINS*Comma-separated list of allowed CORS origins

Rate limiting

VariableDefaultDescription
RATE_LIMIT_ENABLEDtrueEnable rate limiting
RATE_LIMIT_REQUESTS100Maximum requests per window
RATE_LIMIT_WINDOW60Window size in seconds
RATE_LIMIT_BURST20Burst allowance above the steady rate
RATE_LIMIT_BACKENDvalkeyRate limit storage: valkey or memory

Memory lifecycle

VariableDefaultDescription
IMPORTANCE_DECAY_INTERVAL3600Seconds between importance decay runs
IMPORTANCE_DECAY_RATE0.01Decay rate per interval (0.0 - 1.0)
MEMORY_TTL_DEFAULT0Default memory TTL in seconds (0 = no expiry)
MEMORY_RETENTION_CAP10000Maximum memories per agent before pruning

Logging

VariableDefaultDescription
LOG_LEVELinfoLog level: debug, info, warning, error, critical
LOG_FORMATjsonLog format: json or text
LOG_INCLUDE_TIMESTAMPtrueInclude ISO 8601 timestamp in log entries
SENTRY_DSNSentry DSN for error tracking (optional)

Multi-tenancy

VariableDefaultDescription
MULTI_TENANCY_ENABLEDtrueEnable multi-tenant isolation
RLS_ENABLEDtrueEnable PostgreSQL Row-Level Security

Example .env file

# Database
DATABASE_URL=postgresql://z3rno:changeme@postgres:5432/z3rno
DATABASE_POOL_SIZE=20

# Valkey
VALKEY_URL=redis://valkey:6379/0

# Embedding
EMBEDDING_PROVIDER=openai
EMBEDDING_MODEL=text-embedding-3-small
OPENAI_API_KEY=sk-your-openai-key

# Server
Z3RNO_PORT=8000
Z3RNO_WORKERS=4
Z3RNO_API_KEY=z3rno_sk_prod_your-secure-key

# Rate limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_WINDOW=60

# Logging
LOG_LEVEL=info
LOG_FORMAT=json

Next steps

Docker Compose

Deploy Z3rno on a single machine with Docker Compose.

Kubernetes

Deploy Z3rno on Kubernetes with the official Helm chart.