一键导入
storage-backend
Adds a new storage backend implementing the Storage protocol. Use when adding a database, cache, or persistence layer beyond InMemory and Cosmos DB.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Adds a new storage backend implementing the Storage protocol. Use when adding a database, cache, or persistence layer beyond InMemory and Cosmos DB.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reference for using and extending agentkit — YAML-driven agent specification loading and validation. Use when defining agent specs, loading YAML configs, extending AgentSpec with custom fields, or managing multiple agent configurations.
Validates the entire template stack works end-to-end — tests, Docker, infra, health checks. Use after making cross-layer changes, before PRs, or when verifying template integrity.
Reference for using and extending evalkit — evaluation framework with protocol-based evaluators, weighted rubric scoring, quality gates, and coaching moments. Use when creating custom evaluators, configuring rubrics, understanding scoring, or extending the evaluation framework.
Reference for using and extending foundrykit — Azure AI Foundry client, AgentManager, ToolRegistry, and FoundrySettings. Use when working with Azure AI credentials, creating/running agents, registering tools, or extending foundrykit for custom needs.
Validates performance and concurrency behavior of backend endpoints. Use when preparing for production, checking latency under load, or verifying system stability.
Confirms deployability and basic system health after deployment or container start. Use after azd deploy, docker compose up, or any deployment to verify the system is alive.
| name | storage-backend |
| description | Adds a new storage backend implementing the Storage protocol. Use when adding a database, cache, or persistence layer beyond InMemory and Cosmos DB. |
| argument-hint | Describe the storage backend (e.g., "Redis cache", "PostgreSQL", "Azure Blob Storage") |
Step-by-step workflow for adding a new storage backend that implements the Storage protocol.
Review the Storage protocol in py/apps/app-template/services/storage.py:
class Storage(Protocol):
async def add_message(self, message: StoredMessage) -> StoredMessage: ...
async def list_messages(self, session_id: str) -> list[StoredMessage]: ...
Your backend must implement both methods with these exact signatures.
Create the implementation in services/storage.py (or a new file imported there):
{Backend}Storage (e.g., RedisStorage, PostgresStorage).AppSettings. Validate required settings.add_message(): persist and return the StoredMessage.list_messages(): query by session_id and return list of StoredMessage.Add configuration to py/apps/app-template/core/config.py:
AppSettings (e.g., redis_url: str = "").storage_mode: Literal["inmemory", "cosmos", "redis"].Wire into factory — update get_storage():
def get_storage() -> Storage:
global _storage
if _storage is None:
if settings.storage_mode == "inmemory":
_storage = InMemoryStorage()
elif settings.storage_mode == "cosmos":
_storage = CosmosStorage()
elif settings.storage_mode == "redis":
_storage = RedisStorage()
return _storage
Update environment files:
.env.example and .env.azure.example.STORAGE_MODE value.Write tests:
add_message → list_messages round-trip.Infrastructure (if cloud-hosted):
infra/modules/core/main.tf via add-azure-resource skill.Storage protocol (both methods, correct signatures)AppSettingsget_storage()