Motivation
Enterprise systems must change providers without code changes. Secret management moves from env vars to Vault. Caching moves from in-memory to Redis. LLM providers change. None of these should require touching agent or orchestrator code.
The Provider Adapter Pattern applies ABB/SBB separation to every infrastructure concern: define a stable contract, register concrete implementations, let a factory select the right one from config.
Structure
- BaseXxx ABB defines the contract (e.g. BaseSecretManager, BaseCache)
- XxxAdapter SBBs implement the contract for each provider
- XxxFactory._registry maps provider name to adapter class
- XxxFactory.create(config) reads config key, returns correct adapter
- Zero-config default — always works without explicit config
- Credentials NEVER in config.yaml — always from environment