Overview
After adding data to Zep, you need to retrieve relevant context to provide to your agent. Zep produces several distinct types of context from a user’s graph — facts, entities, episodes, thread summaries, observations, and the user summary — and offers three methods for assembling them into a string for your agent’s prompt.
Context types
Each method below assembles one or more context types into the final string. Before choosing a method, it helps to understand what each type captures and when to reach for it. See the Context Types overview for the full comparison; in short, the default Context Block returned by thread.get_user_context() includes the user summary plus facts, entities, and episodes, while thread summaries and observations can be added via context templates or advanced construction.
Available methods
Choosing a method
Use Zep’s context block when you want the simplest integration with optimized defaults. This works well for most conversational agents.
Use context templates when you need consistent custom formatting but want Zep to handle relevance detection. This is useful for structured contexts (customer support, sales) where you always want specific sections.
Use advanced construction when you need full control over what context is retrieved and how it’s formatted. This is ideal for complex applications with custom entity types or specialized retrieval logic.