POST /v1/memories adds a memory, and POST /v1/search and POST /v1/answer find it again. Add end_user_id (any stable id you already use) to keep a separate library for each of your users, or leave it off to use your own. The first add, search or answer with a new id creates that library.
Store#
The example below stores a note. To retain a conversation's speakers and corrections, send messages instead of text; see Conversation snapshots. Answers distinguish numbered citations from retrieved context using sources[].cited and return the supporting line and turn coordinates.
Request
curl -X POST https://api.fryri.com/v1/memories \
-H "Authorization: Bearer $FRYRI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Project Atlas uses Python and FastAPI. The launch review is on 14 October.",
"title": "Project Atlas notes",
"source_ref": "crm:note:881",
"end_user_id": "user_42"
}'Response
{
"id": "file_NkolfLrElMmM2fCn",
"type": "text",
"title": "Project Atlas notes",
"status": "processing",
"status_reason": null,
"created_at": "2026-09-25T09:02:54.915644Z",
"source_ref": "crm:note:881",
"sha256": "886d5886b41216cf0dc8e2234f4ffb24cb5666425200e5e2c5ee33d841b91be4",
"duplicate": false,
"replaced": []
}Wait until it is ready#
Request
curl "https://api.fryri.com/v1/memories/file_NkolfLrElMmM2fCn?end_user_id=user_42" \
-H "Authorization: Bearer $FRYRI_API_KEY"Response
{
"id": "file_NkolfLrElMmM2fCn",
"type": "text",
"title": "Project Atlas notes",
"status": "ready",
"status_reason": null,
"created_at": "2026-09-25T09:02:54.915644Z",
"source_ref": "crm:note:881",
"sha256": "886d5886b41216cf0dc8e2234f4ffb24cb5666425200e5e2c5ee33d841b91be4",
"summary": "A brief note about Project Atlas, which uses Python and FastAPI, with a launch review scheduled for 14 October.",
"text": "Project Atlas uses Python and FastAPI. The launch review is on 14 October.",
"lines": {
"start": 1,
"end": 1,
"total": 1
},
"next_cursor": null,
"download_url": "https://****.r2.cloudflarestorage.com/****/files/****/****.txt?response-content-type=text%2Fplain%3B%20charset%3Dutf-8&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=****%2F20260925%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260925T090639Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=****"
}Search and answers find the memory once status is ready. A short note is usually ready within seconds, and a long document can take a few minutes.
Recall#
Request
curl -X POST https://api.fryri.com/v1/search \
-H "Authorization: Bearer $FRYRI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "When is the Atlas launch review?", "end_user_id": "user_42", "limit": 3}'Response
{
"results": [
{
"id": "file_NkolfLrElMmM2fCn",
"type": "text",
"title": "Project Atlas notes",
"text": "Project Atlas uses Python and FastAPI. The launch review is on 14 October.",
"score": 0.526897227015439,
"score_basis": "cosine",
"location": null,
"created_at": "2026-09-25T09:02:54.915644Z",
"source_ref": "crm:note:881"
},
...
],
"next_cursor": null,
"cost_usd": 0.0025
}Request
curl -X POST https://api.fryri.com/v1/answer \
-H "Authorization: Bearer $FRYRI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "When is the Atlas launch review, and what does the project use?", "end_user_id": "user_42"}'Response
{
"answer": "The **launch review is on 14 October**, and Project Atlas uses **Python and FastAPI**.\n\nThat's from your \"Project Atlas notes.txt\". Given today's date, that review is about three weeks away. The notes also don't say which year, but since you uploaded the file today, 14 October 2026 is the natural reading.",
"sources": [
{
"type": "text",
"id": "file_NkolfLrElMmM2fCn",
"title": "Project Atlas notes",
"text": "Project Atlas uses Python and FastAPI. The launch review is on 14 October."
}
],
"cost_usd": 0.02
}The answer draws only on the library of that user, and sources names the memories it used.
Complete example#
In Python:
import os
import time
import requests
API = "https://api.fryri.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FRYRI_API_KEY']}"}
USER = "user_42"
def call(method, path, **kwargs):
response = requests.request(method, API + path, headers=HEADERS, **kwargs)
response.raise_for_status()
return response.json()
# Store
memory = call("POST", "/memories", json={
"text": "Project Atlas uses Python and FastAPI. The launch review is on 14 October.",
"title": "Project Atlas notes",
"end_user_id": USER,
})
# Wait until ready
while memory["status"] == "processing":
time.sleep(2)
memory = call("GET", f"/memories/{memory['id']}", params={"end_user_id": USER})
# Recall
search = call("POST", "/search", json={
"query": "When is the Atlas launch review?", "end_user_id": USER,
})
answer = call("POST", "/answer", json={
"question": "When is the Atlas launch review?", "end_user_id": USER,
})
# Read response
print(search["results"][0]["text"])
print(answer["answer"])In TypeScript on Node 18 or later, saved as quickstart.mts and run with npx tsx quickstart.mts:
const API = "https://api.fryri.com/v1";
const USER = "user_42";
async function call(method: string, path: string, body?: object) {
const response = await fetch(API + path, {
method,
headers: {
Authorization: "Bearer " + process.env.FRYRI_API_KEY,
"Content-Type": "application/json",
},
body: body && JSON.stringify(body),
});
if (!response.ok) throw new Error(response.status + " " + (await response.text()));
return response.json();
}
// Store
let memory = await call("POST", "/memories", {
text: "Project Atlas uses Python and FastAPI. The launch review is on 14 October.",
title: "Project Atlas notes",
end_user_id: USER,
});
// Wait until ready
while (memory.status === "processing") {
await new Promise((resolve) => setTimeout(resolve, 2000));
memory = await call("GET", "/memories/" + memory.id + "?end_user_id=" + USER);
}
// Recall
const search = await call("POST", "/search", {
query: "When is the Atlas launch review?",
end_user_id: USER,
});
const answer = await call("POST", "/answer", {
question: "When is the Atlas launch review?",
end_user_id: USER,
});
// Read response
console.log(search.results[0]?.text);
console.log(answer.answer);Manage your users#
The developer console lists your end users and what each one spent. DELETE /v1/end-users/{end_user_id} permanently erases the library of one user, which is the call to make when a user asks you to delete their data.
Request
curl -X DELETE "https://api.fryri.com/v1/end-users/user_42" \
-H "Authorization: Bearer $FRYRI_API_KEY"Response
{
"deleted": true,
"end_user_id": "user_42"
}Spend always lands on your account, not theirs.
Tip: The complete example reads the memory every 2 seconds while its
statusisprocessing, so it stops atreadyorfailed.
Warning: Deleting an end user cannot be undone. A later add with the same id starts a new, empty library.