supermemory/apps/docs/v5/api-reference/search.mdx
MaheshtheDev 672defc08b docs: move SDK snippets to the shipped v5 call shape and finish the namespace rename (#1772)
Rewrites 339 TypeScript calls across 50 pages from the rc.5 `method({ namespace, body })` form to the shipped `method(namespace, { ... })` form, and aligns field names with the live v5 spec: `attach` to `include`, `authUrl` to `authorization`, `lastSync` to `latestRun`, `deletedCount` to `count`, and the paginated `namespaces.list()`.

Renames container tags to namespaces across concepts, connectors, integrations and snippets. The namespace pages keep container tag in the description, search keywords and a rename note so old searches still land, and the v3 reference page points at v5.

The migration guide's SDK table now covers both 5.0.0 SDKs, and the SDK integration page uses the real client options (`baseUrl`, `timeoutInSeconds`, `maxRetries`) and error classes.
2026-10-06 17:06:38 +00:00

34 lines
1.3 KiB
Text

---
title: "Search"
sidebarTitle: "Overview"
description: "Recall the most relevant memories and source context"
icon: "/icons/hugeicons/book-open-01.svg"
---
`POST /ns/{namespace}/search` recalls the most useful memories and source chunks for a query. Hybrid search combines both by default; set `searchMode` to `memories` or `chunks` when your experience needs one result type.
Every option goes in the JSON request body: `query`, `searchMode`, `limit`, `threshold`, `filter`, `include`, `rerank`, and `rewriteQuery`.
<CodeGroup>
```ts TypeScript
const { results, searchTime } = await client.search("user_1", {
query: "What did the user decide about the launch?",
limit: 10,
})
```
```python Python
response = client.search("user_1", query="What did the user decide about the launch?", limit=10)
```
```bash curl
curl -X POST "https://api.supermemory.ai/ns/user_1/search" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"What did the user decide about the launch?","limit":10}'
```
</CodeGroup>
Two defaults differ from the legacy API: `searchMode` defaults to `hybrid` (legacy `memories`) and `threshold` defaults to `0.3` (legacy `0.6`). Pass both explicitly if you need legacy-equivalent results.
See [search migration](/migration/api-v5-recall) and [typed filter migration](/migration/api-v5-filters).