curl --request POST \
--url https://www.memoryplugin.com/api/chat-history/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "how to set up authentication",
"limit": 20,
"provider": "all",
"contextChunks": 4,
"skipRerank": false
}
'import requests
url = "https://www.memoryplugin.com/api/chat-history/search"
payload = {
"query": "how to set up authentication",
"limit": 20,
"provider": "all",
"contextChunks": 4,
"skipRerank": 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: 'how to set up authentication',
limit: 20,
provider: 'all',
contextChunks: 4,
skipRerank: false
})
};
fetch('https://www.memoryplugin.com/api/chat-history/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://www.memoryplugin.com/api/chat-history/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' => 'how to set up authentication',
'limit' => 20,
'provider' => 'all',
'contextChunks' => 4,
'skipRerank' => 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://www.memoryplugin.com/api/chat-history/search"
payload := strings.NewReader("{\n \"query\": \"how to set up authentication\",\n \"limit\": 20,\n \"provider\": \"all\",\n \"contextChunks\": 4,\n \"skipRerank\": 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://www.memoryplugin.com/api/chat-history/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"how to set up authentication\",\n \"limit\": 20,\n \"provider\": \"all\",\n \"contextChunks\": 4,\n \"skipRerank\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.memoryplugin.com/api/chat-history/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\": \"how to set up authentication\",\n \"limit\": 20,\n \"provider\": \"all\",\n \"contextChunks\": 4,\n \"skipRerank\": false\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"conversationId": "<string>",
"title": "<string>",
"text": "<string>",
"score": 123,
"timestamp": "2023-11-07T05:31:56Z",
"sender": "human",
"context": [
{
"text": "<string>",
"sender": "<string>",
"timestamp": "<string>"
}
]
}
],
"totalResults": 123,
"query": "<string>",
"provider": "<string>",
"processingTime": 123
}{
"error": "<string>",
"text": "<string>",
"score": 123
}{
"error": "<string>",
"text": "<string>",
"score": 123
}Search Chat History
Perform raw semantic search across all imported chat conversations. Returns matched chunks with scores and surrounding context. For most use cases, use the Recall endpoint (POST /api/chat-history/inject) instead — it performs search and AI synthesis in one step.
curl --request POST \
--url https://www.memoryplugin.com/api/chat-history/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "how to set up authentication",
"limit": 20,
"provider": "all",
"contextChunks": 4,
"skipRerank": false
}
'import requests
url = "https://www.memoryplugin.com/api/chat-history/search"
payload = {
"query": "how to set up authentication",
"limit": 20,
"provider": "all",
"contextChunks": 4,
"skipRerank": 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: 'how to set up authentication',
limit: 20,
provider: 'all',
contextChunks: 4,
skipRerank: false
})
};
fetch('https://www.memoryplugin.com/api/chat-history/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://www.memoryplugin.com/api/chat-history/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' => 'how to set up authentication',
'limit' => 20,
'provider' => 'all',
'contextChunks' => 4,
'skipRerank' => 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://www.memoryplugin.com/api/chat-history/search"
payload := strings.NewReader("{\n \"query\": \"how to set up authentication\",\n \"limit\": 20,\n \"provider\": \"all\",\n \"contextChunks\": 4,\n \"skipRerank\": 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://www.memoryplugin.com/api/chat-history/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"how to set up authentication\",\n \"limit\": 20,\n \"provider\": \"all\",\n \"contextChunks\": 4,\n \"skipRerank\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.memoryplugin.com/api/chat-history/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\": \"how to set up authentication\",\n \"limit\": 20,\n \"provider\": \"all\",\n \"contextChunks\": 4,\n \"skipRerank\": false\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"conversationId": "<string>",
"title": "<string>",
"text": "<string>",
"score": 123,
"timestamp": "2023-11-07T05:31:56Z",
"sender": "human",
"context": [
{
"text": "<string>",
"sender": "<string>",
"timestamp": "<string>"
}
]
}
],
"totalResults": 123,
"query": "<string>",
"provider": "<string>",
"processingTime": 123
}{
"error": "<string>",
"text": "<string>",
"score": 123
}{
"error": "<string>",
"text": "<string>",
"score": 123
}Overview
Perform semantic search across all imported chat conversations. This endpoint uses hybrid vector + keyword search with AI reranking for high relevance results.How it works
- Your query is embedded and compared against all conversation chunks using vector similarity
- Results are enriched with surrounding context messages
- An AI reranker scores and orders results by relevance (can be skipped for faster responses)
Example
curl -X POST https://www.memoryplugin.com/api/chat-history/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "how to set up authentication",
"limit": 10,
"provider": "all"
}'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The search query. Semantic search is performed across all imported conversations.
"how to set up authentication"
Maximum number of results to return.
1 <= x <= 100Filter results by platform. 'all' searches everything, or specify a platform ID (e.g., 'chatgpt', 'claude', 'custom').
Number of surrounding message chunks to include for context around each result.
Skip the AI reranking step. Faster but potentially less relevant ordering.
Was this page helpful?