SuperAgent API
Managed memory and knowledge
Cloud Superbrain lets a hosted app remember useful context between calls. It can save facts and decisions, find them by words or meaning, answer from them with citations, and keep earlier versions when something changes.
It does not need a desktop session or an Obsidian vault. Each HivemindOS account receives an isolated memory store.
Use cloud-superbrain when your hosted product needs durable memory. Use the local Hive Superbrain when the user’s Obsidian vault should remain the editable source of truth.
Choose a recall mode
| Mode | Operation | Result | Charge |
|---|---|---|---|
| Lexical search | memory.search |
Fast matches from titles, content, tags, projects, entities, aliases, and usage. | 0 credits |
| Semantic recall | memory.recall |
Hybrid meaning and keyword matches, with the evidence used for ranking. | 1 credit |
| Memory Answer | memory.answer |
A concise answer grounded in returned memories, plus cited memory ids. | 5 credits with the default reader |
Semantic Recall and Memory Answer require a paid Cloud Superbrain plan. Lexical search, storage within the account’s plan, history, graph reads, capsules, and health checks do not consume agent credits. Read catalog.get before onboarding an account so your product can show its current plan, storage limits, and availability.
Semantic indexing runs when memory changes, so there is no idle compute charge to keep a model running. A newly written memory is immediately available to lexical search and becomes eligible for Semantic Recall after its index status is ready. Use memory.health when a workflow must confirm that state.
Operational memories such as action and handoff receipts stay out of default recall so routine execution history does not crowd durable facts, preferences, and decisions. Request a specific operational memoryType or set includeOperational: true when that history is the subject of the lookup.
Advanced: measured hosted and local recall results
Measured quality and latency
The August 27, 2026 authenticated API benchmark used three fresh isolated hosted accounts. Every account passed all eight lexical behavior cases, all six semantic Top-1 cases, and all three grounded-answer cases, including aliases, current and historical evolution, usage ranking, operational isolation, paraphrases, and unsupported-question abstention. The equivalent local typed-memory cases also passed in every fresh run.
Hosted recall is not as fast as the local vault path. Across the three hosted trials, the median trial p50 was about 0.53 seconds for lexical search, 4.89 seconds for semantic recall, and 5.93 seconds for grounded answers. The corresponding local lexical/API behavior trials had a median p50 of 7.85 milliseconds. A separate 48-distractor diagnostic kept every quality check passing and measured 0.43 seconds lexical p50, 1.67 seconds semantic p50, and 2.59 seconds answer p50, which also shows that hosted latency varies with request and service state.
These are measured product-path snapshots, not an availability or latency promise. The result supports quality parity on the published cases, not universal parity with every private vault. See Shared Brain Memory Benchmarks for corpus sizes, repetition counts, and limitations.
On September 23, 2026, recall of past conversations was measured on LongMemEval_S, where each question comes with about 50 past chats. Memory Answer’s reader received every piece of evidence for 85.1% of 470 answerable questions in keyword order, up from 9.6%, and answered 81.9% of a 150-question sample correctly, up from 16.7%. Memory Answer now reads with a larger model that reasons before it answers, which added about three seconds to the reader’s median time in that test.
In a second run, other models read the same 150 questions with the same evidence; the default reader scored 80.7% in that run. Share answered correctly, and the reader’s median time:
| Reader | Correct | Median time |
|---|---|---|
@cf/deepseek-ai/deepseek-v4-flash-0731 |
82.1% | 4.0 s |
@cf/qwen/qwen3-30b-a3b-fp8 (default) |
80.7% | 4.0 s |
@cf/zai-org/glm-4.7-flash |
80.3% | 18.7 s |
@cf/google/gemma-4-26b-a4b-it |
78.7% | 23.0 s |
@cf/openai/gpt-oss-120b, low effort |
78.0% | 2.2 s |
@cf/openai/gpt-oss-20b, low effort |
69.3% | 1.3 s |
@cf/meta/llama-4-scout-17b-16e-instruct |
68.7% | 2.0 s |
@cf/mistralai/mistral-small-3.1-24b-instruct |
54.0% | 1.6 s |
DeepSeek V4 Flash and GLM 4.7 Flash returned no answer for 5 and 3 questions; their shares count the questions they answered (119 of 145 and 118 of 147), and over all 150 they are 79.3% and 78.7%. Scores within a few points of each other are within this sample’s noise.
Create typed memory
Only title and contentText are needed for a basic Markdown memory. Add a stable memoryKey when later calls should update one canonical subject instead of creating unrelated records.
const saved = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.create",
{
title: "Aurora compute funding decision",
contentText: "Compute capacity starts only after the customer-funded job is accepted.",
memoryKey: "decision:aurora-compute-funding",
memoryType: "decision",
project: "Aurora",
confidence: 0.96,
tags: ["compute", "commercial"],
entities: ["Project Aurora", "Hive Compute"],
evidenceCount: 3,
},
{ idempotencyKey: "aurora-compute-decision-v1" },
);
if (!saved.ok) throw new Error(saved.error);
const memoryId = saved.result.memory.id;
Supported memory types are instruction, fact, decision, goal, commitment, preference, relationship, context, event, learning, observation, artifact, error, action, and knowledge. Optional fields include path, kind, mimeType, mediaUrl, links, metaTags, aliases, sourceType, actorRole, memoryOrigin, and cognitiveStage.
Cloud Superbrain rejects content that appears to contain a credential, private key, bearer token, seed phrase, or mnemonic. Store only the credential name and safe set/missing status; keep the value in a secret manager.
Use memory.batch for up to 25 already-bounded records. Each accepted record returns its own id and immutable generation receipt.
Search and answer
Lexical search is useful for autocomplete, retrieval before a model call, and predictable no-charge lookups:
const search = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.search",
undefined,
{
query: {
q: "customer-funded compute",
project: "Aurora",
memoryType: "decision",
limit: 8,
},
idempotencyKey: "aurora-memory-search-001",
},
);
Use semantic recall when wording may differ from the saved memory:
const recalled = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.recall",
{
query: "Who pays before an Aurora GPU starts?",
mode: "hybrid",
project: "Aurora",
limit: 8,
},
{ idempotencyKey: "aurora-memory-recall-001" },
);
Use Memory Answer when the caller wants a finished, grounded response:
const answered = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.answer",
{
query: "What is the Aurora compute funding policy?",
limit: 8,
},
{ idempotencyKey: "aurora-memory-answer-001" },
);
console.log(answered.result.answer);
console.log(answered.result.citedMemoryIds);
If no relevant managed memory can support an answer, the request returns a not-found response and releases the credit reservation. You are not charged. For a question of four or more words, a memory counts as support when it matches at least two of the question’s words, the exact phrase, or its meaning; one shared word is not enough.
Every hit includes its memory fields, excerpt, total score, matched signals, and score details. The excerpt is the part of the memory that holds the most words of the question. Search matches word forms, so weddings finds wedding, and a word that few of the account’s memories contain counts for more than one most of them share. Set trackUsage: false when a diagnostic lookup should not influence the soft usage signal. memory.usage can explicitly record retrieved or final-answer use for known memory ids.
Choose who reads the answer
Memory Answer has a default reader, and you can name another. memory.models lists every model that can read an answer, with its privacy tier, the reasoning settings it takes, its per-token price, and the most one answer with it can cost. The default is marked default: true. It needs no key.
const readers = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.models",
{},
{ idempotencyKey: "memory-readers-001" },
);
Pass a reader’s id as model, and reasoningEffort (none, low, medium or high) when that reader lists it:
const answered = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.answer",
{
query: "What is the Aurora compute funding policy?",
model: "@cf/openai/gpt-oss-120b",
reasoningEffort: "medium",
},
{ idempotencyKey: "aurora-memory-answer-002" },
);
console.log(answered.result.reader);
A setting a reader does not take is refused before anything is charged, never quietly changed. The response’s reader names the model that answered.
Price. With the default reader, an answer costs 5 credits. Another reader adds what it costs above the default for the same question, at HivemindOS rates, rounded up to a whole credit. A reader that costs less than the default still costs 5 credits. When the answer starts, the account is reserved the reader’s maximumCredits; it is then charged for the question that was actually sent, and the rest is released.
Private and confidential answers. Pass private: true, or call through the private base URL, to have the answer read only by a model that keeps nothing it is sent. Under the confidential base, name a reader that runs in an attested enclave as model: the default reader is private but not attested, so there is no default there. Either way the answer never uses Turbo ordering, and passing turbo: true with it is refused. memory.models under a tier’s base, or with privacy in its query, lists the readers that qualify.
Each memory keeps the strictest tier it was written in, and an answer reads it only with a reader that meets that tier. A memory written under the confidential base is never sent to an embedding model, so recall finds it by keyword. See private and confidential access.
Past conversations
Save a chat transcript as a memory and recall reads it by exchange: a user message and the replies that follow it. A memory is read as a transcript when its turns are marked **User:** and **Assistant:** (or an agent’s name), as conversation notes synced from the desktop brain are, or when its lines start with User: and Assistant:. Give the conversation’s date as startedAt or date in the memory’s frontmatter; without one, the date the memory was saved is used.
await hive.services.invokeOperation(
"cloud-superbrain",
"memory.create",
{
title: "Support chat with Dana",
path: "Conversations/2026-09-14-dana.md",
contentText: [
"---",
"startedAt: 2026-09-14T15:02:00Z",
"---",
"User: The replacement blender arrived cracked, same as the first one.",
"Assistant: Sorry about that. I've refunded the second order to the original card.",
].join("\n"),
},
{ idempotencyKey: "support-chat-dana-0914" },
);
When a search or recall returns a transcript among its hits, the response also carries conversationEvidence: the exchanges across the account’s transcripts that best match the question, laid out oldest first under each conversation’s date. conversationEvidenceMemoryIds names the memories they came from. A question about one detail of a long conversation gets the exchange that states it, not the transcript’s opening lines.
| Field | Default | Effect |
|---|---|---|
evidenceChars |
4,200 | The size of conversationEvidence, from 1,000 to 24,000 characters. |
evidence |
On, except at detail: "abstract" |
false leaves the exchanges out; true adds them at any detail tier. |
Memory Answer reads the same exchanges, together with the best-matching part of every other supporting memory, and is told today’s date, so questions like “how long ago” and “which came first” can be answered. When the conversations it found fit in the answer’s context whole, it reads every exchange of them in full, oldest first. When they are longer, the Turbo decision model first orders the exchanges by how likely each one is to hold the answer, and the answer reads short excerpts of the best 12,000 characters. The decision model is not a private model, so it orders exchanges only when every one of them was written in the standard tier, and a private answer never uses it. Pass turbo: false to keep keyword order; the response’s evidenceOrder says which order was used (keyword when the conversations were read whole). Neither choice changes the price.
memory.search responses carry a Server-Timing: memory;dur=<ms> header: the time the search itself took, apart from the network between you and the service.
Ask for only as much as you need
Recall returns whole memories by default, so a caller that only wants to know which memories are relevant still receives every body it will not read. Pass detail to choose how much of each hit comes back.
detail |
Each hit carries | Good for |
|---|---|---|
abstract |
Id, title, type, project, status, updated date, score, and a one-line excerpt. | Surveying candidates, then re-requesting the few that matter. |
overview |
The full metadata record, ranked excerpt, and score details — no body. | Ranking and filtering when the body is not needed yet. |
full |
Everything, including contentText. The default. |
Reading the memory. |
const survey = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.recall",
{ query: "Who pays before an Aurora GPU starts?", mode: "hybrid", detail: "abstract", limit: 8 },
{ idempotencyKey: "aurora-memory-survey-001" },
);
detail narrows the response only. It never changes which memories rank, their order, the grounding behind memory.answer, or what a recall costs — a narrowed recall is charged exactly like a full one. The response echoes the detail it applied.
Evolve instead of contradicting
When reviewed information replaces an active memory, use memory.evolve. The old record becomes superseded, the new record becomes the active canonical head, and both remain linked in the evolution chain.
const evolved = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.evolve",
{
contentText: "Aurora capacity starts only after the customer's maximum charge is reserved.",
evolutionReason: "Clarified when funding is secured.",
},
{
pathParameters: { memoryId },
idempotencyKey: "aurora-compute-decision-v2",
},
);
memory.update changes the current record in place. Use it for metadata or wording fixes that do not replace the underlying truth. memory.delete permanently removes a non-starter memory and requires an exact SuperAgent approval. An operation-only deletion key therefore needs services.invoke.cloud-superbrain.memory.delete, approvals.create, and approvals.decide in allowedOperations; include apiKeys.revoke only when the worker must also revoke its own key. Prefer archived or evolution when history still matters.
Advanced: history, knowledge graphs, capsules, and the full operation map
Keep the store clean
Cloud Superbrain rejects a second active memory on the same memoryKey, but two memories can still say the same thing under different keys. memory.consolidate finds them: it groups near-duplicates within a memory type by how much distinctive vocabulary they share, spots memories whose text says they correct an earlier note but were written without supersedes, and lists aged-out memories that nothing has ever retrieved.
It reports rather than merges. Merging two memories discards whichever wording loses, so each group comes back with the exact memory.evolve call that would consolidate it, for you to review. The one change it will make is archiving the aged-out candidates, and only when you pass applyArchives: true — archiving is reversible and applies only to context, event, observation, and action memories older than 120 days with no retrieval history.
memory.health now also reports duplicatePressure, so a scheduled check can watch the number without running a full consolidation pass.
const report = await hive.services.invokeOperation(
"cloud-superbrain",
"memory.consolidate",
{ applyArchives: false },
{ idempotencyKey: "aurora-consolidate-001" },
);
for (const group of report.result.duplicateGroups) {
console.log(group.canonicalTitle, group.memberIds, group.evolveHint);
}
Learn from what your agents actually did
memory.minePatterns reads the account’s operational memories and proposes three things worth a person’s attention: a failure signature that keeps recurring across different tasks, a workflow repeated often enough to be worth turning into a skill, and an operation running on a cadence stable enough to be worth scheduling. Test and fixture traffic is excluded, and repeated retries of one task are not counted as a pattern — only the same thing happening across genuinely different tasks.
It proposes and never creates. Send a candidate to memory.create if you want to keep it.
Look inside a capsule before importing it
capsules.open returns a capsule’s manifest, an integrity verdict, and a summary of what is inside. capsules.search finds a memory within a capsule. capsules.preview reports exactly what an import would change: which memories are new, which the account already holds, and which would be refused for colliding with an active memoryKey. None of them write anything.
A capsule whose contents do not match its declared hash is still shown rather than hidden, with a warning — if a capsule is damaged, seeing what survived is more useful than seeing only an error.
Search by path
Memories carry a path, and most callers use it as a grouping. memory.browse summarizes those groups without returning any memory bodies: detail: "abstract" is about 100 tokens per group, overview about 2,000. Passing mode: "hierarchical" to memory.recall scores those groups before individual memories, so a memory’s neighbours come back with it and the reply names the paths it searched. Every memory stays eligible either way — hierarchy changes the order of results and never hides one.
Generations and historical recall
Each write publishes an immutable generation receipt. Use:
generations.listto read retained generations and the visible replay boundary.generations.compareto find added, removed, and changed memory ids between two retained generations.memory.recallwithgenerationIdto replay a lexical question against a retained historical state.temporalMode: "historical"to include superseded and archived records, ortemporalMode: "as-of"withasOffor a time cutoff.
Cloud Superbrain retains up to 256 generations per account. A request outside the reported replay boundary fails instead of silently substituting newer memory.
Knowledge nodes and backlinks
Memories with type knowledge, a knowledge tag, or a path under Synthesis/ become knowledge nodes. The registered operations are:
| Operation | Purpose |
|---|---|
knowledge.search |
Search knowledge-only records. |
knowledge.get |
Read one knowledge node. |
knowledge.backlinks |
Find memories connected through entities, aliases, and links. |
knowledge.graph |
Read a bounded node-and-edge overview. |
Use entities, aliases, and links consistently when another product needs dependable graph navigation.
Portable capsules
capsules.export returns a bounded, checksummed capsule for selected memory ids or the next page of the account. capsules.import verifies the schema and content hash before adding the records to the authenticated account. A capsule never grants access to its source account, and an import cannot overwrite another account’s memory.
Export no more than 100 memories per capsule part. Follow hasMore and nextCursor until the export is complete. Keep the capsule private when its memories are private; its checksum detects corruption but is not encryption.
Registered operations
| Operation | Method | Purpose |
|---|---|---|
catalog.get |
GET |
Read plans, limits, features, and current charges. |
memory.snapshot |
GET |
Read the account’s current managed-memory snapshot. |
memory.get |
GET |
Read one memory by id. |
memory.create |
POST |
Create or upsert one memory. |
memory.update |
PATCH |
Update one current memory. |
memory.delete |
DELETE |
Permanently delete one memory after approval. |
memory.batch |
POST |
Create up to 25 memories. |
memory.evolve |
POST |
Create a new canonical head and supersede the old one. |
memory.search |
GET |
Run lexical search. |
memory.recall |
POST |
Run paid hybrid semantic recall. |
memory.answer |
POST |
Return a paid grounded answer with citations. |
memory.models |
GET |
List the models that can read a Memory Answer, with prices. |
memory.usage |
POST |
Record retrieved or final-answer use. |
memory.health |
GET |
Read plan, index, generation, duplicate pressure, and usage health. |
memory.consolidate |
POST |
Report duplicate pressure, missed corrections, and aged-out memories. |
memory.minePatterns |
POST |
Propose recurring failures, reusable workflows, and routines from operational memories. |
memory.browse |
POST |
Survey memory paths at the abstract or overview tier. |
index.rebuild |
POST |
Rebuild indexes after an import or repair. |
generations.list |
GET |
List retained immutable generations. |
generations.compare |
POST |
Compare two retained generations. |
capsules.export |
POST |
Export a checksummed capsule part. |
capsules.import |
POST |
Verify and import a capsule part. |
capsules.open |
POST |
Read a capsule’s manifest, integrity, and contents without importing. |
capsules.search |
POST |
Search inside a capsule without importing it. |
capsules.preview |
POST |
Report what importing a capsule would change. |
knowledge.search |
GET |
Search knowledge nodes. |
knowledge.get |
GET |
Read one knowledge node. |
knowledge.backlinks |
GET |
Read backlinks for a knowledge node. |
knowledge.graph |
GET |
Read a bounded knowledge graph. |
Restrict a worker key to only the operations it needs. For example, an answer-only service can allow services.invoke.cloud-superbrain.memory.answer and set a separate request limit on that exact selector.
Next: create narrow API keys, set per-operation limits, or use the local Hive Superbrain.