Skip to main content
Aegra is configured through environment variables in your .env file. Copy .env.example as a starting point:
cp .env.example .env

Application

VariableDefaultDescription
PROJECT_NAMEAegraApplication name
VERSION0.1.0Application version
DEBUGfalseEnable debug mode
AEGRA_CONFIGaegra.jsonPath to the configuration file

Database

Two ways to configure the database connection:

Option 1: Connection string

DATABASE_URL=postgresql://user:password@host:5432/aegra?sslmode=require
The URL is used by both SQLAlchemy (async) and LangGraph (sync) with the appropriate driver prefix applied automatically. Query parameters are preserved.

Option 2: Individual fields

Used when DATABASE_URL is not set:
POSTGRES_DB=aegra
POSTGRES_HOST=localhost
POSTGRES_PASSWORD=password
POSTGRES_PORT=5432
POSTGRES_USER=user
DATABASE_URL takes precedence. When set, individual POSTGRES_* variables are ignored.
VariableDefaultDescription
DATABASE_URLFull PostgreSQL connection string
POSTGRES_DBaegraDatabase name
POSTGRES_HOSTlocalhostDatabase host
POSTGRES_PASSWORDpasswordDatabase password
POSTGRES_PORT5432Database port
POSTGRES_USERuserDatabase user
DB_ECHO_LOGfalseLog all SQL statements

Connection pools

Aegra uses two connection pools: one for SQLAlchemy (metadata) and one for LangGraph (agent runtime).
VariableDefaultDescription
SQLALCHEMY_POOL_SIZE2SQLAlchemy connection pool size
SQLALCHEMY_MAX_OVERFLOW0Max overflow connections for SQLAlchemy
LANGGRAPH_MIN_POOL_SIZE1Minimum connections for LangGraph pool
LANGGRAPH_MAX_POOL_SIZE6Maximum connections for LangGraph pool

Server

VariableDefaultDescription
HOST0.0.0.0Server host
PORT8000Server port
SERVER_URLhttp://localhost:8000Public-facing server URL

Authentication

VariableDefaultDescription
AUTH_TYPEnoopAuthentication mode: noop (no auth) or custom

Logging

VariableDefaultDescription
LOG_LEVELINFOLogging level (DEBUG, INFO, WARNING, ERROR)
ENV_MODELOCALEnvironment mode: LOCAL, DEVELOPMENT, PRODUCTION (PRODUCTION outputs JSON logs)
LOG_VERBOSITYstandardstandard or verbose (verbose includes request-id)

LLM providers

VariableDescription
OPENAI_API_KEYOpenAI API key
ANTHROPIC_API_KEYAnthropic API key
TOGETHER_API_KEYTogether AI API key

Observability (OpenTelemetry)

VariableDefaultDescription
OTEL_SERVICE_NAMEaegra-backendService name for traces
OTEL_TARGETS""Comma-separated list: LANGFUSE, PHOENIX, GENERIC
OTEL_CONSOLE_EXPORTfalseLog traces to console

Langfuse

VariableDescription
LANGFUSE_BASE_URLLangfuse API endpoint (e.g., https://cloud.langfuse.com)
LANGFUSE_PUBLIC_KEYLangfuse public key
LANGFUSE_SECRET_KEYLangfuse secret key

Arize Phoenix

VariableDefaultDescription
PHOENIX_COLLECTOR_ENDPOINThttp://127.0.0.1:6006/v1/tracesPhoenix OTLP endpoint
PHOENIX_API_KEYPhoenix API key (optional)

Generic OTLP

VariableDescription
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint
OTEL_EXPORTER_OTLP_HEADERSHeaders as comma-separated key=value pairs
See observability guide for configuration examples.