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

Core

Build Memory

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

Chat

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

Listen

message
string
required
The user’s message.
session_id
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

session_id
string
required
The session identifier.
rounds
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

message
string
required
The user’s message to determine relevant fields.
session_id
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

template_name
string
required
The template name to use.
session_id
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

session_id
string
required
The session identifier.
schema_id
string
Custom schema ID. Auto-generated if empty.
template
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)

session_id
string
required
The session identifier.
Returns backup_id and schema_id.

Switch Schema

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

Restore Schema

backup_id
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

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

session_id
string
required
The session identifier.
schema_id
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

schema_id
string
required
The schema ID to bind to this session.