For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
PlaygroundDiscordStatusDashboardSign Up >
DocumentationSDK ReferenceGraphiti
DocumentationSDK ReferenceGraphiti
      • Key Concepts
      • Architecture Patterns
      • What is Context Engineering?
      • Retrieval Philosophy
        • Users and User Graphs
        • Threads
LogoLogo
PlaygroundDiscordStatusDashboardSign Up >
On this page
  • Overview
  • Relationship Between Users and Threads
  • Automatic Cache Warming
  • Next Steps
Key ConceptsUser Concepts

Threads

Understanding conversation threading in Zep
Was this page helpful?
Previous

Graph Overview

Next
Built with

Overview

Threads represent a conversation. Each User can have multiple threads, and each thread is a sequence of chat messages.

Chat messages are added to threads using thread.add_messages, which both adds those messages to the thread history and ingests those messages into the user-level knowledge graph. The user knowledge graph contains data from all of that user’s threads to create an integrated understanding of the user.

Relationship Between Users and Threads

threadIds are arbitrary identifiers that you can map to relevant business objects in your app, such as users or a conversation a user might have with your app. Before you create a thread, make sure you have created a user first.

Automatic Cache Warming

When you create a new thread, Zep automatically warms the cache for that user’s graph data in the background. This optimization improves query latency for graph operations on newly created threads by pre-loading the user’s data into the hot cache tier.

The warming operation runs asynchronously and does not block the thread creation response. No additional action is required on your part—this happens automatically whenever you create a thread for a user with an existing graph.

For more information about Zep’s multi-tier caching architecture and manual cache warming, see Warming the User Cache.

Next Steps

Now that you understand how Threads work, you can:

  • Learn about Users and User Graphs
  • Discover how to add messages to threads
  • Learn how to retrieve context for your agent
  • Read per-thread Thread summaries
  • Understand more about Graph Concepts