ConversationChain
ConversationChain sends the user’s message to an AI model and returns its answer, as in a conversation. If you connect a memory, the model also receives the earlier messages of the conversation, so it can keep the thread and answer questions like “and how much does that cost?”.
It is a simple way to build a chat assistant without extra instructions or tools.
When to use it
- A general conversation assistant for your team that remembers what was said in the same conversation.
- Quickly testing how a model answers in a chat of several messages.
- Chaining follow-up questions on the same topic without repeating the context in every message.
Configuration
| Field | What it does |
|---|---|
| Input (required) | The user’s message. You can type it or connect it, for example, to a Chat Input. |
| Connection | What to connect |
|---|---|
| Model (required) | An AI model component, for example OpenAI. |
| Memory | Optional. The Memory output of Chat Memory, so the model takes the earlier messages into account. With no memory connected, each run starts without history. |
Output
- Text: the model’s answer. Connect it to a Chat Output to show it in the chat.
- Runnable: the component ready to be run by another one. Connect it to Runnable As Tool so an agent can use it as a tool.
Example
Viajes Encina wants an internal assistant so its sales team can clear up quick questions:
- Connect a Chat Input to Input and a model to Model.
- Add Chat Memory and connect its Memory output to Memory.
- Connect Text to a Chat Output.
If a salesperson asks “what documents does a traveller need to go to Japan?” and then “and if they travel with a minor?”, the assistant understands the second question is still about the trip to Japan.
Good practices
- Always connect a memory if you expect follow-up questions; without it, the model does not remember earlier messages.
- If you need to give the model instructions, have it use your documents or take actions, use an agent or Retrieval QA History.