Search Memories
curl --request POST \
--url https://api.memoclaw.com/v1/search \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"limit": 123,
"namespace": "<string>",
"memory_type": "<string>",
"tags": [
"<string>"
],
"session_id": "<string>",
"agent_id": "<string>"
}
'import requests
url = "https://api.memoclaw.com/v1/search"
payload = {
"query": "<string>",
"limit": 123,
"namespace": "<string>",
"memory_type": "<string>",
"tags": ["<string>"],
"session_id": "<string>",
"agent_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
limit: 123,
namespace: '<string>',
memory_type: '<string>',
tags: ['<string>'],
session_id: '<string>',
agent_id: '<string>'
})
};
fetch('https://api.memoclaw.com/v1/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://api.memoclaw.com/v1/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' => '<string>',
'limit' => 123,
'namespace' => '<string>',
'memory_type' => '<string>',
'tags' => [
'<string>'
],
'session_id' => '<string>',
'agent_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.memoclaw.com/v1/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.memoclaw.com/v1/search")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"memories": [
{
"id": "<string>",
"content": "<string>",
"importance": 123,
"memory_type": "<string>",
"namespace": "<string>",
"tags": [
"<string>"
],
"created_at": "<string>"
}
],
"total": 123,
"query": "<string>"
}API Reference
Search Memories
POST /v1/search — Full-text search without embedding costs.
POST
/
v1
/
search
Search Memories
curl --request POST \
--url https://api.memoclaw.com/v1/search \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"limit": 123,
"namespace": "<string>",
"memory_type": "<string>",
"tags": [
"<string>"
],
"session_id": "<string>",
"agent_id": "<string>"
}
'import requests
url = "https://api.memoclaw.com/v1/search"
payload = {
"query": "<string>",
"limit": 123,
"namespace": "<string>",
"memory_type": "<string>",
"tags": ["<string>"],
"session_id": "<string>",
"agent_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
limit: 123,
namespace: '<string>',
memory_type: '<string>',
tags: ['<string>'],
session_id: '<string>',
agent_id: '<string>'
})
};
fetch('https://api.memoclaw.com/v1/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://api.memoclaw.com/v1/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' => '<string>',
'limit' => 123,
'namespace' => '<string>',
'memory_type' => '<string>',
'tags' => [
'<string>'
],
'session_id' => '<string>',
'agent_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.memoclaw.com/v1/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.memoclaw.com/v1/search")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"memories": [
{
"id": "<string>",
"content": "<string>",
"importance": 123,
"memory_type": "<string>",
"namespace": "<string>",
"tags": [
"<string>"
],
"created_at": "<string>"
}
],
"total": 123,
"query": "<string>"
}This endpoint requires wallet authentication for identity. It is free — no payment required.
/v1/recall when you don’t need semantic embeddings or want to reduce costs.
This endpoint uses PostgreSQL full-text search (tsvector) rather than vector similarity, making it faster and free from embedding API costs.
Request Body
string
required
Search query string. Max 1,000 characters.
number
Maximum number of results. Default:
10. Max: 100.string
Filter by namespace.
string
Filter by memory type:
correction, preference, decision, project, observation, or general.string[]
Filter by tags.
string
Filter by session ID.
string
Filter by agent ID.
Response (200 OK)
array
number
Total number of matches.
string
The search query used.
When to Use Search vs Recall
| Use Case | Endpoint |
|---|---|
| Natural language semantic search | /v1/recall |
| Keyword/exact match search | /v1/search |
| Need vector similarity scoring | /v1/recall |
| Reduce embedding API costs | /v1/search |
| Find memories with specific words | /v1/search |
Example
curl -X POST https://api.memoclaw.com/v1/search \
-H "Content-Type: application/json" \
-H "x-wallet-auth: 0xYourWallet:1699900000:0xSignature..." \
-d '{
"query": "dark mode preferences",
"limit": 10,
"tags": ["preferences"]
}'
const response = await fetch("https://api.memoclaw.com/v1/search", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-wallet-auth": await getAuthHeader(),
},
body: JSON.stringify({
query: "dark mode preferences",
limit: 10,
tags: ["preferences"],
}),
});
const data = await response.json();
from memoclaw import MemoClaw
client = MemoClaw()
result = client.search(
query="dark mode preferences",
limit=10,
tags=["preferences"],
)
for m in result.memories:
print(f"[{m.id}] {m.content}")
import { MemoClawClient } from "memoclaw";
const client = new MemoClawClient();
const result = await client.search({
query: "dark mode preferences",
limit: 10,
tags: ["preferences"],
});
result.memories.forEach(m => {
console.log(`[${m.id}] ${m.content}`);
});
Response
{
"memories": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"content": "User prefers dark mode",
"importance": 0.8,
"memory_type": "preference",
"namespace": "default",
"tags": ["preferences", "ui"],
"created_at": "2026-02-13T10:30:00Z"
}
],
"total": 1,
"query": "dark mode preferences"
}
⌘I