Retrieve Memory
curl --request GET \
--url https://api.duohub.ai/memory/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.duohub.ai/memory/"
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://api.duohub.ai/memory/', 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.duohub.ai/memory/",
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://api.duohub.ai/memory/"
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://api.duohub.ai/memory/")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.duohub.ai/memory/")
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{
"payload": [
{
"content": "The capital of France is Paris.",
"score": 1
}
],
"facts": [
{
"content": "Paris is the capital of France"
},
{
"content": "Paris has been France's capital since 987 CE"
},
{
"content": "Paris is located in northern France"
}
],
"sources": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Wikipedia",
"url": "https://en.wikipedia.org/wiki/Paris",
"score": 1
}
]
}{
"detail": "API key is required"
}{
"detail": "Error retrieving memory"
}Retriever API
Retrieve Memory Payload
Retrieve assisted or non-assisted memory from the knowledge graph
GET
/
memory
/
Retrieve Memory
curl --request GET \
--url https://api.duohub.ai/memory/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.duohub.ai/memory/"
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://api.duohub.ai/memory/', 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.duohub.ai/memory/",
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://api.duohub.ai/memory/"
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://api.duohub.ai/memory/")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.duohub.ai/memory/")
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{
"payload": [
{
"content": "The capital of France is Paris.",
"score": 1
}
],
"facts": [
{
"content": "Paris is the capital of France"
},
{
"content": "Paris has been France's capital since 987 CE"
},
{
"content": "Paris is located in northern France"
}
],
"sources": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Wikipedia",
"url": "https://en.wikipedia.org/wiki/Paris",
"score": 1
}
]
}{
"detail": "API key is required"
}{
"detail": "Error retrieving memory"
}Authorizations
Your duohub API key. Type: str
Query Parameters
Unique identifier for the knowledge graph memory to query
The question or query to search for in the knowledge graph
When true, uses AI to assist in retrieving and formatting the response. When false, returns raw memory matches.
When true, returns three supporting facts from the knowledge graph along with the response
The number of top memories to return
Response
Memory retrieved successfully