Skip to main content
Conversations enable multi-turn chat with your agents by automatically persisting message history. When a user chats with an agent, Reminix stores the conversation and loads previous messages on subsequent requests.

How It Works

  1. First message: User sends a message with an identity (e.g., user_id)
  2. Conversation created: Reminix creates a conversation and stores the messages
  3. Subsequent messages: Reminix loads conversation history and prepends it to new messages
  4. Agent responds: The agent sees the full conversation context
// First message - conversation is created
const response = await client.agents.chat("support-bot", {
  messages: [{ role: "user", content: "Hi, I need help with billing" }],
  context: {
    identity: { user_id: "user_123" }
  }
});

// Second message - history is automatically loaded
const response2 = await client.agents.chat("support-bot", {
  messages: [{ role: "user", content: "Can you check my last invoice?" }],
  context: {
    identity: { user_id: "user_123" }
  }
});
// Agent sees both messages and can reference the billing context

Identity

The identity object in context determines how conversations are scoped. Messages are grouped by:
  • Project
  • Agent name
  • Identity fields
Common identity fields:
  • user_id - Scope conversations per user
  • tenant_id - Multi-tenant applications
  • session_id - Scope to a specific session
context: {
  identity: {
    user_id: "user_123",
    tenant_id: "acme-corp"
  }
}
Identity fields must match exactly for messages to be grouped into the same conversation. { user_id: "123" } and { user_id: "123", session_id: "abc" } create separate conversations.

Conversation ID

You can also continue a specific conversation using conversation_id:
// First response includes conversation_id
const response = await client.agents.chat("support-bot", {
  messages: [{ role: "user", content: "Hello" }],
  context: { identity: { user_id: "user_123" } }
});

console.log(response.conversation_id); // "conv_abc123"

// Continue the same conversation explicitly
const response2 = await client.agents.chat("support-bot", {
  messages: [{ role: "user", content: "Thanks!" }],
  conversation_id: "conv_abc123"
});

Client Tokens

When using client tokens for browser SDK authentication, the identity is embedded in the token:
// Server-side: Create token with identity
const token = await client.clientTokens.create({
  context: {
    identity: { user_id: "user_123" }
  }
});

// Client-side: Identity is automatically used for conversation scoping
const response = await clientSDK.chat("support-bot", {
  messages: [{ role: "user", content: "Hello" }]
});

Viewing Conversations

You can view conversation history in the Reminix dashboard under Intelligence > Conversations, or via the API:
// List conversations
const conversations = await client.conversations.list({
  agentName: "support-bot"
});

// Get conversation with messages
const conversation = await client.conversations.retrieve("conv_abc123");
console.log(conversation.messages);

Stateless Mode

If you don’t provide identity or conversation_id, the chat runs in stateless mode - no messages are persisted:
// Stateless - no persistence
const response = await client.agents.chat("support-bot", {
  messages: [{ role: "user", content: "Quick question..." }]
});

Limitations

  • Streaming: Messages are not persisted for streaming responses (only non-streaming)
  • Token limits: Long conversations may exceed model context limits. Consider implementing conversation summarization for very long chats.