Brain

Ingesting data

POST /v1/brain/ingest writes documents into the brain as extractable notes. Conversations and session dumps go through POST /v1/brain/remember instead.

unison-brain

POST /v1/brain/ingest is the document write: batch up to 100 items per call, each type: "document". Documents land as extractable notes at a brain path - no curation judgment is applied, so what you send is what gets written.

Conversations, transcripts, and Claude Code session dumps are not ingest items - they go through POST /v1/brain/remember, which runs the save-or-skip curation pipeline (dedupe, curated /private/notes notes, entity facts) before filing anything.

Item shape

{
  type: "document",
  content: string,
  title?: string,
  path?: string,                      // brain path; auto-routed if omitted
  tags?: string[],
  visibility?: "workspace" | "private",
  sourceRef?: string
}

Response

{ items: [{ type: "document", docId: string, path: string, jobIds: string[] }] }

Example

curl -X POST https://brain.unisonlabs.ai/v1/brain/ingest \
  -H "Authorization: Bearer $UNISON_TOKEN" -H 'content-type: application/json' \
  -d '{
    "items": [{
      "type": "document",
      "sourceRef": "adr-queue-42",
      "title": "ADR: switch queue to pgmq",
      "content": "We switched the job queue to pgmq. Simpler ops than Redis - one less moving part."
    }]
  }'

Use sourceRef so retries are idempotent - re-ingesting the same sourceRef updates the existing doc rather than duplicating it. Set visibility: "workspace" to share the doc with the whole workspace immediately; default is private. Track background jobs with unison jobs ls (scope brain:admin) or GET /v1/brain/status (pendingJobs, lastIngestAt).

For direct document writes with full control (path, kind, tags, optimistic concurrency), use PUT /v1/brain/doc - see Path namespaces. For saving a conversation instead of a document, see POST /v1/brain/remember.

On this page