Skip to content

Conversations & follow-ups

Every turn belongs to a conversation. Finn keeps the context of a conversation server-side, so follow-up questions understand what came before — you just need to thread the conversationId (conversation_id in Python).

// First question — no conversationId, so Finn starts a new conversation.
const first = finn.sendMessage('How many active members do I have?');
for await (const c of first) process.stdout.write(c.text);
const { conversationId } = await first.completed;
// Follow-up — pass the id back, and Finn keeps the context.
const second = finn.sendMessage('How many joined in the last 90 days?', {
conversationId,
});
for await (const c of second) process.stdout.write(c.text);
await second.completed;

Because the second call carries the conversation id, “in the last 90 days” is understood against the same members the first question was about.

sendMessage / send_message accepts these options (send optionsSendMessageOptions in Node.js, keyword arguments in Python):

Option (Node.js)PythonTypeDescription
conversationIdconversation_idstrContinue an existing conversation. Omit to start a new one (or continue the client’s current one).
systemPromptsystem_promptstrPer-conversation system-prompt override — honored only when creating a new conversation. See System prompts.

The conversation id is just a string — store it wherever you keep user state (a session, a database row, a cache) and reuse it later, even across process restarts or reconnects:

const turn = finn.sendMessage(userQuestion, { conversationId: saved ?? undefined });
const { conversationId } = await turn.completed;
await db.users.update(userId, { finnConversationId: conversationId });