v1
Messages

Store Message

Store a chat message and queue it for AI analysis and memory creation.

**Authentication Required**: Bearer token, API key, or session token

**Processing Control**:
- Set `process_messages: true` (default) to enable full AI analysis and memory creation
- Set `process_messages: false` to store messages only without processing into memories

**Processing Flow** (when process_messages=true):
1. Message is immediately stored in PostMessage class
2. Background processing analyzes the message for memory-worthiness
3. If worthy, creates a memory with appropriate role-based categorization
4. Links the message to the created memory

**Role-Based Categories**:
- **User messages**: preference, task, goal, facts, context
- **Assistant messages**: skills, learning

**Session Management**:
- `sessionId` is required to group related messages
- Use the same `sessionId` for an entire conversation
- Retrieve conversation history using GET /messages/sessions/{sessionId}
post/v1/messages

Request body

role'user' | 'assistant' required

Role of the message sender

sessionIdstring required

Session ID to group related messages in a conversation

process_messagesboolean

Whether to process messages into memories (true) or just store them (false). Default is true.

organization_idstring nullable

Optional organization ID for multi-tenant message scoping

namespace_idstring nullable

Optional namespace ID for multi-tenant message scoping

Example request

{
  "content": "Can you help me plan the Q4 product roadmap?",
  "metadata": {
    "location": "Office",
    "topics": [
      "product",
      "planning",
      "roadmap"
    ]
  },
  "process_messages": true,
  "role": "user",
  "sessionId": "session_123"
}

Response

Message stored and queued for processing

objectIdstring required

Parse Server objectId of the stored message

sessionIdstring required

Session ID of the conversation

role'user' | 'assistant' required

Role of the message sender

createdAtstring date-time required

When the message was created

processing_statusstring

Status of background processing (queued, analyzing, completed, failed)

Example response

{
  "content": "Can you help me plan the Q4 product roadmap?",
  "createdAt": "2024-01-15T10:30:00Z",
  "objectId": "msg_abc123",
  "processing_status": "queued",
  "role": "user",
  "sessionId": "session_123"
}

Changes