← All Patterns
Provider Adapter Pattern diagram
Provider Adapter Pattern — structural diagram

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

Key Concepts

BaseSecretManager BaseCache EnvSecretAdapter VaultSecretAdapter InMemoryAdapter RedisAdapter SecretManagerFactory CacheFactory K9XLiteLLMBridgeAdapter

Used in K9-AIF

SecretManagerFactory CacheFactory EnvSecretAdapter VaultSecretAdapter AwsSecretAdapter IbmSecretAdapter InMemoryAdapter RedisAdapter K9XLiteLLMBridgeAdapter