Skip to content

Configuration

AgentSpine uses a robust, 4-tier configuration system that ensures flexibility across different environments (local development, staging, and production).

Settings are resolved in the following order (Highest to Lowest):

  1. Programmatic: Passed directly to the AgentSpine constructor.
  2. Environment Variables: System-level variables prefixed with AGENTSPINE_.
  3. YAML File: Configuration defined in an agentspine.yaml file.
  4. Internal Defaults: Built-in defaults (e.g., localhost:5432 for Postgres).

Ideal for dynamic environments or when using secret managers (AWS Secrets Manager, Vault).

from agentspine import AgentSpine, AgentSpineConfig
from agentspine.config import DatabaseConfig, RedisConfig
config = AgentSpineConfig(
database=DatabaseConfig(
url="postgresql+asyncpg://user:pass@db.example.com:5432/spine"
),
redis=RedisConfig(
url="redis://cache.example.com:6379/0"
)
)
spine = AgentSpine(workflow="production_bot", config=config)

Standard for containerized deployments (Docker, Kubernetes).

VariableDescriptionDefault
AGENTSPINE_DATABASE_URLAsync Postgres connection stringpostgresql+asyncpg://...
AGENTSPINE_REDIS_URLRedis connection stringredis://localhost:6379/0
AGENTSPINE_LOG_LEVELLogging level (DEBUG, INFO, etc.)INFO
AGENTSPINE_CONFIG_PATHCustom path to the YAML config file./agentspine.yaml

Drop an agentspine.yaml file in your project root for easy local management.

agentspine.yaml
database:
url: "postgresql+asyncpg://user:pass@localhost:5432/agentspine"
pool_size: 20
redis:
url: "redis://localhost:6379/0"
timeout: 5.0
logging:
level: "DEBUG"
format: "json"

You can enable or disable specific AgentSpine features globally:

features:
deduplication: true
policy_enforcement: true
vault_integration: false