AI Agent

An agent that calls tools until it has an answer.

v0.4.0Source

Install

An AI agent with ports for a chat model, memory, and tools. Chat models of OpenAI, Anthropic, Google Gemini, Mistral, Groq, xAI, DeepSeek, OpenRouter, Ollama, Azure OpenAI, Amazon Bedrock, Google Vertex AI, or any OpenAI-compatible endpoint, memory in zerodot or in a data table, and other workflows, MCP servers, and vector stores as tools. Embedding models, text splitters, a data loader, and a Cohere reranker for vector stores.

AI Agent@zerodot/ai-agentInstall
  1. Open System, then Nodes.
  2. Find AI Agent and click Install.
  3. Use the new nodes at once. You do not restart.

How it works

AI Agent (agent.run) is an action node in the AI Agent package (@zerodot/ai-agent): An agent that calls tools until it has an answer.

The agent sends the prompt to the model. When the model calls tools, the agent runs them, gives the results to the model, and asks again. It stops when the model answers without a tool call, or after Max Iterations.

Ports:

  • Chat Model (required): one chat model node.
  • Memory: one memory node. Without it, each run starts a new conversation.
  • Tool: any number of tool nodes.

Options: System Message, Max Iterations (default 10), and Max Tool Result Length (default 20000).

At most 3 tools run at the same time. A tool that fails gives its error to the model, which can try again. A tool result longer than Max Tool Result Length is cut. The whole run has the time limit of the workflow, and workflow tools count toward it.

The output:

{
  "output": "The final answer",
  "finishReason": "stop",
  "steps": [{ "tool": "find_customer", "input": {}, "result": "...", "error": false }],
  "history": [],
  "usage": { "inputTokens": 0, "outputTokens": 0 }
}

finishReason is stop, length, content_filter, other, or max_iterations.

Logins it can use

The chat models and the embedding models use the same credential types as @zerodot/ai: ai.openai, ai.anthropic, ai.gemini, and ai.compatible. A key saved for one package works in the other.

Cohere API key (cohere): apiKey, and an optional baseUrl. The key is secret.

Guides and related hubs