Overview: all pages
Docs homeOverviewAPITools & MCPWhat is RemiqQuickstartThe core loopHow it worksRecords, links and valuesSearch and contextSpaces and privacyOverview / Get started / The core loopCopy this page for your AI (Markdown)
The core loop
POST /v1/memories {"user": "alice", "text": "We moved the Atlas launch to Friday."}
POST /v1/context {"user": "alice", "query": "When is the Atlas launch?"}
-> {"instructions": "...", "context": "MEMORY DATA - quoted records ...\nEND OF MEMORY DATA", "status": "DIRECT", "claims": [...],
"provenance": [{"id": "M3", "date": "...", "source": "..."}], "tokens": 412, ...}
The same with a client (prism_client.py for Python, sdk-ts/prism.ts for TypeScript; both read nothing from the environment by themselves):
import os
from prism_client import Prism
p = Prism(os.environ["PRISM_API_KEY"], os.environ["PRISM_URL"])
p.add("We moved the Atlas launch to Friday.", user="alice")
ctx = p.context("When is the Atlas launch?", user="alice")
messages = [{"role": "system", "content": ctx["instructions"]},
{"role": "user", "content": ctx["context"] + "\n\nWhen is the Atlas launch?"}]
import { Prism } from "./prism";
const p = new Prism(process.env.PRISM_API_KEY!, process.env.PRISM_URL!);
await p.add("We moved the Atlas launch to Friday.", { user: "alice" });
const ctx = await p.context("When is the Atlas launch?", { user: "alice" });
curl -s "$PRISM_URL/v1/context" -H "Authorization: Bearer $PRISM_API_KEY" -H "Content-Type: application/json" \
-d '{"user": "alice", "query": "When is the Atlas launch?"}'
Put instructions in your system prompt and context in the user turn, or return it as a tool result. Your model answers and cites the [M…] ids.
Memory is untrusted data. The context arrives inside a fenced block, and the instructions tell your model it is data, not orders. Never paste memory text into your system instructions. When you can, deliver it as a tool result.