Search Agent Knowledge Base
curl --request POST \
--url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vector": [
123
],
"searchQuery": "<string>",
"vectorDb": "postgres",
"defaultDimension": 1536,
"max_chunks": 5,
"similarity_threshold": 0,
"with_payload": true,
"with_vector": false
}
'import requests
url = "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search"
payload = {
"vector": [123],
"searchQuery": "<string>",
"vectorDb": "postgres",
"defaultDimension": 1536,
"max_chunks": 5,
"similarity_threshold": 0,
"with_payload": True,
"with_vector": False
}
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({
vector: [123],
searchQuery: '<string>',
vectorDb: 'postgres',
defaultDimension: 1536,
max_chunks: 5,
similarity_threshold: 0,
with_payload: true,
with_vector: false
})
};
fetch('https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/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 => "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/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([
'vector' => [
123
],
'searchQuery' => '<string>',
'vectorDb' => 'postgres',
'defaultDimension' => 1536,
'max_chunks' => 5,
'similarity_threshold' => 0,
'with_payload' => true,
'with_vector' => false
]),
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 := "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search"
payload := strings.NewReader("{\n \"vector\": [\n 123\n ],\n \"searchQuery\": \"<string>\",\n \"vectorDb\": \"postgres\",\n \"defaultDimension\": 1536,\n \"max_chunks\": 5,\n \"similarity_threshold\": 0,\n \"with_payload\": true,\n \"with_vector\": false\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("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vector\": [\n 123\n ],\n \"searchQuery\": \"<string>\",\n \"vectorDb\": \"postgres\",\n \"defaultDimension\": 1536,\n \"max_chunks\": 5,\n \"similarity_threshold\": 0,\n \"with_payload\": true,\n \"with_vector\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"vector\": [\n 123\n ],\n \"searchQuery\": \"<string>\",\n \"vectorDb\": \"postgres\",\n \"defaultDimension\": 1536,\n \"max_chunks\": 5,\n \"similarity_threshold\": 0,\n \"with_payload\": true,\n \"with_vector\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": [
{
"id": "<string>",
"namespace": "<string>",
"payload": {
"text": "<string>",
"chunk_index": 123,
"doc_id": "<string>",
"doc_name": "<string>",
"url": "<string>",
"urlDescription": "<string>"
},
"vector": [
123
],
"tags": [
"<string>"
],
"similarity": 123
}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Knowledge Base
Search KB
(Convocore agents only) Searches an agent knowledge base with either a text query or a precomputed embedding vector. This route must use the new V3 endpoints.
POST
/
agents
/
{agentId}
/
kb
/
search
Search Agent Knowledge Base
curl --request POST \
--url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vector": [
123
],
"searchQuery": "<string>",
"vectorDb": "postgres",
"defaultDimension": 1536,
"max_chunks": 5,
"similarity_threshold": 0,
"with_payload": true,
"with_vector": false
}
'import requests
url = "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search"
payload = {
"vector": [123],
"searchQuery": "<string>",
"vectorDb": "postgres",
"defaultDimension": 1536,
"max_chunks": 5,
"similarity_threshold": 0,
"with_payload": True,
"with_vector": False
}
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({
vector: [123],
searchQuery: '<string>',
vectorDb: 'postgres',
defaultDimension: 1536,
max_chunks: 5,
similarity_threshold: 0,
with_payload: true,
with_vector: false
})
};
fetch('https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/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 => "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/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([
'vector' => [
123
],
'searchQuery' => '<string>',
'vectorDb' => 'postgres',
'defaultDimension' => 1536,
'max_chunks' => 5,
'similarity_threshold' => 0,
'with_payload' => true,
'with_vector' => false
]),
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 := "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search"
payload := strings.NewReader("{\n \"vector\": [\n 123\n ],\n \"searchQuery\": \"<string>\",\n \"vectorDb\": \"postgres\",\n \"defaultDimension\": 1536,\n \"max_chunks\": 5,\n \"similarity_threshold\": 0,\n \"with_payload\": true,\n \"with_vector\": false\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("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vector\": [\n 123\n ],\n \"searchQuery\": \"<string>\",\n \"vectorDb\": \"postgres\",\n \"defaultDimension\": 1536,\n \"max_chunks\": 5,\n \"similarity_threshold\": 0,\n \"with_payload\": true,\n \"with_vector\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"vector\": [\n 123\n ],\n \"searchQuery\": \"<string>\",\n \"vectorDb\": \"postgres\",\n \"defaultDimension\": 1536,\n \"max_chunks\": 5,\n \"similarity_threshold\": 0,\n \"with_payload\": true,\n \"with_vector\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": [
{
"id": "<string>",
"namespace": "<string>",
"payload": {
"text": "<string>",
"chunk_index": 123,
"doc_id": "<string>",
"doc_name": "<string>",
"url": "<string>",
"urlDescription": "<string>"
},
"vector": [
123
],
"tags": [
"<string>"
],
"similarity": 123
}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Example: Search with Text
{
"searchQuery": "refund policy for annual subscriptions",
"max_chunks": 3,
"with_payload": true
}
Example: Search with a Vector
{
"vector": [0.12, -0.03, 0.91],
"vectorDb": "postgres",
"max_chunks": 5,
"similarity_threshold": 0.2
}
Use
searchQuery for most requests. The API will create the embedding for you and search the agent KB automatically.Results are chunk-level matches, so a single source document may appear multiple times if several chunks are relevant.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Minimum string length:
1Available options:
firebase, postgres Required range:
x > 0Required range:
1 <= x <= 100Required range:
0 <= x <= 1⌘I
