v29

latestOpenAPI 3.1.0raw.githubusercontent.com2026-03-233765161.7 KB
v1 modals

Learn from Context (Ingest Messages)

Ingests a list of messages (conversation history) into long-term memory.

The system automatically handles different modalities embedded in the messages:
- **Text** is embedded directly
- **Images/Video** are captioned/described by vision models, then embedded
- **Audio** is transcribed, then embedded

**Universal Base Params:**
- user_id (str, required): The user these memories belong to
- project_id (str, optional): The project bucket (optional)
- persona_id (str, optional): Link these memories to a specific persona

**Input (Multimodal):**
- messages (array, required): A standard chat history list. Can contain Text, Image, Video, and Audio.
- session_id (str, optional): Optional session identifier for conversation context

**Example:**
```json
{
    "user_id": "user_123",
    "project_id": "proj_ABC",
    "session_id": "session_123",
    "messages": [
        {"role": "user", "type": "image", "content": "<base64 encoded image data>"},
        {"role": "assistant","type": "text", "content": "The animation is too slow"},
        {"role": "user", "content": "Good catch. Let's speed it up to 200ms."}
        ],
        "timestamp": "2026-02-07T12:00:00Z"
    }
    ```
post/v1/modal/learn

Request body

user_idstring required

The user these memories belong to (required)

project_idstring nullable

The project bucket (optional)

persona_idstring nullable

Optional persona ID. Link these memories to a specific persona.

session_idstring nullable

Optional session identifier for conversation context

timestampstring nullable

ISO format datetime string for the message timestamp

Example request

{
  "messages": [
    {
      "content": "job_id_123",
      "type": "image"
    },
    {
      "content": "The animation is too slow",
      "type": "feedback"
    },
    {
      "content": "Good catch. Let's remember to speed it up to 200ms for the next sprint.",
      "role": "user"
    }
  ],
  "project_id": "proj_ABC",
  "session_id": "session_123",
  "timestamp": "2026-02-07T12:00:00Z",
  "user_id": "user_123"
}

Response

Successful Response

session_idstring required

Session identifier used for the learning

successboolean

Whether the learning was processed successfully

Example response

{
  "session_id": "session_123",
  "success": true
}