Brain
Get brain runtime status
Operator view of the brain runtime, models, service health, and projection lag.
GET
/
v1
/
brain
/
status
Get brain runtime status
curl --request GET \
--url https://api.usenaive.ai/v1/brain/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usenaive.ai/v1/brain/status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usenaive.ai/v1/brain/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usenaive.ai/v1/brain/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usenaive.ai/v1/brain/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usenaive.ai/v1/brain/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenaive.ai/v1/brain/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"provider": "<string>",
"models": {
"embedding": "<string>",
"embedding_dim": 123,
"reranker": "<string>",
"answer": "<string>"
},
"services": {
"embedding": {
"name": "<string>",
"configured": true,
"ok": true,
"latency_ms": 123,
"error": "<string>"
},
"answerer": {
"name": "<string>",
"configured": true,
"ok": true,
"latency_ms": 123,
"error": "<string>",
"synthesis_failures_since_boot": 123,
"optional": true
},
"reranker": {
"name": "<string>",
"configured": true,
"ok": true,
"latency_ms": 123,
"error": "<string>",
"optional": true
},
"gbrain": {
"name": "<string>",
"configured": true,
"ok": true,
"details": {}
}
},
"knowledge_bases": {
"total": 123,
"by_status": {},
"items": [
{
"id": "<string>",
"name": "<string>",
"provider": "<string>",
"status": "<string>",
"is_default": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
},
"documents": {
"total": 123,
"by_status": {},
"recent": [
{
"id": "<string>",
"knowledge_base_id": "<string>",
"filename": "<string>",
"source": "<string>",
"source_url": "<string>",
"status": "<string>",
"bytes": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
},
"projection": {
"pending": 123,
"failed": 123,
"oldestPendingAt": "2023-11-07T05:31:56Z",
"gbrainConfigured": true
},
"ready": true,
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"hint": "<string>",
"reason": "<string>"
}
}Authorizations
Workspace API key. Create one via the dashboard or POST /v1/auth/keys.
Response
Brain runtime status
The configured preference, not what is running. Defaults to postgres. Whether a semantic engine is actually in the read path is services.gbrain.configured.
Available options:
postgres, gbrain Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
True when the embedding service is up, the projection queue has no failures, and - only if a semantic engine is configured - that engine is healthy. The answerer and the reranker are excluded on purpose: both are optional and a query still answers without them.
⌘I
Get brain runtime status
curl --request GET \
--url https://api.usenaive.ai/v1/brain/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usenaive.ai/v1/brain/status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usenaive.ai/v1/brain/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usenaive.ai/v1/brain/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usenaive.ai/v1/brain/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usenaive.ai/v1/brain/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenaive.ai/v1/brain/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"provider": "<string>",
"models": {
"embedding": "<string>",
"embedding_dim": 123,
"reranker": "<string>",
"answer": "<string>"
},
"services": {
"embedding": {
"name": "<string>",
"configured": true,
"ok": true,
"latency_ms": 123,
"error": "<string>"
},
"answerer": {
"name": "<string>",
"configured": true,
"ok": true,
"latency_ms": 123,
"error": "<string>",
"synthesis_failures_since_boot": 123,
"optional": true
},
"reranker": {
"name": "<string>",
"configured": true,
"ok": true,
"latency_ms": 123,
"error": "<string>",
"optional": true
},
"gbrain": {
"name": "<string>",
"configured": true,
"ok": true,
"details": {}
}
},
"knowledge_bases": {
"total": 123,
"by_status": {},
"items": [
{
"id": "<string>",
"name": "<string>",
"provider": "<string>",
"status": "<string>",
"is_default": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
},
"documents": {
"total": 123,
"by_status": {},
"recent": [
{
"id": "<string>",
"knowledge_base_id": "<string>",
"filename": "<string>",
"source": "<string>",
"source_url": "<string>",
"status": "<string>",
"bytes": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
},
"projection": {
"pending": 123,
"failed": 123,
"oldestPendingAt": "2023-11-07T05:31:56Z",
"gbrainConfigured": true
},
"ready": true,
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"hint": "<string>",
"reason": "<string>"
}
}