agentconnect.config package

AgentConnect Configuration System

This module provides a comprehensive, developer-friendly configuration system for AgentConnect that follows industry best practices from frameworks like LangChain and CrewAI.

Key features:

  • Sane defaults that work out of the box

  • Single global settings object with nested models

  • Three-tier precedence: runtime kwargs > agentconnect.yaml > defaults

  • Minimal YAML exposure - only essential developer-facing settings

  • Environment variables are reserved for secrets and read by subsystems directly, not by the global settings

Usage:
from agentconnect.config import settings, load_settings

# Access nested configuration
registry_config = settings.registry.vector_search
client_config = settings.clients.registry

# Override at runtime
custom_settings = load_settings(registry={'vector_search': {'in_memory': False}})
load_settings(**overrides)

Load AgentConnect configuration with three-tier precedence.

Precedence (highest to lowest): 1. Runtime overrides (kwargs) 2. agentconnect.yaml file 3. Hard-coded defaults

Parameters:

**overrides – Runtime configuration overrides

Return type:

AgentConnectSettings

Returns:

Fully configured AgentConnectSettings instance

Example

# Load with defaults
settings = load_settings()

# Override specific settings at runtime
settings = load_settings(
    registry={'vector_search': {'deployment': {'type': 'in_memory'}}},
)
class AgentConnectSettings(**data)

Bases: BaseModel

Main configuration class for AgentConnect.

Precedence (highest to lowest): 1. Runtime kwargs 2. agentconnect.yaml file 3. Hard-coded defaults

Parameters:
classmethod create_from_dict(config_dict)

Create settings instance from configuration dictionary.

Return type:

AgentConnectSettings

Parameters:

config_dict (Dict[str, Any])

get_registry_config()

Get registry configuration for backward compatibility.

Return type:

Dict[str, Any]

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_dump_yaml_safe()

Export configuration in YAML-safe format (no secrets).

Return type:

Dict[str, Any]

registry: RegistrySettings
communication: CommunicationSettings
clients: ClientSettings
mcp: MCPSettings
payments: PaymentsSettings
project_name: str

Submodules