Agents Module
AI agent conversations and messages viabase44.agents.
Note: This module requires a logged-in user. All agent methods work in the context of the authenticated user.
Contents
- Concepts
- Methods
- Examples (Create, Get Conversations, List, Subscribe, Send Message, WhatsApp)
- Message Structure
- Conversation Structure
- Common Patterns
Concepts
- Conversation: A dialogue between user and an AI agent. Has unique ID, agent name, user reference, and metadata.
- Message: Single message in a conversation. Has role (
user,assistant,system), content, timestamps, and optional metadata.
Methods
| Method | Signature | Description |
|---|---|---|
createConversation(params) | Promise<Conversation> | Create a new conversation with an agent |
getConversations() | Promise<Conversation[]> | Get all user’s conversations |
getConversation(id) | Promise<Conversation> | Get conversation with messages (includes full tool call results) |
listConversations(filterParams) | Promise<Conversation[]> | Filter/sort/paginate conversations |
subscribeToConversation(id, onUpdate?) | () => void | Realtime updates via WebSocket; tool call data truncated (returns unsubscribe function) |
addMessage(conversation, message) | Promise<Message> | Send a message |
getWhatsAppConnectURL(agentName) | string | Get WhatsApp connection URL for agent |
Examples
Create Conversation
Get All Conversations
Get Single Conversation (with messages)
Returns the complete stored conversation including full tool call results (unlike the realtime subscription, which truncates tool call data).List with Filters
Subscribe to Updates (Realtime)
When receiving messages through this subscription, tool call data is truncated for efficiency (arguments_string limited to 500 characters, results to 50). Use getConversation() after the message completes to retrieve full tool call data.
Send a Message
Get WhatsApp Connection URL
Message Structure
Conversation Structure
Common Patterns
Chat Interface
Type Definitions
AgentNameRegistry and AgentName
How to get typed agent names: The Base44 CLI can generate an augmentation ofAgentNameRegistry from your project. For how to run it, use the base44-cli skill.

