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

# User Summary Instructions

> **Info**
>
> Get started with the example in the video using:
>
> ```bash
> git clone https://github.com/getzep/zep.git
> cd zep/examples/python/user-summary-instructions-example
> ```

## Overview

User summary instructions customize how Zep generates the entity summary for each user in their Context Graph. You can create up to 5 custom instructions for a user or for the project. Each instruction consists of a `name` (unique identifier) and `text` (the instruction content, maximum 100 characters).

> **Note**
>
> **User summary and the user node**
>
> Each user has a single unique user node in their graph representing the user themselves. The user summary generated from these instructions lives on this user node. You can retrieve the user node and its summary using the `get_node` method shown in the SDK reference.

## Default instructions

Zep applies the following default instructions to generate user summaries when no custom instructions are specified:

1. What are the user's key personal and lifestyle details?
2. What are the user's important relationships or social connections?
3. What does the user do for work, study, or main pursuits?
4. What are the user's preferences, values, and recurring goals?
5. What procedural or interaction instructions has the user given for how the AI should assist them?

These defaults cover personal details, work, relationships, preferences, goals, and interaction instructions.

## Custom instructions

Instructions are managed with set and get methods. A set call replaces the full set of instructions at its scope. Use `user.set_summary_instructions` with the `uuid` that `user.create` returns to set the instructions for one user. Use `project.set_user_summary_instructions` to set the project-wide defaults. To remove one instruction, write the set again without it.

> **Tip**
>
> **Best practices for writing instructions**: Instructions should be focused and specific, designed to elicit responses that can be answered in a sentence or two. Phrasing instructions as questions is often an effective way to get accurate and succinct responses.

> **Note**
>
> User summary instructions do not apply to data ingested through the [Batch API](/adding-batch-data).

**`Python`**

```python Python
from zep_cloud.client import Zep
from zep_cloud.types import UserInstruction

client = Zep(api_key=API_KEY)

# zep_user_uuid is the uuid of the user, from your application database.

# Set the instructions for one user. This call replaces the full set for the user.
client.user.set_summary_instructions(
    zep_user_uuid,
    instructions=[
        UserInstruction(
            name="professional_background",
            text="What are the user's key professional skills and career achievements?",
        )
    ],
)

# Set project-wide default instructions (applied to all users without their own instructions)
client.project.set_user_summary_instructions(
    instructions=[
        UserInstruction(
            name="communication_style",
            text="How does the user prefer to receive information and assistance?",
        )
    ],
)

# Get the instructions for a user
instructions = client.user.get_summary_instructions(zep_user_uuid)

# Remove one instruction for a user: write the set again without it.
# Do not write back an inherited set, because that copies the project defaults to the user.
if not instructions.inherited:
    remaining = [i for i in instructions.instructions or [] if i.name != "professional_background"]
    client.user.set_summary_instructions(zep_user_uuid, instructions=remaining)
```

**`TypeScript`**

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

const client = new ZepClient({
  apiKey: API_KEY,
});

// zepUserUuid is the UUID of the user, from your application database.

// Set the instructions for one user. This call replaces the full set for the user.
await client.user.setSummaryInstructions(zepUserUuid, {
  instructions: [
    {
      name: "professional_background",
      text: "What are the user's key professional skills and career achievements?",
    }
  ],
});

// Set project-wide default instructions (applied to all users without their own instructions)
await client.project.setUserSummaryInstructions({
  instructions: [
    {
      name: "communication_style",
      text: "How does the user prefer to receive information and assistance?",
    }
  ],
});

// Get the instructions for a user
const instructions = await client.user.getSummaryInstructions(zepUserUuid);

// Remove one instruction for a user: write the set again without it.
// Do not write back an inherited set, because that copies the project defaults to the user.
if (!instructions.inherited) {
  const remaining = (instructions.instructions ?? []).filter((i) => i.name !== "professional_background");
  await client.user.setSummaryInstructions(zepUserUuid, { instructions: remaining });
}
```

**`Go`**

```go Go
import (
	"context"
	"log"

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

client := zepclient.NewClient(option.WithAPIKey(apiKey))

// zepUserUUID is the UUID of the user, from your application database.

// Set the instructions for one user. This call replaces the full set for the user.
_, err := client.User.SetSummaryInstructions(context.TODO(), zepUserUUID, &zep.UserSummaryInstructions{
	Instructions: []*zep.UserInstruction{
		{
			Name: "professional_background",
			Text: "What are the user's key professional skills and career achievements?",
		},
	},
})
if err != nil {
	log.Fatalf("Failed to set user summary instructions: %v", err)
}

// Set project-wide default instructions (applied to all users without their own instructions)
_, err = client.Project.SetUserSummaryInstructions(context.TODO(), &zep.UserSummaryInstructions{
	Instructions: []*zep.UserInstruction{
		{
			Name: "communication_style",
			Text: "How does the user prefer to receive information and assistance?",
		},
	},
})
if err != nil {
	log.Fatalf("Failed to set default instructions: %v", err)
}

// Get the instructions for a user
instructions, err := client.User.GetSummaryInstructions(context.TODO(), zepUserUUID)
if err != nil {
	log.Fatalf("Failed to get instructions: %v", err)
}

// Remove one instruction for a user: write the set again without it.
// Do not write back an inherited set, because that copies the project defaults to the user.
if instructions.Inherited == nil || !*instructions.Inherited {
	remaining := []*zep.UserInstruction{}
	for _, i := range instructions.Instructions {
		if i.Name != "professional_background" {
			remaining = append(remaining, i)
		}
	}
	_, err = client.User.SetSummaryInstructions(context.TODO(), zepUserUUID, &zep.UserSummaryInstructions{
		Instructions: remaining,
	})
	if err != nil {
		log.Fatalf("Failed to set instructions: %v", err)
	}
}
```

## Utilizing user summary

User summaries are automatically included in [Zep's Context Block](/retrieving-context#zeps-context-block). You can toggle whether the user summary is included in the Context Block on the Projects page of the web app. Accounts created before November 10, 2025 will need to enable this setting manually, while new accounts have it enabled by default.

You can also retrieve the user node and include its summary in a custom Context Block. The [user summary example](/advanced-context-block-construction#example-4-using-user-summary-in-context-block) shows this method.