The Context Engine Studio is now open source.  View on GitHub →
Clinia
Ingest

Ingest sessions

Technical preview

Submits one or more conversation transcripts. Each transcript is stored as a session — under the sessionId it declares, or a generated one — and the patient's memories are formed from it as ingestion proceeds.

The response is a receipt: ingestion continues after it is returned, so poll the ingestion to follow it. intake comes back index-aligned with the sessions you sent, each item naming the session its transcript was stored under.

Resending a session under the same sessionId is safe: messages already stored are recognised and not staged again, and turns added at the end are appended. A transcript without a sessionId always opens a new session. A transcript that edits, removes or reorders stored turns is refused. If any transcript is refused, the whole request is rejected and nothing is stored.

Usage

import { ContextEngineClient } from "@clinia/context-engine-js";

// Initialize the client
const client = new ContextEngineClient({
  baseUrl: process.env.CLINIA_WORKSPACE,
  auth: {
    clientId: process.env.CLINIA_CLIENT_ID,
    clientSecret: process.env.CLINIA_CLIENT_SECRET,
  },
});

// Call the API, with the request body the API reference documents
const { data, error } = await client.ingest.ingestSessions("<patient-id>", body);

// Print the response
console.log(data ?? error);

The environment variables are set in Install and authenticate, for JavaScript or Python.

API reference

POST /v1/patients/{patientId}/ingestions/sessions documents the parameters, the request body and the responses.

On this page