FastGPTFastGPT
Get Started

Create Your First Agent Task

Configure Chat Agent V2 to master system prompt authoring, tool and knowledge base attachment, and execution trace inspection.

This tutorial guides you through building a Chat Agent V2 capable of autonomous planning and tool invocation, completing an end-to-end task from knowledge retrieval to structured checklist output.

Learning Goals and Prerequisites

After finishing this tutorial, you will understand the core execution model of Chat Agent V2, learn how to attach tools and knowledge bases, and analyze model reasoning steps through execution traces.

Before starting, verify the following prerequisites:

  • Resource creation permissions and knowledge base read permissions in your active team.
  • An available chat model (default preset models in FastGPT Cloud already support tool calling; in self-hosted environments, select the model in the "AI Settings" dialog and confirm that the "Tool call" column shows "Support").
  • Completion of the Quick Start Tutorial, ensuring the Corporate Travel Policy knowledge base exists in your team.

Step 1: Create a Chat Agent V2

  1. Log in to FastGPT and click "Studio" in the left navigation bar.
  2. Click "Create your first Agent" in the center of the page (or the "New" card in the list if applications already exist) to open the "Create Agent" page.
  3. Select "Chat Agent V2" under "Agent Type", enter Expense Check Assistant as the name in the icon & name area, and click "Create".
  4. In the "App settings" view, select an available model under "AI Settings → Model" (such as qwen3.8-flash shown in the screenshot) and confirm in the "AI Settings" dialog that the "Tool call" column displays "Support".

Select Chat Agent V2 when creating an application

Step 2: Write Structured System Instructions

In the "AI Settings → Prompt" field, enter explicit operational instructions defining the agent's retrieval step and output criteria:

Retrieve the travel policy before answering. Return exactly four short bullet points: submission deadline, required documents, Finance review time, and missing policy information. Use only explicit policy facts. Do not calculate dates or introduce additional requirements.

Step 3: Attach Knowledge Base and External Tools

  1. Under the "Dataset" section at the bottom of the configuration panel, click "+ Choose" on the right and select Corporate Travel Policy. Attaching a knowledge base automatically enables knowledge base retrieval for Chat Agent V2.
  2. To attach additional skills or external tools, click "+ Choose" on the right side of the "Skills" or "Tool" section.
  3. Type @ inside the "Prompt" editor to open the capability reference menu (shown below), where you can directly reference "DatasetSearch", "Sandbox", "FileParsing", or other tools and skills from "System Tools", "Tools", "My Agents", or "Skills".

Type @ in the prompt editor to open the capability reference menu

Step 4: Test in Workspace and Trace Execution

Enter the following test inquiry in the right-hand "Debug preview" panel:

Please check my reimbursement readiness: submission deadline, required documents, Finance review time, and missing policy information.

Submit the query and observe the runtime sequence:

  1. Reasoning: The agent evaluates the query and decides to call the knowledge retrieval tool first.
  2. Tool Invocation: The agent generates parameters travel expense deadline documents and queries the knowledge base.
  3. Observation: The tool returns relevant travel policy chunks (including 15 calendar days and approved request forms).
  4. Synthesis: The agent synthesizes the retrieved facts into four structured bullet points with citations.

Click "Run Details" below the response to inspect tool inputs, raw tool outputs, and execution duration for each step.

Expense audit agent returns structured checklist with policy citations

Step 5: Save and Publish the Active Version

  1. Once the test output satisfies your requirements, click "Save" in the top right corner and choose "Save and Publish" from the dropdown.
  2. Enter a version name (for example, Expense Check Assistant v1) in the dialog and click "Confirm".
  3. The platform points the active production pointer to this release, updating all external channels immediately.

Common Troubleshooting

SymptomPrimary Investigation Path
Model answers directly without calling toolsConfirm the chosen model supports Function Calling; strengthen explicit retrieval instructions in the prompt
Retrieval returns empty resultsVerify that knowledge base indexing is ready; confirm dataset read permissions
Tool execution timeoutCheck upstream model and network connectivity; examine error traces in execution logs

Next Steps

Edit on GitHub

Last updated

On this page

Put your business knowledge to work with AI

Import company documents and build accurate, reliable, traceable AI answers.