Search
REST
Retrieving assembled context over HTTP.
Terminal
curl -X POST https://app.gethivemind.xyz/v3/search \
-H "Authorization: Bearer $HIVEMIND_API_KEY" \
-H "content-type: application/json" \
-d '{
"q": "how often can we deploy?",
"budget": 2000,
"targetTool": "claude-code"
}'json
{
"payload": "--- RETRIEVED MEMORY CONTEXT ---\n[Context 1]: …",
"memoryIds": ["…"],
"candidateCount": 4,
"droppedCount": 3,
"tokensSaved": 148,
"latencyMs": 287
}payload is ready for a prompt. See Retrieval for what
happens between the query and that string.
Parameters
| Default | ||
|---|---|---|
q | required | The query |
budget | 4000 | Hard token ceiling |
sourceRef | none | Where the question is asked from, ranking origin, never a filter |
limit | 10 | Cap on results. Recall keeps climbing past this, raise it deliberately, and watch the token count |
threshold | calibrated | Relevance floor, 0–1 |
searchMode | hybrid | memories, documents, hybrid |
filters | , | Metadata predicate |
rerank | true | Cross-encoder re-scoring. Adds ~100ms; pass false if latency matters more than ordering |
rewriteQuery | false | Also search alternative phrasings |
targetTool | , | Shapes the payload for the receiver |
threadId | , | Boost a thread |
include | , | memories, dropped, trace |
Filters
json
{
"q": "database migrations",
"filters": {
"AND": [
{ "key": "team", "value": "platform" },
{ "key": "priority", "value": 5, "comparator": "gte", "numeric": true }
]
}
}Comparators: eq, ne, gt, gte, lt, lte, contains, in. Nest with
AND and OR; negate inverts; numeric compares as numbers rather than
text.
Empty results are normal
memoryIds is empty when nothing is relevant enough. Check its length rather
than assuming there is always context to inject.