> ## Documentation Index
> Fetch the complete documentation index at: https://pathlit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Node

> Run a single AI agent with configurable tools—workflows, nodes, and knowledge base search

## Overview

The Agent Node runs a single AI agent that uses **tools** you configure to complete tasks. The agent receives your prompt (which can use format strings from workflow input), decides when to call which tool, and returns a final answer. Use it for RAG, research, orchestration, and multi-step tasks.

* **Tools** — Workflows (invoke other workflows), **Node tools** (e.g. Web Search, Google Search, REST API, Knowledge Base Search, Human Input), and **Knowledge Base Search** (search a selected knowledge base). The agent chooses when and how to use each tool.
* **Model** — Must support function calling. You can set temperature, top-p, system prompt, and max steps.
* **Output** — Final result plus a conversation log of reasoning and tool calls.

<Tip>
  **RAG and Q\&A:** For answering questions using your documents, we recommend adding the **Knowledge Base Search** tool and selecting your [knowledge base](/docs/guides/knowledge-base). The agent will search the knowledge base when needed and ground answers in your content.
</Tip>

## Configuration Parameters

### Node Configuration

* **Query**

  The task or question for the agent. Supports format strings from workflow input (e.g. `{user_question}`). The agent can call tools as needed to complete the task.

* **Tools**

  Select which tools the agent can use. The agent only has access to the tools you enable.

  * **Node tools** — Expose individual nodes as tools, e.g. **Web Search**, **Document Reader**, **Code**, and others. The agent calls the node with parameters it chooses.
  * **Workflow** — Invoke another workflow. Configure workflow and input template.
  * **Knowledge Base Search** — Search a selected knowledge base (semantic search). Recommended for RAG and Q\&A over your documents.

  <Tip>Choose tools that match the task. The agent can only perform actions through the tools you provide.</Tip>

<AccordionGroup>
  <Accordion title="Advanced Settings">
    <ul>
      <li>
        <strong>System Prompt</strong>: Define the agent's persona and behavior (e.g. "You are a research assistant. Use the knowledge base to answer questions."). Supports format strings from workflow input.
      </li>

      <li>
        <strong>Model</strong>: Language model for the agent. Must support function calling.
      </li>

      <li>
        <strong>Temperature</strong>: 0–2. Lower for more deterministic tool use; higher for more varied behavior.
      </li>

      <li>
        <strong>Top P</strong>: 0–1. Nucleus sampling for generation.
      </li>

      <li>
        <strong>Max Steps</strong>: Maximum number of steps (1–50) the agent can take. Increase for complex multi-tool tasks.
      </li>

      <li>
        <strong>PII guardrails for agent operations (excl. tools)</strong>: Enable PII guardrails on the agent's reasoning; combine with PII handling in tools as needed.
      </li>

      <li>
        <strong>Enable Model Fallbacks</strong>: Automatically try alternative models if the primary model fails.
      </li>
    </ul>
  </Accordion>
</AccordionGroup>

## Expected Inputs and Outputs

* **Inputs**:

  * **input**: Data that can be referenced in the Query and System Prompt using format strings (e.g. `{user_question}`, `{ticket_id}`).

* **Outputs**:

  * **output**: The final result produced by the agent.
  * **conversation**: A detailed log of the agent's reasoning and tool calls.

## Use Case Examples

1. **RAG / Q\&A over your docs**

   Add the **Knowledge Base Search** tool and select your knowledge base. Prompt: *Answer the user's question using the knowledge base. If the answer isn't there, say so.* See the [Knowledge Base guide](/docs/guides/knowledge-base) for creating and populating knowledge bases.

2. **Web research**

   Add **Web Search** and/or **Google Search** (and optionally **Webpage Extractor**). Prompt the agent to research companies, find contact info, or gather up-to-date information from the web.

3. **Workflow orchestrator**

   Add **Workflow** tools that invoke your existing workflows. The agent can decide when to run which workflow and pass inputs, so users can give high-level tasks and the agent orchestrates execution.

## Error Handling and Troubleshooting

* **Model Compatibility**:

  Ensure the selected model supports function calling. If you receive a compatibility error, switch to a supported model.

* **Tool Configuration**:

  Verify that all configured workflow and node tools exist and are accessible to the agent.

* **Max Steps Limitation**:

  If the agent isn't completing tasks, consider increasing the max\_steps parameter (up to 50) or breaking down the task into smaller components.

If you encounter any issues not covered in this documentation, please reach out to our [support team](mailto:dev@pathlit.ai) for assistance.

## Relevant Nodes

<CardGroup>
  <Card title="Agent Swarm Node" href="/docs/nodes/agent-swarm">
    Orchestrate multiple agents for complex tasks
  </Card>

  <Card title="LLM Node" href="/docs/nodes/llm">
    Direct LLM access without the agent framework
  </Card>

  <Card title="Knowledge Base Search Node" href="/docs/nodes/embed-search">
    Standalone KB search when you need a fixed search step; prefer Agent + KB Search tool for RAG
  </Card>
</CardGroup>
