curl --request GET \
--url https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/ \
--header 'x-api-key: <api-key>'import requests
url = "https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/', 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://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Error: '123343' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string"
}Retrieve
Searches the RAG system’s knowledge base using a query and returns the most relevant documents based on the specified retrieval method.
curl --request GET \
--url https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/ \
--header 'x-api-key: <api-key>'import requests
url = "https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/', 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://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://rag-prod.studio.lyzr.ai/v3/rag/{rag_id}/retrieve/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Error: '123343' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string"
}Authorizations
Path Parameters
The unique identifier (ID) of the RAG system to query (must be a 24-character hex string).
"654c602a46c3b6d4e28741b0"
Query Parameters
The search query string used to retrieve documents.
"type the necessary query"
The maximum number of top relevant documents to return.
10
Factor for Maximum Marginal Relevance (MMR) trade-off (0.0 to 1.0).
0.6
The retrieval strategy to use.
basic, mmr, hyde, time_aware "basic"
Minimum score required for a document to be included (0.0 to 1.0).
0
Factor for time-aware retrieval to weight newer documents higher.
0.7
Response
Documents successfully retrieved.
Placeholder for the retrieved document structure (typically a list of Document objects with relevance scores).