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
  • SDK Reference
      • GETGet threads
      • POSTStart a new thread.
      • DELDelete thread
      • GETGet user context
      • GETGet messages of a thread
      • POSTAdd messages to a thread
      • POSTAdd messages to a thread in batch
      • GETGet thread summary
LogoLogo
PlaygroundDiscordStatusDashboardSign Up >
SDK ReferenceThread

Get user context

GET
https://api.getzep.com/api/v2/threads/:threadId/context
GET
/api/v2/threads/:threadId/context
1from zep_cloud import Zep
2
3client = Zep(
4 api_key="YOUR_API_KEY",
5)
6client.thread.get_user_context(
7 thread_id="threadId",
8 template_id="template_id",
9)
1{
2 "context": "string"
3}

Returns most relevant context from the user graph (including memory from any/all past threads) based on the content of the past few messages of the given thread.

Was this page helpful?
Previous

Get messages of a thread

Next
Built with

Path parameters

threadIdstringRequired

The ID of the current thread (for which context is being retrieved).

Query parameters

template_idstringOptional
Optional template ID to use for custom context rendering.

Response

OK
contextstring

Context block containing relevant facts, entities, and messages/episodes from the user graph. Meant to be replaced in the system prompt on every chat turn.

Errors

404
Not Found Error
500
Internal Server Error