My Agent abstractions keep breaking somewhere I don’t expect.
TL;DR: Building agents is still messy. SDK abstractions break once you hit real tool use. Caching works better when you manage it yourself, but differs between models. Reinforcement ends up doing more heavy lifting than expected, and failures need strict isolation to avoid derailing the loop. Shared state via a file-system-like layer is an important building block. Output tooling is surprisingly tricky, and model choice still depends on the task.
Vercel AI SDK but only the provider abstractions
differences between models are significant enough that you will need to build your own agent abstraction.
Because the right abstraction is not yet clear, using the original SDKs from the dedicated platforms keeps you fully in control.
cache management is much easier when targeting their SDK directly instead of the Vercel one
dealing with provider-side tools.
web search tool from Anthropic routinely destroys the message history with the Vercel SDK
Anthropic makes you pay for caching
It makes costs and cache utilization much more predictable.
opportunity to do context editing
cost of the underlying agent.
The way we do caching in the agent with Anthropic is pretty straightforward. One cache point is after the system prompt. Two cache points are placed at the beginning of the conversation, where the last one moves up with the tail of the conversation. And then there is some optimization along the way that you can do.