Telegram Chat Agent with Tool Delegation

Telegram Chat Agent with Tool Delegation

Telegram Chat Agent with Tool Delegation

Telegram-based AI agent that processes incoming messages, maintains short-term context, and delegates tasks to dedicated tools and sub-agents.

  • eng
  • n8n, Docker, Linux Ubuntu, Telegram
  • n8n

This workflow exposes an AI agent through a Telegram chat interface and serves as the primary interaction layer for users. Incoming Telegram messages trigger the workflow and are passed directly to the agent for interpretation.

The agent uses a locally hosted Ollama chat model for reasoning and a simple memory component to retain short-term conversational context across messages. Based on the user input, the agent decides whether to respond directly or to delegate execution to connected tools.

Available tools include a search sub-agent for external information lookups and a calculator for basic arithmetic operations. Tool selection is handled explicitly by the agent, keeping reasoning, memory, and execution clearly separated.

Once the agent has produced a response or received results from a delegated tool, the final message is sent back to the user via Telegram. The workflow is structured to keep the chat interface, agent logic, and tool execution modular, allowing additional tools or sub-agents to be integrated without changing the overall flow.