---
title: "Search memories by natural language query"
method: POST
path: "/api/memory/search"
tags: ["Memory"]
---

# Search memories by natural language query

`POST /api/memory/search`

## Request body

- object
  - `query` string, required
  - `intent` string — Why you are searching. Required for agent recall-edge tracking; omit for UI browse/search calls.
  - `limit` integer
  - `scope` 'agent' | 'swarm' | 'all'
  - `source` 'manual' | 'file_index' | 'session_summary' | 'task_completion'

## Response `200`

Search results

- object
  - `results` object[], required
    - `id` string, required
    - `name` string, required
    - `content` string, required
    - `similarity` number, required
    - `rawSimilarity` number
    - `compositeScore` number
    - `retrievalSource` 'vec' | 'fts' | 'hybrid' | 'fallback' | 'graph'
    - `source` 'manual' | 'file_index' | 'session_summary' | 'task_completion', required
    - `scope` 'agent' | 'swarm', required
    - `tags` string[], required
    - `accessCount` number, required

## Other responses

- `400` — Missing query or agent ID

## Changes

- **2026-09-03** `99361914bb4a` — 1 info
  - added the required property `results/items/accessCount` to the response with the `200` status
- **2026-08-07** `06cac6a7c5bc` — 2 info
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `400`

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/memory/search/post.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/6b1a7f0876b9/schema)
