Search Knowledge Graph
curl --request POST \
--url {protocol}://{domain}/api/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"labelIds": [],
"limit": 500,
"maxBfsDepth": 5,
"includeInvalidated": false,
"entityTypes": [
"<string>"
],
"scoreThreshold": 0.5,
"minResults": 2
}
'import requests
url = "{protocol}://{domain}/api/v1/search"
payload = {
"query": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"labelIds": [],
"limit": 500,
"maxBfsDepth": 5,
"includeInvalidated": False,
"entityTypes": ["<string>"],
"scoreThreshold": 0.5,
"minResults": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
startTime: '2023-11-07T05:31:56Z',
endTime: '2023-11-07T05:31:56Z',
labelIds: [],
limit: 500,
maxBfsDepth: 5,
includeInvalidated: false,
entityTypes: ['<string>'],
scoreThreshold: 0.5,
minResults: 2
})
};
fetch('{protocol}://{domain}/api/v1/search', 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 => "{protocol}://{domain}/api/v1/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'startTime' => '2023-11-07T05:31:56Z',
'endTime' => '2023-11-07T05:31:56Z',
'labelIds' => [
],
'limit' => 500,
'maxBfsDepth' => 5,
'includeInvalidated' => false,
'entityTypes' => [
'<string>'
],
'scoreThreshold' => 0.5,
'minResults' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{protocol}://{domain}/api/v1/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"labelIds\": [],\n \"limit\": 500,\n \"maxBfsDepth\": 5,\n \"includeInvalidated\": false,\n \"entityTypes\": [\n \"<string>\"\n ],\n \"scoreThreshold\": 0.5,\n \"minResults\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("{protocol}://{domain}/api/v1/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"labelIds\": [],\n \"limit\": 500,\n \"maxBfsDepth\": 5,\n \"includeInvalidated\": false,\n \"entityTypes\": [\n \"<string>\"\n ],\n \"scoreThreshold\": 0.5,\n \"minResults\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("{protocol}://{domain}/api/v1/search")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"labelIds\": [],\n \"limit\": 500,\n \"maxBfsDepth\": 5,\n \"includeInvalidated\": false,\n \"entityTypes\": [\n \"<string>\"\n ],\n \"scoreThreshold\": 0.5,\n \"minResults\": 2\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"content": "<string>",
"score": 123,
"metadata": {}
}
]
}{
"error": "<string>",
"error_description": "<string>",
"details": [
{}
]
}Memory
Search Knowledge Graph
Perform advanced semantic search with graph traversal capabilities. Supports temporal filtering, entity type filtering, and relevance scoring.
POST
/
api
/
v1
/
search
Search Knowledge Graph
curl --request POST \
--url {protocol}://{domain}/api/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"labelIds": [],
"limit": 500,
"maxBfsDepth": 5,
"includeInvalidated": false,
"entityTypes": [
"<string>"
],
"scoreThreshold": 0.5,
"minResults": 2
}
'import requests
url = "{protocol}://{domain}/api/v1/search"
payload = {
"query": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"labelIds": [],
"limit": 500,
"maxBfsDepth": 5,
"includeInvalidated": False,
"entityTypes": ["<string>"],
"scoreThreshold": 0.5,
"minResults": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
startTime: '2023-11-07T05:31:56Z',
endTime: '2023-11-07T05:31:56Z',
labelIds: [],
limit: 500,
maxBfsDepth: 5,
includeInvalidated: false,
entityTypes: ['<string>'],
scoreThreshold: 0.5,
minResults: 2
})
};
fetch('{protocol}://{domain}/api/v1/search', 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 => "{protocol}://{domain}/api/v1/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'startTime' => '2023-11-07T05:31:56Z',
'endTime' => '2023-11-07T05:31:56Z',
'labelIds' => [
],
'limit' => 500,
'maxBfsDepth' => 5,
'includeInvalidated' => false,
'entityTypes' => [
'<string>'
],
'scoreThreshold' => 0.5,
'minResults' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{protocol}://{domain}/api/v1/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"labelIds\": [],\n \"limit\": 500,\n \"maxBfsDepth\": 5,\n \"includeInvalidated\": false,\n \"entityTypes\": [\n \"<string>\"\n ],\n \"scoreThreshold\": 0.5,\n \"minResults\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("{protocol}://{domain}/api/v1/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"labelIds\": [],\n \"limit\": 500,\n \"maxBfsDepth\": 5,\n \"includeInvalidated\": false,\n \"entityTypes\": [\n \"<string>\"\n ],\n \"scoreThreshold\": 0.5,\n \"minResults\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("{protocol}://{domain}/api/v1/search")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"labelIds\": [],\n \"limit\": 500,\n \"maxBfsDepth\": 5,\n \"includeInvalidated\": false,\n \"entityTypes\": [\n \"<string>\"\n ],\n \"scoreThreshold\": 0.5,\n \"minResults\": 2\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"content": "<string>",
"score": 123,
"metadata": {}
}
]
}{
"error": "<string>",
"error_description": "<string>",
"details": [
{}
]
}Authorizations
Bearer token authentication supports:
- Personal API tokens (PATs)
- OAuth2 access tokens
- JWT tokens
Example: Authorization: Bearer your_token_here
Body
application/json
Search query text
Filter facts after this timestamp
Filter facts before this timestamp
Filter results to specific labels
Maximum number of results
Required range:
1 <= x <= 1000Maximum graph traversal depth
Required range:
1 <= x <= 10Include invalidated facts
Filter by entity types
Minimum relevance score
Required range:
0 <= x <= 1Minimum number of results to return
Required range:
x >= 1Response
Search results
Show child attributes
Show child attributes
Was this page helpful?
⌘I
