---
title: "Search memories"
method: POST
path: "/search"
tags: ["Search & chat"]
---

# Search memories

`POST /search`

## Request

- Base URL: `https://api.mymemory.dev/v1`
- URL: `https://api.mymemory.dev/v1/search`
- Auth: HTTP bearer

Hybrid search: semantic similarity plus keyword matching (including Chinese, Japanese, Korean and Thai, which don't separate words with spaces). Results are grouped per memory, best first.

## Request body

- object
  - `query` string, required: What to look for. Short keyword queries work too.
  - `limit` integer
  - `threshold` number: Minimum similarity for a meaning-only match. Leave it out: the default is tuned for the current embedding model. Keyword matches are kept below it.
  - `spaces` string[]: Only search these spaces (`uuid` from `GET /spaces`).
  - `before` string, date-time: Only memories on or before this date.
  - `after` string, date-time: Only memories on or after this date.
  - `recencyBias` number: 0 ranks purely by relevance; higher values favour recent memories.
  - `spaceId` union: Same as `spaces`; accepted for convenience. One ID or a list.
    - string
    - string[]

## Response `200`

Matching memories

- SearchResponse
  - `results` SearchResult[], required
    - `uuid` string: The memory's ID. Pass it to `/memories/{id}`.
    - `id` integer: Internal numeric ID. Use `uuid` instead.
    - `title` string, nullable
    - `description` string, nullable
    - `content` string: The memory's full text.
    - `type` string
    - `url` string, nullable
    - `ogImage` string, nullable
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `userId` integer
    - `similarity` number: Semantic similarity of the best-matching chunk, 0–1.
    - `matchType` 'hybrid' | 'keyword' | 'semantic': `keyword`: the words matched. `semantic`: the meaning matched. `hybrid`: both.
    - `matchingChunk` object: The passage that matched best.
      - `id` integer
      - `content` string
      - `orderInDocument` integer
      - `metadata` object, nullable
    - `outdated` object, nullable: Set when a newer memory replaced a fact in this one. Such results are moved a few places down.
  - `retrievalEventId` string: ID of this search, for feedback and debugging.
  - `embeddingModel` string: Which embedding model served the search.
  - `widenSuggestion` object, nullable: Only when a date range returned nothing: how many results the same query finds without the dates.
    - `unfilteredCount` integer
    - `capped` boolean
  - `ignoredFields` string[]: Body fields this endpoint doesn't know and ignored (for example a misspelled filter). Absent when there are none.

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `403`: Not allowed: someone else's memory or space, or a plan limit reached (`Memory limit reached`, `Space limit reached`)
- `429`: Too many requests. For a rate limit (`error`: `rate_limited`), wait the seconds in the `Retry-After` header; for an AI budget error, until the budget renews.

---

[API](https://skmtc.dev/mymemory/apis/mymemory-api.md) · [All operations](https://skmtc.dev/mymemory/apis/mymemory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mymemory/apis/mymemory-api/revisions/a6cdb469f9e8?raw)
