mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-04-30 20:49:56 +00:00
migrate docs to public
This commit is contained in:
parent
697315b9dc
commit
2093b316d9
121 changed files with 20188 additions and 0 deletions
50
apps/docs/memory-api/features/query-rewriting.mdx
Normal file
50
apps/docs/memory-api/features/query-rewriting.mdx
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
title: "Query Rewriting"
|
||||
description: "Query Rewriting in supermemory"
|
||||
icon: "blend"
|
||||
---
|
||||
|
||||
Query Rewriting is a feature that allows you to rewrite queries to make them more accurate.
|
||||
|
||||

|
||||
|
||||
### Usage
|
||||
|
||||
In supermemory, you can enable query rewriting by setting the `rewriteQuery` parameter to `true` in the search API.
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```bash cURL
|
||||
curl https://api.supermemory.ai/v3/search \
|
||||
--request POST \
|
||||
--header 'Authorization: Bearer SUPERMEMORY_API_KEY' \
|
||||
--header 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"q": "What is the capital of France?",
|
||||
"rewriteQuery": true
|
||||
}'
|
||||
```
|
||||
|
||||
```typescript
|
||||
await client.search.create({
|
||||
q: "What is the capital of France?",
|
||||
rewriteQuery: true,
|
||||
});
|
||||
```
|
||||
|
||||
```python
|
||||
client.search.create(
|
||||
q="What is the capital of France?",
|
||||
rewriteQuery=True
|
||||
)
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
### Notes and limitations
|
||||
|
||||
- supermemory generates multiple rewrites, and runs the search through all of them.
|
||||
- The results are then merged and returned to you.
|
||||
- There is no additional costs associated with query rewriting.
|
||||
- While query rewriting makes the quality much better, it also **incurs additional latency**.
|
||||
- All other features like filtering, hybrid search, recency bias, etc. work with rewritten results as well.
|
||||
Loading…
Add table
Add a link
Reference in a new issue