# Search managed memory entries

Launch stage: Beta

`POST /api/2.0/agents/{parent=memory-stores/*}/entries:search`

Searches managed memory entries by text query for one actor. Returns matching entries and
 scores ranked by relevance; `view` controls whether each returned entry includes content.

API scopes: agent-kit

## Path parameters

- `parent` (string, required)
  Managed memory store whose entries are searched, in the form
   `memory-stores/{managed_memory_store_id}`.

## Request body

- `actor_id` (string, required)
  Customer-provided identifier for the actor whose entries are searched.
- `query` (string, required)
  Free-form search query.
- `limit` (int32, optional, Deprecated)
  Deprecated alias for `page_size`. When both fields are set, their values must match.
- `page_size` (int32, optional)
  Maximum number of relevance-ranked entries to return. Defaults to 10 and must be between 1 and
   100.
- `page_token` (string, optional)
  Reserved for pagination compatibility. The server currently ignores this field because Search
   returns a ranked top-N result set.
- `session_id` (string, optional)
  Optional session identifier. When set, only entries with this exact `session_id` are
   searched. Omitted-session (cross-session) entries are not included.
- `path_prefix` (string, optional)
  Optional absolute, case-sensitive path prefix used to restrict searched entries within the
   actor partition. The prefix must begin with `/` and must not contain empty, `.` or `..`
   segments.

## Returns

Returns a list of ManagedMemoryEntry objects.

## Response

```json
{
  "managed_memory_entries": [
    {
      "name": "string",
      "actor_id": "string",
      "session_id": "string",
      "path": "string",
      "content": "string",
      "description": "string",
      "source_type": "MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT",
      "create_time": "string",
      "update_time": "string"
    }
  ],
  "next_page_token": "string",
  "results": [
    {
      "managed_memory_entry": {},
      "score": 0
    }
  ]
}
```

