curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/brain/search \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"top_k": 5,
"shared": true
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', top_k: 5, shared: true})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/brain/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/brain/search"
payload = {
"query": "<string>",
"top_k": 5,
"shared": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){}Search a project's documents
A project’s brain (#663), on every plan, within its plan’s project document allowance (the Workspace Brain’s when the workspace has one); a project hidden from the caller answers 404. Hybrid search (#719) over this project’s documents and, with the Workspace Brain, what other projects shared to the workspace (shared: false leaves those out): passages are ranked by meaning (embeddings) and by their words (a keyword index) and the two lists are merged by reciprocal rank fusion, so each hit’s score is the fused rank score (higher is better), not a cosine similarity. A document is findable by its words as soon as it is ready. A read (viewers may run it) that takes its query as a POST body. Each hit is re-checked against current state, so only ready, included documents return passage text. Each search counts one embedding and a vector query per namespace searched against the allowance; 429 when it is exhausted.
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/brain/search \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"top_k": 5,
"shared": true
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', top_k: 5, shared: true})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/brain/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/brain/search"
payload = {
"query": "<string>",
"top_k": 5,
"shared": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){}Path Parameters
Body
Response
Successful operation
The response is of type object.