Skip to main content
The Loom REST API is served by FastAPI. Start the server with:
Base URL: http://localhost:8666

Core

Build Memory

string
required
The text to process into memory.
string
required
The session identifier.

Chat

string
required
The user’s message.
string
required
The session identifier.
Response includes a schema_updated flag indicating if auto-update was triggered this round.

Listen

string
required
The user’s message.
string
required
The session identifier.
Listen mode: accumulates history, runs the CM agent in build mode periodically (every build_every_n_turns turns), and recalls schema data every turn. Returns reply, session_id, and turn_number.

Update Schema from Chat

string
required
The session identifier.
integer
Number of recent chat rounds to process.

Configuration

Get Build Every N Turns

Set Build Every N Turns

Get Chatbot Context Rounds

Set Chatbot Context Rounds

Schemas

List Schema Domains

Get Schema Details

Get Schema File Data

Returns all domain data from a schema file — suitable for sidebar rendering.

Recall All Schemas

Returns all schema data as formatted text for LLM system prompt injection.

Selective Recall

string
required
The user’s message to determine relevant fields.
string
required
The session identifier.
Runs the CM agent in QA mode to recall only fields relevant to the message. Returns recalled, is_selective, and schema_id.

Inspect All Schemas

Returns a token-efficient overview of all schemas.

Create Schema Domain

Delete Schema Domain

Delete All Schema Domains

Create from Template

string
required
The template name to use.
string
required
The session identifier.
Copies the template as a new schema file ({name}_{YYYYMMDD}_{HHmmss}.json) and switches the session to it.

Create Schema File

string
required
The session identifier.
string
Custom schema ID. Auto-generated if empty.
string
Optional template name to populate the new schema.
Creates a new named schema file and switches the session to it. Returns 409 if the schema already exists.

New Schema (Backup + Reset)

string
required
The session identifier.
Returns backup_id and schema_id.

Switch Schema

string
required
The session identifier.
string
required
The schema ID to switch to.

Restore Schema

string
required
The backup identifier to restore.

List Saved Schemas

List Backups

Templates

List Templates

Returns all available templates with info (name, description, source, domain count).

List Templates (Grouped)

Returns templates grouped by source: builtin, user, custom.

Get Template Details

Returns the full template data (same format as schema JSON files).

Save Custom Template

object
required
Full template JSON with _meta.name field.
Returns {status, path, name}.

Delete Custom Template

Only custom templates can be deleted. Built-in and user templates are protected.

Sessions

List Sessions

Create Session

string
required
The session identifier.
string
The schema ID to bind to this session. Defaults to "default".

Delete Session

Clear Session

Clears the session’s chat history while preserving schema data.

Get Session History

Get Session Schema ID

Set Session Schema ID

string
required
The schema ID to bind to this session.