AI Agent 的 Cache 不只一層:從 Claude Code 的 18 種快取到 ReAct Agent 的多層設計
拆解 Claude Code 的 18+ 種快取機制後發現:provider-level prompt cache 你做不了,但 embedding cache、tool result cache、entity cache 你不但做得了,效果還更好。附完整的 AgentCache 介面設計與 per-tool TTL 策略。
拆解 Claude Code 的 18+ 種快取機制後發現:provider-level prompt cache 你做不了,但 embedding cache、tool result cache、entity cache 你不但做得了,效果還更好。附完整的 AgentCache 介面設計與 per-tool TTL 策略。
Claude Code 的 45 個 tool 中,每個 prompt() 都會根據使用者類型、feature flags、系統能力動態調整。將這個模式套用到 ReAct Agent,根據 orchestrator 模型能力、locale、可用 tools 三個維度動態生成 tool description,小模型自動補 few-shot,大模型省 token。
AI Agent 不是黑盒子——它由三層構成:知道什麼(Context)、怎麼想(Cognition)、能做什麼(Action)。搞清楚這三層,才能理解 agent 為什麼有時聰明、有時失控,以及怎麼設計一個真正好用的 agent 系統。