Thenvoi AI Agent icon

Thenvoi AI Agent

AI Agent with Thenvoi callback streaming - works like n8n AI Agent

Thenvoi AI Agent

AI-generated

Summary

Execute a Thenvoi AI agent within a specified chat room, processing input through an LLM with configurable prompt, memory, and tool execution, then stream selected message types to the chat and optionally return intermediate steps.

Inputs

  • chatId (required) — The ID of the Thenvoi chat room to stream agent activity to
  • agentRole (required) — Define your agent's identity, capabilities, and personality
  • agentGuidelines — Optional: Domain-specific rules and guidelines for the agent
  • agentExamples — Optional: Example interactions showing desired behavior
  • messageHistorySource — Where to load conversation history from for context (memory or API)
  • messageHistoryLimit — Maximum number of recent messages to load from API (default 50)
  • maxIterations — Maximum number of iterations the agent can perform before stopping (default 20)
  • messageTypes — Select which types of messages to stream to Thenvoi during agent execution (task_updates, thoughts, tool_calls, tool_results)
  • messageId (required) — ID of the message to reply to
  • senderId (required) — ID of the participant who sent the message (from trigger)
  • senderType (required) — Type of the participant who sent the message (from trigger)
  • intermediateThoughts — Whether to send a thought message after each LLM turn during agent execution (default false)
  • returnIntermediateSteps — Whether to return the agent intermediate steps in the output (default false)

Output shape

The agent's final response text. If returnIntermediateSteps is true, the output also includes an array of intermediate steps (tool calls, observations, thoughts) generated during execution.

Conversation history is loaded from either connected memory or the Thenvoi API based on messageHistorySource. Message streaming to the chat occurs based on selected messageTypes via the callback handler. The agent executes for up to maxIterations steps, respecting all configured prompts, memory, and tool capabilities.

Examples

Example 1: Basic agent execution streaming all message types

Use default memory source, enable all message types, and set maxIterations to 10.

Links

Discussion