Search knowledge cards
curl --request POST \
--url https://aigmented.io/api/v1/collections/{id}/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "What are the payment terms?",
"top_k": 5,
"rerank": true,
"current_only": false
}
'import requests
url = "https://aigmented.io/api/v1/collections/{id}/search"
payload = {
"query": "What are the payment terms?",
"top_k": 5,
"rerank": True,
"current_only": 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({
query: 'What are the payment terms?',
top_k: 5,
rerank: true,
current_only: false
})
};
fetch('https://aigmented.io/api/v1/collections/{id}/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://aigmented.io/api/v1/collections/{id}/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' => 'What are the payment terms?',
'top_k' => 5,
'rerank' => true,
'current_only' => 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://aigmented.io/api/v1/collections/{id}/search"
payload := strings.NewReader("{\n \"query\": \"What are the payment terms?\",\n \"top_k\": 5,\n \"rerank\": true,\n \"current_only\": 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://aigmented.io/api/v1/collections/{id}/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"What are the payment terms?\",\n \"top_k\": 5,\n \"rerank\": true,\n \"current_only\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://aigmented.io/api/v1/collections/{id}/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 \"query\": \"What are the payment terms?\",\n \"top_k\": 5,\n \"rerank\": true,\n \"current_only\": false\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"score": 123,
"content": "<string>",
"metadata": {
"document_id": "<string>",
"file_name": "<string>",
"page": 123,
"chunk_index": 123
}
}
],
"total_results": 123,
"query_time_ms": 123,
"tokens_used": {
"embedding": 123,
"rerank": 123,
"model_id": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Token limit exceeded",
"remaining": 123,
"reason": "<string>"
}{
"error": "<string>"
}Search
Search knowledge cards
Performs a semantic vector search over all knowledge cards in the collection. Optionally applies cross-encoder reranking. Results are proxied from the FastAPI parser service and token usage is tracked.
POST
/
api
/
v1
/
collections
/
{id}
/
search
Search knowledge cards
curl --request POST \
--url https://aigmented.io/api/v1/collections/{id}/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "What are the payment terms?",
"top_k": 5,
"rerank": true,
"current_only": false
}
'import requests
url = "https://aigmented.io/api/v1/collections/{id}/search"
payload = {
"query": "What are the payment terms?",
"top_k": 5,
"rerank": True,
"current_only": 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({
query: 'What are the payment terms?',
top_k: 5,
rerank: true,
current_only: false
})
};
fetch('https://aigmented.io/api/v1/collections/{id}/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://aigmented.io/api/v1/collections/{id}/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' => 'What are the payment terms?',
'top_k' => 5,
'rerank' => true,
'current_only' => 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://aigmented.io/api/v1/collections/{id}/search"
payload := strings.NewReader("{\n \"query\": \"What are the payment terms?\",\n \"top_k\": 5,\n \"rerank\": true,\n \"current_only\": 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://aigmented.io/api/v1/collections/{id}/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"What are the payment terms?\",\n \"top_k\": 5,\n \"rerank\": true,\n \"current_only\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://aigmented.io/api/v1/collections/{id}/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 \"query\": \"What are the payment terms?\",\n \"top_k\": 5,\n \"rerank\": true,\n \"current_only\": false\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"score": 123,
"content": "<string>",
"metadata": {
"document_id": "<string>",
"file_name": "<string>",
"page": 123,
"chunk_index": 123
}
}
],
"total_results": 123,
"query_time_ms": 123,
"tokens_used": {
"embedding": 123,
"rerank": 123,
"model_id": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Token limit exceeded",
"remaining": 123,
"reason": "<string>"
}{
"error": "<string>"
}Authorizations
Pass your API key as a Bearer token. Example: Authorization: Bearer sk-xxxxxxxxxxxx
Path Parameters
Collection ID
Body
application/json
The search query string
Example:
"What are the main risk factors?"
Number of results to return
Required range:
1 <= x <= 100Whether to apply cross-encoder reranking to results
Restrict search to the most current document versions only
Optional metadata filters to narrow the search scope
Example:
{ "document_type": "standard" }
⌘I