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.

curl -X POST https://v2.api.supermemory.ai/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "What is the capital of France?",
    "rewriteQuery": true
  }'

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.