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

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

# Deprecated: Use search_sessions method instead

POST https://api.getzep.com/api/v2/sessions/{sessionId}/search
Content-Type: application/json

Reference: https://help.getzep.com/v2/sdk-reference/deprecated/memory/search

## Request

### Path parameters

- `sessionId` (string, required) — The ID of the session for which memory should be searched.

### Query parameters

- `limit` (integer, optional) — The maximum number of search results to return. Defaults to None (no limit).

### Body (application/json)

This endpoint expects a models.MemorySearchPayload.

- `metadata` (map from string to any, optional) — Metadata Filter
- `min_fact_rating` (double, optional)
- `min_score` (double, optional)
- `mmr_lambda` (double, optional)
- `search_scope` (enum, optional)
  - Allowed values: `messages`, `summary`, `facts`
- `search_type` (enum, optional)
  - Allowed values: `similarity`, `mmr`
- `text` (string, optional)

## Response

### 200

A list of SearchResult objects representing the search results.

- `list of apidata.MemorySearchResult`

## Errors

### 404 Not Found Error

Not Found

- `message` (string, optional)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional)

## Types

### apidata.MemorySearchResult

- `message` (apidata.Message, optional)
- `metadata` (map from string to any, optional)
- `score` (double, optional)
- `summary` (apidata.Summary, optional)

### apidata.Message

- `content` (string, required) — The content of the message.
- `role_type` (enum, required) — The type of the role (e.g., "user", "system").
  - Allowed values: `norole`, `system`, `assistant`, `user`, `function`, `tool`
- `created_at` (string, optional) — The timestamp of when the message was created.
- `metadata` (map from string to any, optional) — The metadata associated with the message.
- `processed` (boolean, optional) — Whether the message has been processed.
- `role` (string, optional) — Customizable role of the sender of the message (e.g., "john", "sales_agent").
- `token_count` (integer, optional) — Deprecated
- `updated_at` (string, optional) — Deprecated
- `uuid` (string, optional) — The unique identifier of the message.

### apidata.Summary

- `content` (string, optional) — The content of the summary.
- `created_at` (string, optional) — The timestamp of when the summary was created.
- `metadata` (map from string to any, optional)
- `related_message_uuids` (list of string, optional)
- `token_count` (integer, optional) — The number of tokens in the summary.
- `uuid` (string, optional) — The unique identifier of the summary.

## Examples

**Request**

```json
{}
```

**Response**

```json
[
  {
    "message": {
      "content": "string",
      "role_type": "norole",
      "created_at": "string",
      "metadata": {},
      "processed": true,
      "role": "string",
      "token_count": 1,
      "updated_at": "string",
      "uuid": "string"
    },
    "metadata": {},
    "score": 1.1,
    "summary": {
      "content": "string",
      "created_at": "string",
      "metadata": {},
      "related_message_uuids": [
        "string"
      ],
      "token_count": 1,
      "uuid": "string"
    }
  }
]
```