Forjinn Docs

Development Platform

Documentation v2.0
Made with
by Forjinn

Agent

Learn about agent and how to implement it effectively.

5 min read
🆕Recently updated
Last updated: 12/9/2025

Agent (Agentflow Node)

The Agent node within Agentflow is a powerful component that enables your AI workflows to dynamically choose and utilize tools during runtime, facilitating multi-step reasoning and complex task execution. It acts as the "brain" of your workflow, allowing the AI to observe, think, and act. Forjinn agent node interface showing AI model configuration options

Purpose

The Agent node is designed for scenarios where a simple, linear chatflow is insufficient. It empowers the AI to:

  • Reason: Understand the user's intent and the current state of the conversation.
  • Plan: Determine the best course of action, including which tools to use.
  • Act: Execute selected tools to gather information or perform actions.
  • Iterate: Continuously refine its understanding and actions based on tool outputs.

Appearance on Canvas

Forjinn complete agentflow diagram with connected nodes and data paths

Configuration Parameters

The Agent node offers extensive configuration options to tailor its behavior:

1. Model (Required)

Forjinn agent model selection interface with LLM provider options

  • Label: Model
  • Type: asyncOptions (loads available Chat Models)
  • Description: Select the Large Language Model (LLM) that will serve as the agent's reasoning engine. This LLM will make decisions on tool usage and response generation.
  • Configuration: You can configure the selected model's specific parameters (e.g., API key, temperature, model name) via the agentModelConfig property, which is loaded dynamically.

2. Messages (Optional)

Forjinn agent message configuration panel for system and user prompts

  • Label: Messages
  • Type: array of objects
  • Description: Pre-define a series of messages (System, Assistant, Developer, User) to set the context or persona for the agent. These messages are prepended to the conversation history.
    • Role: system, assistant, developer, user
    • Content: The message text. Supports variables.

3. Tools (Optional)

Forjinn agent tools integration panel showing available functions and APIs

  • Label: Tools
  • Type: array of objects
  • Description: Provide the agent with a set of external tools it can use. The agent will decide which tool to invoke based on its reasoning.
    • Tool: Select an available tool component (e.g., Google Search, Database Query).
    • Require Human Input: If true, the agent will pause and request human confirmation before executing this tool.

4. Knowledge (Document Stores) (Optional)

Forjinn agent knowledge dataset configuration for RAG implementation

  • Label: Knowledge (Document Stores)
  • Type: array of objects
  • Description: Give your agent access to information stored in existing Document Stores. The agent can query these stores to retrieve relevant documents.
    • Document Store: Select an upserted Document Store.
    • Describe Knowledge: A description of what the knowledge base is about, helping the AI decide when and how to search it.
    • Return Source Documents: If true, the original source documents retrieved will be included in the output.

5. Knowledge (Vector Embeddings) (Optional)

Forjinn agent knowledge vector embedding setup for semantic search

  • Label: Knowledge (Vector Embeddings)
  • Type: array of objects
  • Description: Provide the agent with context from existing Vector Stores and Embedding Models. This is used for Retrieval Augmented Generation (RAG).
    • Vector Store: Select an existing Vector Store.
    • Embedding Model: Select an Embedding Model to generate embeddings for queries.
    • Knowledge Name: A short name for this knowledge base.
    • Describe Knowledge: A description of the knowledge base, guiding the AI on its usage.
    • Return Source Documents: If true, the original source documents retrieved will be included in the output.

6. Enable Memory (Optional)

Forjinn agent memory configuration for conversation context retention

  • Label: Enable Memory
  • Type: boolean
  • Default: true
  • Description: If enabled, the agent will maintain conversational memory, allowing it to remember past interactions.

7. Memory Type (Optional)

  • Label: Memory Type
  • Type: options
  • Default: allMessages
  • Description: Defines how the agent manages its conversational history.
    • All Messages: Retrieves all messages from the conversation.
    • Window Size: Uses a fixed window to surface the last N messages.
    • Conversation Summary: Summarizes the entire conversation.
    • Conversation Summary Buffer: Summarizes conversations once a token limit is reached.

8. Window Size (Optional)

  • Label: Window Size
  • Type: number
  • Default: 20
  • Description: (Visible when Memory Type is "Window Size") Specifies the number of recent messages to retain in memory.

9. Max Token Limit (Optional)

  • Label: Max Token Limit
  • Type: number
  • Default: 2000
  • Description: (Visible when Memory Type is "Conversation Summary Buffer") The maximum token limit before the conversation is summarized.

10. Input Message (Optional)

Forjinn agent input message configuration for user interaction handling

  • Label: Input Message
  • Type: string
  • Description: Add an additional input message as a user message at the end of the conversation. Useful for dynamic inputs.

11. Return Response As

Forjinn agent response format configuration for output customization

  • Label: Return Response As
  • Type: options
  • Default: userMessage
  • Description: Determines how the agent's final response is formatted in the output.
    • User Message: The response is treated as if it came from a user.
    • Assistant Message: The response is treated as if it came from an assistant.

12. Update Flow State (Optional)

Forjinn agent flow state update configuration for workflow management

  • Label: Update Flow State
  • Type: array of objects
  • Description: Allows you to update the runtime state of the workflow during the agent's execution.
    • Key: The key of the state variable to update.
    • Value: The new value for the state variable. Supports variables and node outputs.

Inputs & Outputs

  • Input: Typically receives a user message or a structured input from a preceding node.
  • Output: Produces the agent's response, which can be a text message, a tool call, or a structured output. It also includes metadata like usedTools, sourceDocuments, artifacts, and usageMetadata.

Example Usage

A common use case for the Agent node is to create a dynamic assistant that can answer questions by searching the internet. Forjinn agent web scraper tool configuration for data extraction

  1. Drag an Agent node onto the canvas.
  2. Configure Model: Select an OpenAI Chat Model (or similar LLM) and provide its credentials.
  3. Add Tool: In the "Tools" section, add a Google Search tool.
  4. Enable Memory: Keep "Enable Memory" checked.
  5. Connect to Chat Output: Connect the output of the Agent node to a Chat Output node.

Now, when you interact with this chatflow, the agent will use its LLM to decide if it needs to use the Google Search tool to answer your questions.