ARCHIVE · 27

All articles

Follow the trail from foundational concepts to practical engineering decisions.

AI Coding & Agents5 min read

[AI Context #7] Cut API Costs with Prompt Caching

The final part of the series is about money. If you have run an agent through an API, you may have noticed something odd on the bill. Input tokens cost vastly more than output tokens. Given the architecture from Part 1, that is only natural. Every turn resends everything from the system prompt through the full conversation history, so in a 50-turn agent session, the same system prompt is effectively billed 50 times…

Read article
AI Coding & Agents5 min read

[AI Context #6] Agent Memory Beyond Context (Plans, Memory, RAG)

If you have followed the series this far, you will see a common pattern: minimize what stays inside the context window. Part 3’s “write state to a file before /clear,” Part 4’s “only pointers instead of the body,” and Part 5’s “leave the process to subagents, send only conclusions to the main agent” all point in the same direction. But we have not yet properly addressed the destination of these files—that is, information sent outside the context.

Read article