Skip to main content

Basic Usage

Start a conversation with a chat agent. The response includes a conversation_id you can use to continue the conversation.
import Reminix from "@reminix/sdk"

const client = new Reminix({ apiKey: "your-api-key" })

const response = await client.agents.chat("support-bot", {
  messages: [
    { role: "user", content: "Hi, I need help with my account" }
  ],
})

console.log(response.output)
console.log(response.conversation_id)

Continuing a Conversation

Pass the conversation_id from a previous response to continue the same conversation. Reminix automatically manages the message history.
// First message
const chat = await client.agents.chat("support-bot", {
  messages: [
    { role: "user", content: "What's my account status?" }
  ],
})

// Follow-up in the same conversation
const followUp = await client.agents.chat("support-bot", {
  messages: [
    { role: "user", content: "Can you update my email?" }
  ],
  conversation_id: chat.conversation_id,
})

Parameters

agentName
string
required
Name of the agent.
messages
Message[]
required
OpenAI-compatible message format. Each message is an object with role and content fields.
conversation_id
string
Continue an existing conversation. Omit to start a new one.
context
object
Execution context including identity and metadata.

Message Format

Messages follow the OpenAI-compatible format with role and content fields.
const messages = [
  { role: "system", content: "You are a helpful assistant." },
  { role: "user", content: "Hello!" },
  { role: "assistant", content: "Hi! How can I help?" },
  { role: "user", content: "What's the weather?" },
]
The system role is optional and typically set by the agent configuration. You can include it to override or augment the agent’s system prompt.

Response

output
string
The agent’s response text.
conversation_id
string
The conversation ID for follow-up messages. Store this to continue the conversation.

With Streaming

Pass stream: true to receive the response incrementally as the agent generates it.
const stream = await client.agents.chat("support-bot", {
  messages: [{ role: "user", content: "Tell me a story" }],
  stream: true,
})

for await (const event of stream) {
  if (event.type === "text_delta") {
    process.stdout.write(event.delta)
  }
}
See Streaming for all event types.

Next steps

invoke()

Stateless one-shot calls when you don’t need history.

Conversations

How conversation IDs and identity scoping work.

Error Handling

Catch typed errors and add retries.

Streaming

Event types and SSE format reference.