---
title: "POST /v2/memories/search/"
method: POST
path: "/v2/memories/search/"
tags: ["memories"]
---

# POST /v2/memories/search/

`POST /v2/memories/search/`

Search memories based on a query and filters.

## Request body

- MemorySearchInputV2
  - `query` string, required — The query to search for in the memory.
  - `version` string — The version of the memory to use. This should always be v2.
  - `filters` object, required — A dictionary of filters to apply to the search. Available fields are: user_id, agent_id, app_id, run_id, created_at, updated_at, categories, keywords. Supports logical operators (AND, OR) and comparison operators (in, gte, lte, gt, lt, ne, contains, icontains).
    - `user_id` string
    - `agent_id` string
    - `app_id` string
    - `run_id` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `text` string
    - `categories` string[]
    - `metadata` object
  - `top_k` integer — The number of top results to return.
  - `fields` string[] — A list of field names to include in the response. If not provided, all fields will be returned.
  - `rerank` boolean — Whether to rerank the memories.
  - `keyword_search` boolean — Whether to search for memories based on keywords.
  - `filter_memories` boolean — Whether to filter the memories.
  - `threshold` number — The minimum similarity threshold for returned results.
  - `org_id` string, nullable — The unique identifier of the organization associated with the memory.
  - `project_id` string, nullable — The unique identifier of the project associated with the memory.

## Response `200`

- object[]
  - `id` string, uuid, required — Unique identifier for the memory
  - `memory` string, required — The content of the memory
  - `user_id` string, required — The identifier of the user associated with this memory
  - `metadata` object, nullable — Additional metadata associated with the memory
  - `categories` string[] — Categories associated with the memory
  - `immutable` boolean — Whether the memory is immutable.
  - `expiration_date` string, date-time, nullable — The date and time when the memory will expire. Format: YYYY-MM-DD
  - `created_at` string, date-time, required — The timestamp when the memory was created
  - `updated_at` string, date-time, required — The timestamp when the memory was last updated

---

[API](https://skmtc.dev/thuir/apis/mem0-api-docs.md) · [All operations](https://skmtc.dev/thuir/apis/mem0-api-docs/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/thuir/mem0-api-docs/revisions/f569857d13db/schema)
