A model only knows what is in its context window on the current call. Everything an agent seems to remember, from the conversation so far to facts about a user or documents from a knowledge base, has to be chosen and placed there by the program. Doing that well is called context engineering, and it decides both answer quality and token cost.
These guides start with context engineering as a whole, then cover the main sources of context: long-term memory that persists between conversations, and retrieval-augmented generation (RAG) where the agent decides when and what to search. The last guide covers semantic caching and model fallback, which reuse earlier answers and keep the agent working when a provider fails. Read the first guide first; it gives the vocabulary the others build on.
The code in these guides runs on Promptise Foundry, an open-source Python framework for AI agents and MCP servers.