Prompt Caching with Deep Agents

Langchain··Submitted by Mads Kristian Nylund
Open Source AIAI ToolsAI Infrastructure

Deep Agents is a general-purpose agent that supports prompt caching across major model providers, reducing API costs by up to 80% through token reuse. It automatically sets explicit cache breakpoints, uses provider-side implicit caching, and structures prompts to maximize cache efficiency, enabling cross-provider cost savings. However, provider-specific features like explicit breakpoints and TTL vary, affecting overall savings. The harness minimizes cache degradation by maintaining consistent prefixes, and its effectiveness depends on conversation length and provider-specific features.

Read Article

More from Langchain

Related Articles