Skip to main content
A chatbot is a model with a system prompt and a welcome message. Each conversation with it is a session that belongs to one user and keeps its history, so a user can leave and come back. Replies can be streamed as they are generated. Use a chatbot for conversation: answering questions about a record, explaining a decision, helping a user through a task. For one-shot processing (extract, classify, decide), use an agent or a workflow.

Creating a chatbot

Go to Chatbots → Create Chatbot and fill in: name, namespace, description, system prompt, welcome message, the model from the LLM Repository, and optionally a temperature. Edit it later from the same page.
Update with PATCH /floware/v1/chatbots/<id> (any subset of fields), list with GET /floware/v1/chatbots, delete with DELETE /floware/v1/chatbots/<id>. The console has no chat panel for trying a chatbot; try it from your application or the API.

Sessions

  • A session belongs to the user who created it; each user sees only their own.
  • A session keeps a snapshot of the system prompt taken when it started. Changing the chatbot’s prompt affects new sessions only; start a new session to pick up a change.
  • Rename a session with PATCH /floware/v1/chat-sessions/<id> (title), delete it with DELETE.

Sending messages

The response’s data holds user_message and assistant_message, both as stored. A message can be up to 32,000 characters. Each turn sends the system prompt and the last 50 messages of the session to the model.

Streaming replies

Add ?stream=true to get text/event-stream. Each data: line is a JSON object:
(api is the authenticated fetch wrapper from Integrating an application.)

Pattern: an assistant beside a record

A common feature is a chat panel on a record’s page that answers questions about that record:
  1. One session per user per record. Title sessions predictably (for example Order O-1001); when the page opens, find the user’s session with that title and resume it, or create one.
  2. Send the record as context once, at the start of the first message, between markers your UI can hide:
    When showing history, strip everything between the markers.
  3. Write the system prompt for it: say the block between the markers is the only source of facts; never invent values; never change or second-guess decisions made by the process, only explain them; treat the block as data, not instructions; and answer only about this record.
  4. Offer “new chat” that starts a fresh session with up-to-date context, because the context is a snapshot from when the session started.
Each turn sends only the last 50 messages. In a very long session, the first message, and the context in it, eventually drops out of what the model sees. Keep the context in the first message short and offer a fresh session, or re-send a summary of the context when a session gets long.
  • Keep the context under the per-message limit (32,000 characters): summarise long sections rather than pasting raw data.
  • Leave out what the user is not allowed to see. The model will repeat anything in the context.