> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-beta.getzep.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-beta.getzep.com/_mcp/server.

# Get user context

GET https://api.getzep.com/api/v2/threads/{threadId}/context

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.

Reference: https://docs-beta.getzep.com/sdk-reference/thread/get-user-context

## Request

### Path parameters

- `threadId` (string, required) — The ID of the current thread (for which context is being retrieved).

### Query parameters

- `template_id` (string, optional) — Optional template ID to use for custom context rendering.

## Response

### 200

OK

- `context` (string, optional) — Context block containing relevant facts, entities, and messages/episodes from the user graph. Pass it through the model provider's untrusted-data channel.

## Errors

### 404 Not Found Error

Not Found

- `message` (string, optional)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional)

## Examples

**Response**

```json
{
  "context": "string"
}
```