Learn

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 prompt
from unisonlabs import UnisonBrain

client = UnisonBrain()   # reads UNISON_TOKEN
ctx = client.context("payment service architecture")
memory = "" if ctx.weak_evidence else ctx.context_md
curl '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

ModeWhen to use
auto (default)Most calls — server picks depth based on score distribution
standardLow-latency paths where you want consistent speed
deepAmbiguous 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

ParamDefaultNotes
qrequired
k101–50 results
modeautoauto / standard / deep
pathPrefixscope to a subtree, e.g. /workspace/teams/platform/
maxEntities3entities expanded with facts + timeline
includeBodiesfalseinline document bodies for single-shot pipelines

See also: Context recall concept · API reference

On this page