All nodes/AI/Conversation Memory

Chat History Tool

A tool for the AI Agent: on call it returns the recent conversation history (a role: text transcript), bounded by a message limit. The source is the same as the Chat History node — the saved chat messages (web chat and Telegram). Connect it to the agent via tool_out → extensions.

Chat History Tool

Type in the graph: chat_history_tool

Try it

Minimal working workflow

Entry
AI Agent
Chat History Tool
LLM
Buffer MemoryS
Exit
  • Execute + Data
  • Extension
  • LLM
  • Memory
  • Execute + Data + Streaming
Press “Copy nodes”, open the editor and hit Ctrl+V on the canvas.

Runs as pasted

When to use it

Reach for this node when the agent needs the earlier conversation only occasionally: what is already in context is usually enough, but now and then a customer asks “what did I write to you last week”. The history is then pulled by a tool call instead of riding along in every request, and you pay for it only on the turns that needed it.

If the conversation is needed every time, the Chat History node is cheaper and more predictable: it runs as a graph step and returns an array of messages. And if what the agent needs is its own tape, including tool calls, that is conversation memory — Buffer, Window or Summary.

How it works

The node takes no part in the execution chain: its output goes over an extension link into the Extensions port of AI Agent. The model calls the function named in the Tool name field and gets plain text back — a role: text transcript, oldest message first. When nothing has been saved, an explicit sentence saying there are no prior messages is returned instead of an error: the model needs to tell “empty” apart from “broken”.

The source is the same as the Chat History node’s: the saved messages for the pair “workflow + session”. Telegram turns are mirrored into that same table under a session like tg:{chat_id}, so one tool covers web chat and the bot alike. A blank Session override means the current thread; the field accepts a template, so another thread of the same workflow can be read.

Common mistakes

  • Giving the agent both conversation memory and this tool. The conversation reaches the model twice: once from memory, once as the transcript.
  • Leaving the default description. The model decides when to call a tool by its description; write down what the transcript holds and which questions it answers.
  • Expecting tool calls and the agent’s internal turns in the transcript. Only saved user messages and bot replies land there.
  • Testing on a run with no chat. A run started by a button, a webhook or a schedule has no thread, and the tool honestly reports that no prior messages were found.
  • Two tools with the same name on one agent. The name is how the model tells tools apart; the second one displaces the first.

Inputs

Outputs

PortWirePayloadNotes
tool_outExtensionlink_extension

Configuration

FieldTypeDefaultDescription
Message limitlimitinteger20

Maximum number of most-recent messages to return (chronological order).

Session overridesession_idstring""

Optional thread/session id to read instead of the current conversation. Leave empty to use the running chat thread (web chat or 'tg:{chat_id}' for Telegram). Supports templates, e.g. tg:{{ nodes.entry.data.telegram.chat_id }}.

supports templates

Stream progress in Catchstream_progress_in_catchbooleantrue

Phased progress in the Catch Tool Call stream

Tool descriptiontool_descriptionstringRetrieve the recent conversation history with the user. Use this when you need context from earlier in the chat that is not currently visible to you.

Shown to the LLM so it knows when to call the tool.

Tool nametool_namestringget_chat_history

Function name the agent calls to fetch the conversation history.