Recall
Turn a question into prompt-ready memory with one GET. mode auto/standard/deep controls depth; weakEvidence tells you when to abstain.
GET /v1/brain/context is the primary read primitive. One call fuses document hits, entity facts, and timeline events into a single contextMd block ready to inject into a system prompt. The brain does not generate answers — your model does, using the returned memory.
Make the call
import { BrainClient } from "@unisonlabs/sdk";
const brain = new BrainClient({ token: process.env.UNISON_TOKEN });
const ctx = await brain.context({ q: "payment service architecture", k: 10 });
const memory = ctx.weakEvidence ? "" : ctx.contextMd;
// inject `memory` into your model's system promptfrom unisonlabs import UnisonBrain
client = UnisonBrain() # reads UNISON_TOKEN
ctx = client.context("payment service architecture")
memory = "" if ctx.weak_evidence else ctx.context_mdcurl 'https://brain.unisonlabs.ai/v1/brain/context?q=payment+service+architecture&mode=auto&k=10' \
-H "Authorization: Bearer $UNISON_TOKEN"Response shape
{
"query": "payment service architecture",
"mode": "auto",
"weakEvidence": false,
"topScore": 0.91,
"hits": [{ "path": "/workspace/...", "title": "…", "score": 0.91, "snippet": "…" }],
"entities": [{ "entity": { "slug": "payments-svc" }, "facts": [ … ] }],
"contextMd": "## Memory\n\n…"
}Choosing a mode
| Mode | When to use |
|---|---|
auto (default) | Most calls — server picks depth based on score distribution |
standard | Low-latency paths where you want consistent speed |
deep | Ambiguous or high-stakes queries needing exhaustive retrieval |
Pass mode=deep for queries where you'd rather wait than miss a hit.
weakEvidence — the abstention flag
weakEvidence: true means the best hit scored below the abstention threshold (0.35 by default). Treat it as "the brain does not know." Pass an empty memory block to the model rather than thin matches — memory layers that never abstain teach agents to fabricate provenance.
Key parameters
| Param | Default | Notes |
|---|---|---|
q | — | required |
k | 10 | 1–50 results |
mode | auto | auto / standard / deep |
pathPrefix | — | scope to a subtree, e.g. /workspace/teams/platform/ |
maxEntities | 3 | entities expanded with facts + timeline |
includeBodies | false | inline document bodies for single-shot pipelines |
See also: Context recall concept · API reference
.NET (HTTP) Quickstart
Call the Unison brain from C# using System.Net.Http.HttpClient and System.Text.Json — no NuGet packages required.
Ingest
Write documents into the brain with POST /v1/brain/ingest. Conversations and session dumps go through POST /v1/brain/remember instead. sourceRef keeps retries idempotent.