> This page is for version v4 (default).
> For other versions, use one of these documentation indexes:
> - v4 (default): https://docs-beta.getzep.com/v4/llms.txt
> - v3: https://docs-beta.getzep.com/v3/llms.txt
> - v2: https://docs-beta.getzep.com/v2/llms.txt

> 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.

# Thread summaries

## Overview

A thread summary is a natural-language summary of the messages in a single thread, generated and incrementally updated by Zep. There is one summary per thread, and it is persisted on the user's Context Graph alongside the data Zep already extracts from messages.

Thread summaries are useful as an extra type of context to give your agent a different view of a user's history — for example, what problem the user had in a given conversation and how it was resolved. Where [facts](/facts) and [entity summaries](/entities) describe the user across all their threads, a thread summary describes the arc of one specific conversation.

## How they're generated

Thread summaries are generated and updated automatically as new messages arrive in a thread. There is no manual "summarize now" call — clients only read summaries, they do not create them.

A thread that has never received messages will not have a summary, and the single-thread endpoint will return `404` until the first summary has been generated.

## Get the summary for a thread

Use this when you have a specific thread in hand and want its summary. Pass the `uuid` that `thread.create` returns. Store this UUID in your application database next to your own conversation ID.

**`Python`**

```python Python
from zep_cloud import Zep

client = Zep(api_key="YOUR_API_KEY")

# The uuid of the thread, from your application database.
summary = client.thread.get_summary(zep_thread_uuid)

print(summary.summary)             # the natural-language summary
print(summary.last_summarized_at)  # timestamp of the most recent update
```

**`TypeScript`**

```typescript TypeScript
import { ZepClient } from "@getzep/zep-cloud";

const client = new ZepClient({ apiKey: "YOUR_API_KEY" });

// The UUID of the thread, from your application database.
const summary = await client.thread.getSummary(zepThreadUuid);

console.log(summary.summary);
console.log(summary.lastSummarizedAt);
```

**`Go`**

```go Go
import (
    "context"
    "fmt"

    zep "github.com/getzep/zep-go/v4"
    zepclient "github.com/getzep/zep-go/v4/client"
    "github.com/getzep/zep-go/v4/graph"
    "github.com/getzep/zep-go/v4/option"
)

client := zepclient.NewClient(
    option.WithAPIKey("YOUR_API_KEY"),
)

// The UUID of the thread, from your application database.
summary, err := client.Thread.GetSummary(context.TODO(), zepThreadUUID)
if err != nil {
    // handle 404 if no summary has been generated yet
}

fmt.Println(*summary.Summary)
fmt.Println(*summary.LastSummarizedAt)
```

The `last_summarized_at` field on the returned object is the timestamp of the most recent summary update. A `404` response means Zep has not yet generated a summary for this thread (for example, a thread with no messages yet).

## List summaries for a user or graph

Use `graph.thread_summary.list` to retrieve summaries across many threads — for example, when building a per-user dashboard. Pass the `graph_uuid` of a user to list the summaries of that user's threads, or pass the `uuid` of another graph. The method returns a page of `ThreadSummary` objects. The SDK pager fetches the next page when you iterate. Set `limit` to control the page size.

**`Python`**

```python Python
# All thread summaries across a user's threads.
# zep_graph_uuid is the graph_uuid of the user, from your application database.
summaries = client.graph.thread_summary.list(zep_graph_uuid, limit=20)

for s in summaries:
    print(s.thread_uuid, "—", s.summary)
```

**`TypeScript`**

```typescript TypeScript
const summaries = await client.graph.threadSummary.list(zepGraphUuid, {
    limit: 20,
    body: {},
});

for await (const s of summaries) {
    console.log(s.threadUuid, "—", s.summary);
}
```

**`Go`**

```go Go
summaries, err := client.Graph.ThreadSummary.List(
    context.TODO(),
    zepGraphUUID,
    &graph.ThreadSummaryListRequest{
        Limit: zep.Int(20),
    },
)
if err != nil {
    // handle error
}

iter := summaries.Iterator()
for iter.Next(context.TODO()) {
    s := iter.Current()
    fmt.Println(*s.ThreadUUID, "—", *s.Summary)
}
if err := iter.Err(); err != nil {
    // handle error
}
```

## Search thread summaries

[`graph.search_thread_summaries`](/searching-the-graph) searches over thread summary content directly. The call returns one page of `ThreadSummary` objects.

**`Python`**

```python Python
results = client.graph.search_thread_summaries(
    zep_graph_uuid,
    query="payment failures and account recovery",
    limit=5,
)

for s in results.items or []:
    print(s.thread_uuid, "—", s.summary)
```

**`TypeScript`**

```typescript TypeScript
const results = await client.graph.searchThreadSummaries(zepGraphUuid, {
  limit: 5,
  body: { query: "payment failures and account recovery" },
});

for (const s of results.data) {
  console.log(s.threadUuid, "—", s.summary);
}
```

**`Go`**

```go Go
results, err := client.Graph.SearchThreadSummaries(context.TODO(), zepGraphUUID, &zep.GraphSearchThreadSummariesRequest{
    Limit: zep.Int(5),
    Body:  &zep.SearchRequest{Query: "payment failures and account recovery"},
})
if err != nil {
    // handle error
}

for _, s := range results.Results {
    fmt.Println(*s.ThreadUUID, "—", *s.Summary)
}
```

## Thread summaries and the Context Block

The default [Context Block](/retrieving-context) can include thread summaries when Smart Context Assembly selects them. Use a [context template](/context-templates) to always include thread summaries or set a limit.

Retrieve summaries directly or use [advanced Context Block construction](/advanced-context-block-construction) when you need full control.

## Related

* [Retrieving context](/retrieving-context) — the user-wide Context Block.
* [Threads](/threads) — the underlying primitive being summarized.
* [Documents](/documents) — document summaries, the analogue for grouped graph episodes.
* [Entities](/entities) — entity-level summaries, a separate concept.
* [Context types](/context-types) — overview of the other context types.