Commit c24f2667 by 许宇鹏 Committed by GitHub

docs(guide/getting-started): 重写快速上手文档并新增配套案例与截图 (#7229)

将原有的简单入门内容替换为四个完整的FastGPT应用场景教程,包括对话Agent、知识库+对话Agent、工作流和Agent V2四种核心应用类型,同时新增40余张操作截图辅助讲解每个配置步骤,帮助新手快速理解平台能力并完成基础搭建。
parent 6bd39b27
--- ---
title: Quick Start title: 'Quick Start'
description: Get started with FastGPT basics description: 'Quickly experience FastGPT through four use cases: Conversational Agent, Knowledge Base, Workflow, and Agent V2'
--- ---
For more tips, [watch the video tutorial](https://www.bilibili.com/video/BV1sH4y1T7s9) This article uses four complete use cases to help you quickly understand FastGPT's core application types and complete the basic setup from simple conversations to complex task orchestration.
## Knowledge Base This page is suitable for first-time FastGPT users, as well as pre-sales, delivery, operations, legal, and administrative roles who want to quickly experience the platform's capabilities. After completing this page, you will build the following in order:
Before you begin, prepare a test document — Word, PDF, TXT, Excel, or Markdown all work. For example, a company leave policy, non-confidential sales scripts, or product documentation. 1. Conversational Agent: Corporate email writing assistant.
2. Knowledge Base + Conversational Agent: Civil Code Q&A assistant.
3. Workflow: Content review and automatic rewriting.
4. Agent V2: Intelligent data analysis Agent.
We'll use the FastGPT Chinese README file as an example. We recommend preparing the following in advance:
First, create a Knowledge Base. - An available AI model, such as GLM-5.1 or other configured models.
- A knowledge base test file, such as the Civil Code, company policies, product manuals, etc.
- If you want to test the Email tool, prepare an email SMTP authorization code.
- If you want to test Agent V2 data analysis, prepare a sample Excel or CSV file.
![](/imgs/create-rep.png) When reading, focus on three things: what kind of problems each application type is suitable for, why the key configurations are written this way, and what to observe during validation. The parameters and prompts in this article are reusable starting points; for production deployment, you can replace them with your own business materials, review rules, notification channels, and data files.
After creating the Knowledge Base, upload some content. ## Case 1: Conversational Agent — Corporate Email Writing Assistant
There are four upload modes: ### 1.1 Use Cases
- Manual Input: Enter QA pairs manually — the most precise method
- QA Split: Upload a text file and let AI generate QA pairs automatically
- Direct Chunking: Upload a text file and split it into segments directly
- CSV Import: Batch import QA pairs
Here we'll use QA Split to let AI generate QA pairs automatically. You can edit them manually later if the quality isn't satisfactory. Conversational Agents are suitable for lightweight Q&A, content generation, copy refinement, and standardized output. This case does not link a knowledge base or rely on complex workflows; it simply uses model configuration, prompts, and an Email tool to build a corporate email writing assistant.
![](/imgs/upload-data.png) Employees often need to handle emails for project updates, cross-departmental collaboration, customer replies, meeting minutes, and more. Using AI to standardize email formats and expression styles can improve writing efficiency and maintain the professionalism of external corporate communications.
After uploading, wait for processing to complete until the file status shows as available. The focus of this case is not to have the AI randomly generate an email, but to consolidate the stable requirements of corporate email writing into the prompt, such as subject lines, salutations, body structure, action items, and risk reminders. For beginners, it also serves as a minimal closed loop for understanding FastGPT application configuration: first define the role, then constrain the output, and finally extend execution actions through tools.
![](/imgs/upload-data2.png) ### 1.2 Configuration Steps
## Application 1. **Create a Conversational Agent**
Click the "Application" button to create a new app. There are four templates — select "Knowledge Base + Chat Guide." Click "New" in the workspace, select "Conversational Agent", and fill in the application name as `Corporate Email Writing Assistant`.
![](/imgs/create-app.png) ![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-01.png)
After creating the app, go to the detail page, find the "Knowledge Base" section, and add the Knowledge Base you just created. 2. **Enter the Application Configuration Page**
![](/imgs/create-app2.png) After creation, enter the application configuration page. The page is usually divided into left and right columns: the left is AI configuration, and the right is debug preview.
After adding the Knowledge Base, click "Save and Preview" to link your app with the Knowledge Base. ![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-02.png)
![](/imgs/create-app3.png) 3. **Select a Model**
Now you're ready to start chatting. In the AI configuration, select the base model for the Conversational Agent. This case uses GLM-5.1, but you can replace it with other available models configured in your current environment.
![](/imgs/create-app4.png) When selecting a model, prioritize two aspects: first, whether the model is good at business writing, and second, whether it consistently follows the required format. Email writing is a low-risk, low-structure task, so you usually do not need the strongest model available, but you should still choose one with a natural tone and reliable instruction following.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-03.png)
4. **Write the Prompt**
The prompt needs to clearly describe the assistant's role, output format, and constraints. You can use the following example:
```md
You are a corporate email writing expert, helping employees write professional, clear, and appropriate work emails.
Output format:
- **Subject line**: Concise and clear
- **Salutation**: Choose "Dear Mr./Ms. XX" or "Hi XX" based on the relationship with the recipient
- **Body**: Three-part structure (Background → Core content → Action items)
- **Sign-off**: Name, Title, Department
Rules:
- Keep the body between 200-500 words
- List action items and to-dos with bullet points
- When involving sensitive content like salary, HR, or legal matters, remind the user to send with caution
- Use a neutral and polite tone when unsure of the relationship with the recipient
```
Write the prompt into the prompt module.
This prompt consists of three parts: the role definition stabilizes the assistant's identity, the output format constrains the email structure, and the rules control risk boundaries. In actual business, you can continue to add corporate tone requirements, brand terminology, banned words, signature formats, and more to make the output more aligned with internal standards.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-04.png)
5. **Add the Email Tool**
Tools encapsulate complex operations. This case uses the Email sending tool to give the AI assistant the ability to send emails after generating them. Click the plus sign on the right side of the tools and select "Send Email".
You can think of tools as the AI's external capabilities. Without tools, the assistant can only generate the email body; after adding the Email tool, the assistant can execute the sending action after user confirmation. In a production environment, it is recommended to have the assistant generate an email draft first, and then have the user confirm the sending, to avoid accidental sending or sending to the wrong recipient.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-05.png)
6. **Configure the Email Tool**
Enter the tool configuration page and fill in the parameters related to the email service.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-06.png)
7. **Activate the Tool**
Click "Settings" to enter the tool activation page, then click "Activate Tool".
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-07.png)
8. **Fill in the Email SMTP Information**
This case uses QQ Mail as an example. When testing, you can fill it out as follows:
```text
SMTP Server Address: smtp.qq.com
SMTP Port: 465
Enable SSL
SMTP Username: Email address
SMTP Password: Authorization code
```
For the authorization code, please refer to the [Authorization Code Acquisition Tutorial](https://cloud.tencent.com/developer/article/2177098).
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-08.png)
9. **Set the Conversation Opening**
The conversation opening is used to tell users what this AI assistant can do. You can fill in:
```text
Hello! I am the Email Writing Assistant 📧
Please tell me: Who is the recipient? What is the purpose of the email? What key information needs to be included?
I will help you generate a professional and appropriate email.
```
After filling it out, you can see the effect in the preview area on the right.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-09.png)
10. **Validate the Result**
After configuration, enter your email requirements in the debug preview to check whether the assistant can generate an email with a clear structure and appropriate tone.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-10.png)
If the user's information is insufficient, the assistant should proactively prompt to supplement the recipient, email purpose, key information, etc.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-11.png)
When verifying, it is recommended to test at least three types of inputs: an email requirement with complete information, a vague requirement missing the recipient or purpose, and an email requirement containing sensitive information. An email assistant ready for production not only needs to be able to "write", but also needs to be able to ask follow-up questions when information is insufficient, and remind users to send with caution in sensitive scenarios.
### 1.3 Business Value
- **Improve Writing Efficiency**: Transform high-frequency emails like project updates, customer follow-ups, and meeting minutes from "writing from scratch" to "generating after filling in key information", reducing repetitive labor.
- **Unify Communication Standards**: Consolidate standards for salutations, body structure, action items, and sign-offs into the Prompt, reducing the communication costs caused by differences in writing styles among employees.
- **Reduce Sending Risks**: Add sensitive information reminders, missing information follow-ups, and neutral tone constraints through the Prompt to reduce incomplete, inappropriate, or over-promising emails.
- **Expand Office Automation**: Combined with the Email tool, you can continue to integrate office workflows such as notifications, approvals, Lark, DingTalk, and WeCom, extending email writing from content generation to business action execution.
## Case 2: Knowledge Base + Conversational Agent — Civil Code Q&A Assistant
### 2.1 Use Cases
A knowledge base is ideal for scenarios where answers must be based on provided materials, such as policy Q&A, product manual Q&A, legal article retrieval, and customer service knowledge support. Without a knowledge base, the AI primarily relies on its own model capabilities to answer questions. Once a knowledge base is connected, the AI first searches your materials and then organizes answers based on the search results.
In this case, we import the _Civil Code of the People's Republic of China_ into the knowledge base and create a Civil Code Q&A assistant. When users ask questions in natural language, the assistant should prioritize citing the original Civil Code text to reduce fabricated responses.
Think of the knowledge base as a "reference room" configured for the AI. The model itself has general knowledge but doesn't know your company policies, product details, internal processes, or specific regulatory versions. The knowledge base turns these materials into searchable content, allowing the AI to look up information before organizing an answer. For legal, policy, customer service, and after-sales scenarios, this is more controllable than relying solely on the model's memory.
### 2.2 Preparation
- Example file: Prepare a copy of the _Civil Code of the People's Republic of China_ or another regulatory/documentation file.
- A usable conversation model and vector model.
- A legal question for testing, e.g., "My lease isn't up yet, but the landlord wants to sell the house. What should I do?"
### 2.3 Configuration Steps
1. **Create a Knowledge Base**
Click **Knowledge Base** on the left side of the homepage, then click **New** in the top right corner. Name the knowledge base `Civil Code Q&A Assistant`. Keep the other default settings for this case.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-12.png)
2. **Create a Text Dataset**
Click **New**, then select **Text Dataset** to import local documents.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-13.png)
3. **Upload a Local File**
Click **Upload Local File** and select the example file. In real use, you can upload multiple files at once; for this case, we upload only one file as a demonstration.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-14.png)
4. **Set Parsing Parameters**
After entering the parameter settings page, choose the parsing method based on the file type.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-15.png)
Recommended common settings:
- **File Parsing Settings**: Enable when uploading PDFs; for regular Word, Markdown, TXT files, start with the default configuration.
- **Processing Method**: For most scenarios, choose chunked storage — it's lower cost and faster for retrieval.
- **Chunking Conditions**: Controls how many tokens each chunk contains. Use the default values for quick testing.
- **Index Enhancement**: For plain text, usually check the first two options; if the document contains images, enable image-related enhancements.
These parameters directly affect the quality of subsequent Q&A. If chunks are too large, search results may include too much irrelevant content, making answers verbose. If chunks are too small, key context may be split, causing answers to lack supporting evidence. For the quick-start phase, use the default configuration. When officially integrating enterprise policies, contracts, or product manuals, adjust these parameters gradually based on Q&A performance.
5. **Preview Chunking Results**
After reaching the data preview step, check whether the chunks are complete and readable. If chunks are too long or too short, go back and adjust the parameters.
When previewing chunks, focus on three things: whether paragraphs are abnormally cut off, whether titles and body text remain within the same semantic range, and whether tables, clauses, or numbering are still readable. If the quality of these knowledge fragments is unstable, even a well-written Prompt in the application will struggle to consistently produce accurate answers.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-16.png)
6. **Wait for the Knowledge Base to Be Ready**
Once the data status changes to "Ready," the knowledge base can be referenced by applications.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-17.png)
7. **Create and Link a Conversational Agent**
Create a new Conversational Agent, also named `Civil Code Q&A Assistant`. After creation, link the knowledge base you just created in the application configuration.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-18.png)
After linking the knowledge base, the application's response flow changes from simple conversation to "user question → knowledge base search → model summarizes answer." This is the key difference between Case 1 and Case 2: Case 1 emphasizes content generation, while Case 2 emphasizes answering based on provided materials.
8. **Configure the Q&A Prompt**
The Civil Code Q&A assistant needs to emphasize "answer based on the knowledge base" and "cite the original text." You can use the following Prompt:
```md
You are a professional Civil Code Q&A assistant, answering legal questions based on the original text of the _Civil Code of the People's Republic of China_.
Rules:
- Strictly answer based on the Civil Code articles retrieved from the knowledge base; do not fabricate legal provisions.
- Every answer must cite the original Civil Code text (book, chapter, article).
- If there is no directly corresponding provision in the Civil Code, state this honestly and do not give legal advice.
- When applying the law to specific cases, remind the user: "This answer is for reference only; please consult a professional lawyer."
- Provide plain-language explanations of legal terms so that users without a legal background can understand.
Output format:
1. **Legal Conclusion** (1–3 sentence summary)
2. **Relevant Article Citation** (original excerpt + book/chapter/article number)
3. **Plain-Language Explanation** (explain the meaning of the article in everyday language)
4. **Practical Advice** (2–3 actionable suggestions)
5. **Disclaimer** ("This answer is based on the original Civil Code text and does not constitute legal advice. For specific cases, please consult a professional lawyer.")
```
For legal Q&A scenarios, it's especially important to define boundaries: what can be answered is a general explanation based on the materials; the model's output should never be packaged as formal legal advice. Requiring article citations, stating uncertainty, and adding disclaimers in the Prompt all aim to make the output more traceable and compliant with high-risk knowledge Q&A usage norms.
9. **Configure the Opening Message**
The opening greeting can include a few example questions to help users quickly understand how to use this assistant:
```text
Hello! I'm the Civil Code Q&A Assistant ⚖️
I answer legal questions based on the original text of the *Civil Code of the People's Republic of China*.
You can ask me:
["My lease isn't up yet, but the landlord wants to sell the house. What should I do?"]
["I received a product I bought online and it was broken, but the seller won't accept a return. What does the law say?"]
["The upstairs neighbor's leak soaked my ceiling. Can I claim compensation?"]
⚠️ Note: My answers are for reference only. For specific legal issues, please consult a professional lawyer.
```
If you add `[question content]` in the opening greeting, users can click the question to ask it directly — useful for demonstrations and guidance.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-19.png)
10. **Verify Q&A Performance**
Ask a question related to the Civil Code and check whether the answer includes a legal conclusion, article citation, plain-language explanation, and disclaimer.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-20.png)
When verifying, don't just check whether the answer "looks like a legal answer" — also check whether it actually references the knowledge base content. It's recommended to test with questions inside the materials, outside the materials, and ambiguous questions: questions inside the materials should cite the original text; questions outside the materials should state that a direct confirmation is not possible; ambiguous questions should proactively prompt the user to provide more facts.
### 2.4 Business Value
- **Lower the barrier to material retrieval**: Turn lengthy regulations, policies, and manuals into a natural language Q&A entry point, allowing business users to quickly find relevant content without needing to know keywords or directory locations first.
- **Improve answer credibility**: Through knowledge base retrieval and original text citations, answers have a source basis, reducing the risk of the model fabricating or giving vague responses based on experience.
- **Accumulate organizational knowledge**: Internal company policies, product FAQs, after-sales SOPs, contract templates, and other materials can be continuously added to the knowledge base, forming maintainable and reusable knowledge assets.
- **Adapt to high-frequency support scenarios**: Legal, HR, administrative, customer service, and delivery teams can all use a similar model to turn repetitive inquiries into self-service Q&A, improving response efficiency.
## Case 3: Workflow — Content Review and Automatic Rewriting
### 3.1 Use Cases
Workflows are ideal for tasks with fixed steps, clear logic, and the need for branching decisions or human confirmation. This case breaks down content compliance review into several stages: knowledge base retrieval, AI classification, conditional branching, automatic rewriting, rejection explanation, and human confirmation, simulating the review process before enterprise content is published.
Its core value lies in two aspects:
1. **Automation**: Once triggered, the system automatically executes multiple steps according to the preset workflow.
2. **Standardization**: The same input goes through the same judgment and processing, reducing human variability.
To determine whether a task is suitable for a workflow, check if it has three characteristics: "stable steps, clear rules, and repeatable execution." Content review is a typical scenario: the input is content to be published, the rules come from a compliance knowledge base, and the output is usually pass, rewrite, or reject, with the option to add human confirmation in between. This improves processing efficiency while retaining risk control.
### 3.2 Preparation
First, create a "Content Compliance Rules" knowledge base and upload a simple text file. You can directly use the following rule template:
```text
Content Compliance Rules
Safe Content (can be published directly)
- Objective factual statements
- Normal event notifications, meeting arrangements
- Product feature descriptions (based on real data)
- Industry knowledge sharing
Sensitive Wording (needs rewriting)
- Absolute language: "best," "first," "100%," "absolute," "only"
- Exaggerated claims: "disrupting the industry," "unprecedented," "unmatched"
- Unverified data: conversion rates, satisfaction rates, growth rates without sources
- Comparative disparagement: directly naming competitors and belittling them
Prohibited Content (must not be published)
- Illegal information: involving pornography, gambling, drugs, fraud, pyramid schemes
- Personal attacks: insults, defamation against individuals or groups
- False information: fabricated data, forged qualifications, impersonating official sources
- Sensitive topics: political sensitivity, religious discrimination, regional attacks
```
The rule base does not need to be complex at the start. For quick validation, split the rules into three categories: "safe, needs rewriting, prohibited." For formal use, you can continue adding rules by industry, brand, channel, or region, such as advertising-sensitive terms, medical compliance requirements, prohibited financial marketing claims, brand tone guidelines, and so on.
### 3.3 Workflow Design
Before configuring nodes, it's recommended to confirm the complete workflow. This case can be designed as follows:
1. **User Input**: As the workflow starting point, receives the content to be reviewed.
2. **Knowledge Base Retrieval**: Recalls relevant rules from the content compliance rules base. It is recommended to set the citation limit to 1-2 entries.
3. **AI Content Compliance Classification**: Combines user input and retrieval results to classify the content as "Safe / Sensitive but Rewritable / Prohibited."
4. **Conditional Branching**: Enters different branches based on the classification result.
5. **Safe Branch**: Directly outputs the original text, indicating it can be published.
6. **Sensitive but Rewritable Branch**: Calls AI to rewrite the content, then submits it for user confirmation.
7. **Prohibited Branch**: Outputs a rejection explanation and provides revision suggestions.
8. **Final Output**: Returns the original text, rewritten version, or rejection explanation.
When designing a workflow, first determine the responsibility of each node to avoid having a single AI node simultaneously handle "retrieving rules, judging classification, rewriting content, explaining reasons," etc. Once responsibilities are clearly separated, each node's prompt will be shorter and more stable, making it easier to locate issues later: whether the knowledge base failed to recall rules, the review node misclassified, or the condition in the decision node didn't match.
### 3.4 Configuration Steps
1. **Create a Workflow**
Go to the workflow homepage, click "New Workflow," and name it `Content Review and Automatic Rewriting`.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-21.png)
After creation, enter the workflow editing page.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-22.png)
The complete workflow diagram for this case is as follows:
![Content Compliance Review Workflow](/imgs/guide/getting-started/quick-start/image-23.png)
2. **Configure the Opening Message**
In the system configuration, fill in the opening statement to explain the assistant's review rules and usage.
```md
Hello! I am the Content Compliance Review Assistant 🛡️
Please send me the content you need reviewed, and I will automatically judge it according to the rules:
- **✅ Safe** — Content has no sensitive information and can be published directly
- **⚠️ Sensitive but Rewritable** — Contains correctable wording; I will rewrite it and send it back for your confirmation
- **🚫 Prohibited** — Contains red-line content and is rejected with an explanation
Supports single text review or batch submission (multiple items separated by line breaks).
**Let's get started.**
```
3. **Call the Knowledge Base**
Add a knowledge base retrieval node in the workflow, select the previously created content compliance rules base. The input for this node uses the user input, and the output is referenced by subsequent AI nodes.
The purpose of this node is not to have the model read the entire rule base, but to retrieve the rule fragments most relevant to the current content for the subsequent review node. You can initially set the citation limit to 1-2 entries to keep the prompt context focused; if the rule base is larger or the categories are more detailed, gradually increase the citation count.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-24.png)
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-25.png)
4. **Configure the Content Review Node**
Add an AI dialogue node and rename it to "Content Review Node." This node is responsible for outputting the classification result based on the user input and knowledge base rules.
```md
You are a content compliance review expert. Based on the compliance rules retrieved from the knowledge base, determine the compliance level of the user's input content.
Classification criteria:
- Safe: Content has no sensitive information and can be published directly
- Sensitive but Rewritable: Contains correctable sensitive wording; can be published after rewriting
- Prohibited: Contains red-line content and cannot be published
Output format:
Output only one of three labels: Safe / Sensitive but Rewritable / Prohibited
```
Note: The knowledge base reference must select the previously created knowledge base, otherwise the AI cannot read the rule content.
The output of the review node should be as stable as possible, because it directly affects the decision node's branching. For a quick demo, you can output only the three labels "Safe / Sensitive but Rewritable / Prohibited"; if you need stricter automation integration later, you can switch to structured output, such as returning the classification, reason, and matched rules together, making it easier for downstream nodes to perform precise matching and logging.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-26.png)
5. **Test the Review Node**
Click "Run" in the top right corner, input a piece of content to be reviewed, and confirm that the review node returns a stable classification result.
Test this node individually instead of waiting until the entire workflow is built. Input a normal event announcement, marketing copy containing absolute language, and clearly prohibited text, and observe whether the classification meets expectations. If the classification is unstable, first adjust the rule base wording and the review prompt before continuing to configure subsequent branches.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-27.png)
6. **Hide Intermediate Output**
Click the settings button on the right side of the model to adjust the node's basic settings. Since the user only needs the final result, it is recommended to hide the intermediate output of the content review node.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-28.png)
7. **Configure the Decision Node**
Add a decision node to branch based on the "Safe / Sensitive but Rewritable / Prohibited" output from the content review node.
The decision node acts as a switch in the workflow. The more stable the output from the previous step, the easier it is to configure the decision node; if the review node's output contains explanatory text, the condition may fail to match. Therefore, in branching workflows, it is common to first constrain the output format of the upstream node before configuring the decision node conditions.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-29.png)
8. **Configure the Safe Branch**
When the review result is "Safe," directly output the original text. In a production scenario, you could also add spot-checking or human confirmation.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-30.png)
The output effect is as follows:
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-31.png)
9. **Configure the Sensitive but Rewritable Branch**
When the review result is "Sensitive but Rewritable," add an AI dialogue node to automatically rewrite the content. You can use the following prompt:
```md
You are a content rewriting expert. Rewrite the user's input content into a compliant version.
Rewriting principles:
- Preserve the original meaning and information, do not change the core expression
- Replace absolute language with objective statements, e.g., "best" → "industry-leading"
- Replace unverified data statements with reasonable speculation, e.g., "100% effective" → "most users report it effective"
- Replace sensitive wording with neutral expressions
- Maintain the original style and tone
```
After rewriting, you can add a user choice node to let the user accept the rewrite, continue rewriting, or abandon it.
The human confirmation node is suitable for paths that are risky but correctable. AI can propose rewrite suggestions, but whether to publish is still left to the business personnel to confirm. This reduces the time spent on initial screening and repeated revisions while not handing over the final publishing decision entirely to the automated workflow.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-32.png)
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-33.png)
If the user accepts the rewrite, output the rewritten result; if the user chooses to continue rewriting, it can be connected back to the content rewriting node; if the user abandons it, output the original text.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-34.png)
10. **Configure the Prohibited Branch**
When the review result is "Prohibited," add an AI dialogue node to output a rejection explanation. You can use the following prompt:
```md
The content submitted by the user cannot be published because it contains prohibited information. Please explain the reason in a polite and professional tone.
Output format:
1. One sentence stating that the content cannot be published
2. List specific violation points (1-3 items)
3. Provide alternative suggestions (e.g., suggest which aspects to modify before resubmitting)
```
11. **Verify the Complete Workflow**
Input safe content, sensitive content, and prohibited content separately, and confirm that all three branches return the expected results.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-35.png)
When verifying the complete workflow, it is recommended to record the input, review classification, branch entered, and final output for each test case. If the output does not meet expectations, troubleshoot node by node: first check whether the knowledge base recalled the correct rules, then whether the review node classified accurately, and finally whether the decision node conditions and branch output are configured correctly.
### 3.5 Business Value
- **Standardize review rules into a workflow**: Embed the judgment criteria for pre-publication content review into a knowledge base and node configuration, reducing reliance on personal experience passed down verbally.
- **Improve processing efficiency**: Safe content can pass quickly, sensitive content is automatically rewritten, and prohibited content receives a direct explanation, allowing reviewers to focus on content that requires judgment.
- **Retain human control points**: Add user confirmation for gray-area scenarios like "sensitive but rewritable," preventing the automated workflow from making publishing decisions directly for business personnel.
- **Easy to reuse and extend**: The same workflow can be applied to marketing copy, customer service scripts, announcements, event pages, short video scripts, and other content review scenarios by replacing the rule base and a few prompts.
- **Reduce compliance risk**: Through fixed branches and rejection explanations, high-risk content has a clear interception path, reducing the risk of accidental publication, exaggerated claims, or non-compliant expressions.
## Case 4: Agent V2 — Intelligent Data Analysis Agent
### 4.1 Use Cases
Agent V2 is ideal for open-ended, multi-step tasks that require dynamic planning. Unlike workflows, where every step must be predefined, Agent V2 is better suited for tasks with “unfixed steps,” such as data analysis, file processing, multi-tool collaboration, and complex problems that require follow-up clarification.
This case simulates the daily data analysis needs of operations, product, or sales teams: upload an Excel file, ask questions in natural language, and let the Agent autonomously read the file, formulate an analysis plan, and execute the analysis in a virtual machine.
In Case 3, the workflow required you to design a fixed path of “retrieval rules → classification → branching → rewriting or rejection.” Agent V2, on the other hand, acts more like an autonomous executor. You don’t need to define every step in advance; just provide the goal and the file. The Agent decides whether to read the file first, perform statistics, ask follow-up questions, or run code based on the data structure and problem complexity.
Data analysis is a great way to experience Agent V2 because it naturally has three characteristics: the analysis path is not fixed, it often requires multi-step reasoning, and the requirements may need clarification. With the same Excel file, different users might care about product sales, channel ROI, regional trends, or anomalous orders. A fixed workflow can hardly cover all paths in advance, but Agent V2 can dynamically plan based on the question.
### 4.2 Preparation
- Sample file: Prepare a sales data Excel or CSV table.
- A conversation model that supports Agent V2.
- Virtual machine capability is available in the current environment.
### 4.3 Configuration Steps
1. **Create an Agent V2 Application**
In the workspace, click “Create Application,” select `Conversational Agent V2 (Beta)`, and name it `Intelligent Data Analysis Agent`.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-36.png)
2. **Configure Model and Prompt**
Continue using the GLM-5.1 model for AI configuration. The system prompt can refer to:
```md
You are a senior data analyst Agent. You can read data files uploaded by users, run Python analysis code in the sandbox, and proactively ask users for clarification.
Tools:
- 📄 **Read File** — Read Excel/CSV data uploaded by the user
- 💻 **Sandbox Execution** — Run Python scripts (pandas/matplotlib/numpy)
- ❓ **Proactive Follow-up** — Confirm with the user when analysis requirements are unclear
Workflow:
1. After receiving data and a question, first read the file to understand the data structure and content
2. Formulate an analysis plan and present it to the user as a list of steps
3. Execute step by step according to the plan, showing key findings at each step
4. Proactively ask follow-up questions when encountering ambiguous requirements, such as unclear metric definitions or missing comparison baselines
5. Dynamically update the plan based on follow-up results
6. Output an analysis report containing data overview, core findings, visual charts, and business recommendations
Security Rules:
- Only data analysis is allowed in the sandbox; no network access, no writing files to the host machine
- Data is used only for this analysis; do not expose raw sensitive data in the report
- Mark confidence levels for uncertain conclusions
Output Format:
1. 📋 Analysis Plan (automatically generated based on data)
2. 📊 Data Overview (row count, column names, missing values, basic statistics)
3. 🔍 Core Findings (3-5 key insights, supported by charts)
4. 💡 Business Recommendations (actionable suggestions based on data)
```
The key point of this prompt is to have the Agent plan before executing, rather than jumping straight to conclusions. For data analysis tasks, first reading the data structure, confirming field meanings, and formulating an analysis plan can significantly reduce the risk of misunderstanding requirements or misusing metrics. In production use, you can continue to supplement internal metric definitions, such as GMV, ROI, conversion rate, active customers, repurchase rate, etc.
3. **Configure the Opening Message**
The opening remarks guide the user to upload a data file and ask analysis questions:
```text
Hello! I am the Intelligent Data Analysis Agent 📊
Just drag and drop your Excel or CSV file here and tell me what you want to analyze.
For example:
- "Analyze this sales data and find the best-selling products and trends"
- "Help me look at changes in user activity and find the reasons for the decline"
- "Compare the conversion rates of three channels, which one has the highest ROI?"
I will first understand your data, formulate an analysis plan, and then run the analysis code in the sandbox.
I will proactively ask you for clarification when needed.
```
4. **Enable Virtual Machine Capability**
Data analysis usually requires reading files and executing code, so the virtual machine configuration needs to be enabled.
The virtual machine capability is used to isolate the code execution environment. The Agent can run data analysis scripts, read uploaded files, and generate statistical results within it, without directly affecting the local host environment. For scenarios that require running Python, processing Excel, drawing charts, or performing batch calculations, this is an important capability that distinguishes Agent V2 from ordinary conversation applications.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-37.png)
5. **Upload File and Test**
Upload the sample sales data file and enter the question:
```text
Help me analyze this sales data to see which products sell well and which channel has the highest ROI
```
The Agent will first break down the task and then execute the analysis step by step.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-38.png)
During execution, you can see the task running in the virtual machine without affecting the local environment.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-39.png)
When testing, focus on whether the Agent has a complete analysis process: does it first identify the table fields, explain the analysis plan, run code when needed, and give business recommendations based on the results? If the problem description is unclear, the ideal behavior is not to force an analysis but to first ask the user for key definitions.
### 4.4 Verification of Results
The final result should include the analysis plan, data overview, core findings, and business recommendations.
![FastGPT screenshot](/imgs/guide/getting-started/quick-start/image-40.png)
When verifying results, it is recommended to focus on four dimensions: whether the conclusions come from actual data, whether the metric definitions are clear, whether the charts or statistics support the conclusions, and whether the business recommendations are actionable. The value of a data analysis Agent is not just to output a summary, but to connect the process of “reading data, calculating metrics, explaining results, and proposing recommendations.”
### 4.5 Business Value
- **Lower the barrier to data analysis**: Business users can directly upload Excel or CSV files and ask questions in natural language, without needing to write SQL, Python, or complex formulas first.
- **Support open-ended exploration**: The same data can be repeatedly queried around sales, channels, regions, customers, trends, outliers, etc., suitable for scenarios without a fixed analysis path.
- **Increase analysis transparency**: The Agent shows the analysis plan and key steps, so users can see how it understands the data, calculates metrics, and draws conclusions.
- **Isolate code execution risk**: By executing analysis scripts in a virtual machine, risks of local environment contamination, dependency conflicts, and permission misuse are reduced.
- **Consolidate business analysis capabilities**: Scenarios such as sales reviews, weekly operations reports, campaign attribution, and product metric diagnostics can all reuse this type of Agent, turning data analysis from an expert task into a daily workflow.
## Choosing Between the Four Types
After completing the four cases, you can understand the common application types of FastGPT as a progression from simple to complex capabilities: Conversational Agent solves "how to answer and generate content," Knowledge Base solves "what materials to base answers on," Workflow solves "what fixed process to follow," and Agent V2 solves "how to autonomously plan and execute open-ended tasks."
| Application Type | Suitable Scenarios | Core Capabilities |
| ------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------ |
| Conversational Agent | Lightweight Q&A, copywriting, standardized output | Prompt, model configuration, tool calling |
| Knowledge Base + Conversational Agent | Q&A based on documents, policies, regulations, product manuals | File import, knowledge base retrieval, citing sources |
| Workflow | Fixed steps, conditional branches, review flows, automated processing | Node orchestration, decision nodes, human confirmation |
| Agent V2 | Data analysis, complex tasks, multi-step reasoning, dynamic planning | Autonomous planning, tool calling, virtual machine execution |
When selecting, you can judge based on task complexity:
1. If it's just lightweight conversation or standardized copy generation, prioritize the Conversational Agent.
2. If answers must be based on existing materials, choose Knowledge Base + Conversational Agent.
3. If the process is fixed and requires conditional branches, human confirmation, or automated processing, choose Workflow.
4. If the task is open-ended with unfixed steps and requires autonomous analysis, tool calling, or code execution, choose Agent V2.
In real projects, you can also combine these capabilities. For example, a customer service assistant can use a Knowledge Base to answer product questions and then query orders via tools; content review can use a Workflow to fix the review path while maintaining rules with a Knowledge Base; data analysis scenarios can first use Agent V2 for exploration, then solidify stable analysis steps into a Workflow.
--- ---
title: 快速上手 title: 快速上手
description: 快速体验 FastGPT 基础功能 description: 通过对话 Agent、知识库、工作流和 Agent V2 四个案例快速体验 FastGPT
--- ---
更多使用技巧,[查看视频教程](https://www.bilibili.com/video/BV1sH4y1T7s9) 本文通过四个完整案例,帮助你快速理解 FastGPT 的核心应用类型,并完成从简单对话到复杂任务编排的基础搭建。
## 知识库 本页适合第一次接触 FastGPT 的用户,也适合售前、交付、运营、法务、行政等角色快速体验平台能力。完成本页后,你将依次搭建:
开始前,请准备一份测试电子文档,WORD、PDF、TXT、excel、markdown 都可以,比如公司休假制度、不涉密的销售说辞、产品知识等等。 1. 对话 Agent:企业邮件撰写助手。
2. 知识库 + 对话 Agent:民法典问答助手。
3. 工作流:内容审核与自动改写。
4. Agent V2:智能数据分析 Agent。
这里使用 FastGPT 中文 README 文件为例。 建议提前准备以下内容:
首先我们需要创建一个知识库。 - 可用的 AI 模型,例如 GLM-5.1 或其他已配置模型。
- 一个知识库测试文件,例如民法典、公司制度、产品手册等。
- 如果要测试 Email 工具,准备邮箱 SMTP 授权码。
- 如果要测试 Agent V2 数据分析,准备一个 Excel 或 CSV 示例文件。
![](/imgs/create-rep.png) 阅读时建议重点关注三件事:每种应用类型适合解决什么问题、关键配置为什么这样写、验证时应该观察哪些效果。本文中的参数和 Prompt 都是可复用的起点,正式落地时可以替换为你自己的业务资料、审核规则、通知渠道和数据文件。
知识库创建完之后我们需要上传一点内容。 ## 案例一:对话 Agent—企业邮件撰写助手
上传内容这里有四种模式: ### 1.1 适用场景
- 手动输入:手动输入问答对,是最精准的数据
- QA 拆分:选择文本文件,让AI自动生成问答对
- 直接分段:选择文本文件,直接将其按分段进行处理
- CSV 导入:批量导入问答对
这里,我们选择 QA 拆分,让 AI 自动生成问答,若问答质量不高,可以后期手动修改。 对话 Agent 适合轻量问答、内容生成、文案润色、标准化输出等场景。本案例不关联知识库,也不依赖复杂流程,只通过模型配置、Prompt 和 Email 工具完成一个企业邮件撰写助手。
![](/imgs/upload-data.png) 企业员工经常需要处理项目同步、跨部门协作、客户回复、会议纪要等邮件。通过 AI 统一邮件格式和表达风格,可以提升写作效率,也能保持企业对外沟通的专业性。
点击上传后我们需要等待数据处理完成,直到我们上传的文件状态为可用。 这个案例的重点不是让 AI 随意生成一封邮件,而是把企业邮件写作中的稳定要求沉淀到 Prompt 中,例如主题行、称呼、正文结构、行动项和风险提醒。对于新手来说,它也是理解 FastGPT 应用配置的最小闭环:先定义角色,再约束输出,最后通过工具扩展执行动作。
![](/imgs/upload-data2.png) ### 1.2 配置步骤
## 应用 1. **创建对话 Agent**
点击「应用」按钮来新建一个应用,这里有四个模板,我们选择「知识库 + 对话引导」。 在工作台点击新建,选择对话 Agent,应用名称填写为 `企业邮件撰写助手`。
![](/imgs/create-app.png) ![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-01.png)
应用创建后来再应用详情页找到「知识库」模块,把我们刚刚创建的知识库添加进去。 2. **进入应用配置页**
![](/imgs/create-app2.png) 创建完成后进入应用配置页。页面通常分为左右两栏:左侧是 AI 配置,右侧是调试预览。
添加完知识库后记得点击「保存并预览」,这样我们的应用就和知识库关联起来了。 ![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-02.png)
![](/imgs/create-app3.png) 3. **选择模型**
然后我们就可以愉快的开始聊天啦。 在 AI 配置中选择对话 Agent 使用的基础模型。本案例使用 GLM-5.1,你也可以替换为当前环境中已配置的其他可用模型。
![](/imgs/create-app4.png) 选择模型时优先关注两点:一是模型是否擅长中文商务表达,二是输出是否稳定遵守格式。邮件撰写属于低风险、低结构复杂度任务,通常不需要过度追求最强模型,但要确保语气自然、指令遵循能力较好。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-03.png)
4. **编写 Prompt**
Prompt 需要清晰描述助手的角色、输出格式和约束。可以使用以下示例:
```md
你是一个企业邮件撰写专家,帮助员工撰写专业、清晰、得体的工作邮件。
输出格式:
- **主题行**:简洁明确
- **称呼**:根据收件人关系选择“尊敬的 XX 总”或“Hi XX”
- **正文**:三段式(背景 → 核心内容 → 行动项)
- **落款**:署名、职位、部门
规则:
- 正文控制在 200-500 字
- 行动项和待办用项目符号列出
- 涉及薪资、人事、法律等敏感内容时,提醒用户谨慎发送
- 不确定收件人关系时使用中性礼貌语气
```
将 Prompt 写入提示词模块。
这段 Prompt 由三部分组成:角色定义用于稳定助手身份,输出格式用于约束邮件结构,规则用于控制风险边界。实际业务中可以继续补充企业语气要求、品牌用语、禁用词、签名格式等内容,让输出更贴合内部规范。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-04.png)
5. **添加 Email 工具**
工具是对复杂操作的封装。本案例使用 Email 邮件发送工具,让 AI 助手在生成邮件后具备发送能力。点击工具右侧的加号,选择 Email 邮件发送。
可以把工具理解为 AI 的外部能力。没有工具时,助手只能生成邮件正文;添加 Email 工具后,助手可以在用户确认后执行发送动作。正式环境中建议先让助手生成邮件草稿,再由用户确认发送,避免误发或发送给错误收件人。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-05.png)
6. **配置 Email 工具**
进入工具配置页,填写邮件服务相关参数。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-06.png)
7. **激活工具**
点击设置后进入工具激活页面,再点击工具激活。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-07.png)
8. **填写邮箱 SMTP 信息**
本案例以 QQ 邮箱为例。测试时可以按以下方式填写:
```text
SMTP 服务器地址:smtp.qq.com
SMTP 端口:465
启用 SSL
SMTP 用户名:邮箱地址
SMTP 密码:授权码
```
授权码可参考 [授权码获取教程](https://cloud.tencent.com/developer/article/2177098)。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-08.png)
9. **设置对话开场白**
对话开场白用于告诉用户这个 AI 助手可以做什么。可以填写:
```text
你好!我是邮件撰写助手 📧
请告诉我:收件人是谁?邮件目的是什么?需要包含哪些关键信息?
我会帮你生成一封专业、得体的邮件。
```
填写后,可以在右侧预览区域看到效果。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-09.png)
10. **验证运行效果**
配置完成后,在调试预览中输入邮件需求,检查助手是否能生成结构清晰、语气得体的邮件。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-10.png)
如果用户信息不足,助手应主动提示补充收件人、邮件目的、关键信息等内容。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-11.png)
验证时建议至少测试三类输入:信息完整的邮件需求、缺少收件人或目的的模糊需求、包含敏感信息的邮件需求。一个可上线的邮件助手不只要“能写”,还要能在信息不足时追问,在敏感场景下提醒用户谨慎发送。
### 1.3 业务价值
- **提升写作效率**:将项目同步、客户跟进、会议纪要等高频邮件从“从零写”变成“填写关键信息后生成”,减少重复劳动。
- **统一沟通标准**:把称呼、正文结构、行动项、落款等规范固化到 Prompt 中,降低不同员工写作风格差异带来的沟通成本。
- **降低发送风险**:通过 Prompt 增加敏感信息提醒、信息缺失追问和中性语气约束,减少不完整、不恰当或过度承诺的邮件。
- **扩展办公自动化**:配合 Email 工具后,可以继续接入通知、审批、飞书、钉钉、企业微信等办公流程,将邮件撰写从内容生成延伸到业务动作执行。
## 案例二:知识库 + 对话 Agent—民法典问答助手
### 2.1 适用场景
知识库适合“回答必须基于资料”的场景,例如制度问答、产品手册问答、法律条文检索、客服知识支持等。没有知识库时,AI 主要依赖模型自身能力回答;接入知识库后,AI 会先检索你的资料,再基于检索结果组织答案。
本案例将《中华人民共和国民法典》导入知识库,并创建一个民法典问答助手。用户用自然语言提问时,助手需要优先引用民法典原文,减少凭空生成。
可以把知识库理解为给 AI 配置的“资料室”。模型本身具备通用知识,但不了解你的公司制度、产品细节、内部流程或指定法规版本;知识库把这些资料变成可检索内容,让 AI 在回答前先查资料,再组织答案。对于法律、制度、客服、售后等场景,这比单纯依赖模型记忆更可控。
### 2.2 准备内容
- 示例文件:准备一份《中华人民共和国民法典》或其他法规制度类文档。
- 一个可用的对话模型和向量模型。
- 一个用于测试的法律问题,例如“租房合同没到期,房东要卖房,我该怎么办?”。
### 2.3 配置步骤
1. **创建知识库**
在主页点击左侧的知识库,进入后点击右上角的新建。知识库名称填写为 `民法典问答助手`,案例阶段其他配置保持默认即可。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-12.png)
2. **创建文本数据集**
点击新建,再选择文本数据集,用于导入本地文档。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-13.png)
3. **上传本地文件**
点击上传本地文件,选择示例文件。实际使用时可以同时上传多个文件,本案例只上传一个文件作为演示。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-14.png)
4. **设置解析参数**
进入参数设置页后,根据文件类型选择解析方式。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-15.png)
常用配置建议:
- **文件解析设置**:上传 PDF 时建议开启;普通 Word、Markdown、TXT 等文件可先使用默认配置。
- **处理方式**:大多数场景选择分块存储,成本较低,检索速度也更快。
- **分块条件**:控制每个分块包含多少 Token,快速测试时使用默认值即可。
- **索引增强**:纯文本通常勾选前两个选项;如果文档包含图片,可勾选图片相关增强。
这些参数会直接影响后续问答质量。分块过大时,检索结果可能包含太多无关内容,回答容易变得冗长;分块过小时,关键上下文可能被拆散,回答容易缺少依据。快速上手阶段可以先使用默认配置,正式接入企业制度、合同、产品手册时,再根据问答效果逐步调整。
5. **预览分块效果**
到数据预览步骤后,检查分块是否完整、可读。如果分块过长或过短,再返回调整参数。
预览分块时重点看三点:段落是否被异常截断,标题与正文是否保留在同一语义范围内,表格、条款或编号是否仍然可读。只要这里的知识片段质量不稳定,后续应用即使 Prompt 写得很好,也很难稳定给出准确答案。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-16.png)
6. **等待知识库就绪**
当数据状态变为“已就绪”后,知识库即可被应用引用。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-17.png)
7. **创建并关联对话 Agent**
创建一个新的对话 Agent,名称同样填写为 `民法典问答助手`。创建完成后,在应用配置中关联刚刚创建的知识库。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-18.png)
关联知识库后,应用的回答链路会从单纯对话变成“用户问题 → 知识库检索 → 模型总结回答”。这也是案例一和案例二的关键差异:案例一强调内容生成,案例二强调基于资料回答。
8. **配置问答 Prompt**
民法典问答助手需要强调“基于知识库回答”和“引用原文”。可以使用以下 Prompt:
```md
你是一个专业的民法典问答助手,基于《中华人民共和国民法典》原文回答法律问题。
规则:
- 严格基于知识库检索到的民法典条文回答,不得臆造法条
- 每条回答必须引用民法典原文(编、章、条)
- 如果民法典中没有直接对应的规定,如实说明,不做法律建议
- 涉及具体案件的法律适用时,提醒用户“本回答仅供参考,建议咨询专业律师”
- 对法律术语做通俗解释,让非法学背景的用户也能理解
输出格式:
1. **法律结论**(1-3 句概述)
2. **相关法条引用**(原文摘录 + 编章节条号)
3. **通俗解读**(用日常语言解释法条含义)
4. **实务建议**(2-3 条可操作建议)
5. **免责声明**(“本回答基于民法典原文,不构成法律意见,具体案件请咨询专业律师”)
```
法律问答类场景尤其要强调边界:能回答的是基于资料的通用解释,不能把模型回答包装成正式法律意见。Prompt 中要求引用条文、说明不确定性、添加免责声明,目的都是让输出更可追溯,也更符合高风险知识问答的使用规范。
9. **配置开场白**
开场白可以内置几个示例问题,帮助用户快速理解这个助手的使用方式:
```text
你好!我是民法典问答助手 ⚖️
我基于《中华人民共和国民法典》原文,帮你解答法律问题。
你可以问我:
["租房合同没到期,房东要卖房,我该怎么办?"]
["网购商品收到后发现坏了,商家不给退,法律怎么规定?"]
["楼上漏水把我家的天花板泡了,能索赔吗?"]
⚠️ 提示:我的回答仅供参考,具体法律问题建议咨询专业律师。
```
如果在开场白里添加 `[问题内容]`,用户可以点击问题一键提问,适合用于演示和引导。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-19.png)
10. **验证问答效果**
提出一个民法典相关问题,检查回答是否包含法律结论、法条引用、通俗解读和免责声明。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-20.png)
验证时不要只看回答是否“像法律回答”,还要看它是否真的引用了知识库内容。建议同时测试资料内问题、资料外问题和模糊问题:资料内问题应能引用原文,资料外问题应说明无法直接确认,模糊问题应主动提示需要补充事实。
### 2.4 业务价值
- **降低资料检索门槛**:把长篇法规、制度、手册转成自然语言问答入口,让业务人员不用先知道关键词或目录位置,也能快速找到相关内容。
- **提升回答可信度**:通过知识库检索和原文引用,让答案具备来源依据,减少模型凭经验编造或泛泛而谈的风险。
- **沉淀组织知识**:企业内部制度、产品 FAQ、售后 SOP、合同模板等资料可以持续进入知识库,形成可维护、可复用的知识资产。
- **适配高频支持场景**:法务、HR、行政、客服、交付团队都可以使用类似模式,把重复咨询转成自助问答,提高响应效率。
## 案例三:工作流—内容审核与自动改写
### 3.1 适用场景
工作流适合步骤固定、逻辑清晰、需要分支判断或人工确认的任务。本案例将“内容合规审核”拆成知识库检索、AI 分类、条件判断、自动改写、拒绝说明和人工确认几个环节,用来模拟企业内容发布前的审核流程。
它的核心价值有两个:
1. **自动化**:一次触发后,系统可以按预设流程自动执行多个步骤。
2. **标准化**:同样的输入会经过同样的判断和处理,减少人工差异。
判断一个任务是否适合工作流,可以看它是否具备“步骤稳定、规则明确、可重复执行”三个特征。内容审核就是典型场景:输入是一段待发布内容,规则来自合规知识库,输出通常是通过、改写或拒绝,中间还可以加入人工确认,既提升处理效率,也保留风险控制。
### 3.2 准备内容
先创建一个“内容合规规则库”知识库,并上传一个简单的文本文件。可以直接使用以下规则模板:
```text
内容合规规则
安全内容(可直接发布)
- 客观事实陈述
- 正常的活动通知、会议安排
- 产品功能介绍(基于真实数据)
- 行业知识分享
敏感措辞(需改写)
- 绝对化用语:“最好的”“第一”“100%”“绝对”“唯一”
- 夸张宣传:“颠覆行业”“史无前例”“无人能比”
- 未证实数据:无来源的转化率、满意度、增长率
- 对比贬低:直接点名竞品并贬低
违规内容(禁止发布)
- 违法信息:涉及黄赌毒、诈骗、传销
- 人身攻击:针对个人或群体的侮辱、诽谤
- 虚假信息:伪造数据、虚构资质、冒充官方
- 敏感话题:政治敏感、宗教歧视、地域攻击
```
规则库不需要一开始就非常复杂。快速验证时,先把规则拆成“安全、需改写、禁止发布”三类即可;正式使用时,可以继续按行业、品牌、渠道、地区增加规则,例如广告法敏感词、医疗合规要求、金融营销禁用表达、品牌语气规范等。
### 3.3 流程设计
正式配置节点之前,建议先确认完整流程。这个案例可以按以下方式设计:
1. **用户输入**:作为工作流起点,接收待审核内容。
2. **知识库检索**:从内容合规规则库中召回相关规则,建议引用上限设置为 1-2 条。
3. **AI 内容合规分类**:结合用户输入和检索结果,将内容分为“安全 / 敏感可改 / 违规”。
4. **分支判断**:根据分类结果进入不同分支。
5. **安全分支**:直接输出原文,表示可发布。
6. **敏感可改分支**:调用 AI 改写内容,再交由用户确认。
7. **违规分支**:输出拒绝说明,并给出修改建议。
8. **最终输出**:返回原文、改写稿或拒绝说明。
工作流设计时要先确定每个节点的职责,避免让一个 AI 节点同时承担“检索规则、判断分类、改写内容、解释原因”等过多任务。职责拆清楚后,每个节点的 Prompt 会更短、更稳定,后续也更容易定位问题:是知识库没有召回规则,是审核节点分类不准,还是判断器条件没有匹配上。
### 3.4 配置步骤
1. **创建工作流**
进入工作流主页,点击新建工作流,名称填写为 `内容审核与自动改写`。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-21.png)
创建完成后进入工作流编辑页。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-22.png)
本案例的完整流程图如下:
![内容合规审核工作流](/imgs/guide/getting-started/quick-start/image-23.png)
2. **配置开场白**
在系统配置中填写开场白,说明助手的审核规则和使用方式。
```md
你好!我是内容合规审核助手 🛡️
请把需要审核的内容发给我,我会按规则自动判断:
- **✅ 安全** — 内容无敏感信息,可以直接发布
- **⚠️ 敏感可改** — 包含可修正的措辞,我会改写后发回你确认
- **🚫 违规** — 包含红线内容,直接拒绝并说明原因
支持单个文本审核,也可以批量发(多条用换行分隔)。
**开始吧。**
```
3. **调用知识库**
在工作流中添加知识库检索节点,选择前面创建的内容合规规则库。该节点的输入使用用户输入,输出供后续 AI 节点引用。
这个节点的目的不是让模型阅读完整规则库,而是把与当前内容最相关的规则片段召回给后续审核节点。引用上限可以先设置为 1-2 条,保证提示词上下文足够聚焦;如果规则库较大或分类较细,再逐步提高引用数量。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-24.png)
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-25.png)
4. **配置内容审核节点**
添加 AI 对话节点,并重命名为“内容审核节点”。该节点负责根据用户输入和知识库规则输出分类结果。
```md
你是一个内容合规审核专家。结合知识库检索到的合规规则,判断用户输入内容的合规等级。
分类标准:
- 安全:内容无敏感信息,可以直接发布
- 敏感可改:包含可修正的敏感措辞,改写后可发布
- 违规:包含红线内容,不可发布
输出格式:
仅输出三个词之一:安全 / 敏感可改 / 违规
```
注意:知识库引用处必须选择前面创建的知识库,否则 AI 无法读取规则内容。
审核节点的输出要尽量稳定,因为它会直接影响判断器分支。快速演示时可以只输出“安全 / 敏感可改 / 违规”三个词;如果后续要做更严格的自动化集成,可以改成结构化输出,例如同时返回分类、原因和命中的规则,方便下游节点做精确匹配和日志记录。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-26.png)
5. **测试审核节点**
点击右上角运行,输入一段待审核内容,确认审核节点能够返回稳定的分类结果。
这一步建议单独测试节点,而不是等全部流程搭完再调试。可以分别输入正常活动通知、包含绝对化宣传的营销文案、明显违规的文本,观察分类是否符合预期。如果分类不稳定,优先调整规则库表达和审核 Prompt,再继续配置后续分支。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-27.png)
6. **隐藏中间输出**
点击模型右侧的设置按钮,调整节点基础设置。由于用户只需要最终结果,建议隐藏内容审核节点的中间输出。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-28.png)
7. **配置判断器**
添加判断器节点,根据内容审核节点输出的“安全 / 敏感可改 / 违规”进入不同分支。
判断器相当于流程中的分流开关。上一步输出越稳定,判断器越容易配置;如果审核节点输出包含解释性文字,判断条件就可能匹配失败。因此在分支类工作流中,通常要先约束上游节点的输出格式,再配置判断器条件。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-29.png)
8. **配置安全分支**
当审核结果为“安全”时,直接输出原文即可。生产场景中也可以增加抽样复核或人工确认。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-30.png)
输出效果如下:
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-31.png)
9. **配置敏感可改分支**
当审核结果为“敏感可改”时,添加 AI 对话节点自动改写内容。可以使用以下 Prompt:
```md
你是一个内容改写专家。将用户输入的内容改写为合规版本。
改写原则:
- 保留原意和信息量,不改变核心表达
- 将绝对化用语替换为客观表述,例如“最好的”改为“行业领先的”
- 将未证实的数据表述替换为合理推测,例如“100% 有效”改为“多数用户反馈有效”
- 将敏感措辞替换为中性表达
- 保持原文风格和语气
```
改写完成后,可以添加用户选择节点,让用户选择接受改写、继续改写或放弃。
人工确认节点适合放在有风险但可修正的路径上。AI 可以负责提出改写建议,但是否发布仍交给业务人员确认。这样既能减少人工初筛和反复改稿的时间,也不会把最终发布权完全交给自动化流程。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-32.png)
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-33.png)
如果用户接受改写,输出改写结果;如果用户选择继续改写,可连接回内容改写节点;如果用户放弃,则输出原文。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-34.png)
10. **配置违规分支**
当审核结果为“违规”时,添加 AI 对话节点输出拒绝说明。可以使用以下 Prompt:
```md
用户提交的内容因涉及违规信息无法发布。请用礼貌、专业的语气说明原因。
输出格式:
1. 一句话说明内容无法发布
2. 列举具体的违规点(1-3 条)
3. 提供替代建议(如:建议修改哪些方面后重新提交)
```
11. **验证完整流程**
分别输入安全内容、敏感内容和违规内容,确认三条分支都能返回预期结果。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-35.png)
完整流程验证时,建议记录每条测试内容的输入、审核分类、进入分支和最终输出。若输出不符合预期,按节点顺序排查:先看知识库是否召回正确规则,再看审核节点分类是否准确,最后看判断器条件和分支输出是否配置正确。
### 3.5 业务价值
- **把审核规则流程化**:将内容发布前的判断标准沉淀为知识库和节点配置,减少依赖个人经验口头传递。
- **提高处理效率**:安全内容可快速通过,敏感内容自动改写,违规内容直接说明原因,让审核人员把精力集中在需要判断的内容上。
- **保留人工控制点**:对“敏感可改”这类灰度场景加入用户确认,避免自动化流程直接替业务人员做发布决策。
- **便于复用和扩展**:同样的流程可以迁移到营销文案、客服话术、公告通知、活动页面、短视频脚本等内容审核场景,只需要替换规则库和部分 Prompt。
- **降低合规风险**:通过固定分支和拒绝说明,让高风险内容有明确拦截路径,减少误发、夸大宣传或不合规表达带来的风险。
## 案例四:Agent V2—智能数据分析 Agent
### 4.1 适用场景
Agent V2 适合开放式、多步骤、需要动态规划的任务。与工作流不同,工作流需要提前定义每一步;Agent V2 更适合“步骤不固定”的任务,例如数据分析、文件处理、多工具协作和需要追问澄清的复杂问题。
本案例模拟运营、产品或销售团队的日常数据分析需求:上传 Excel 文件后,直接用自然语言提出问题,让 Agent 自主读取文件、制定分析计划,并在虚拟机中执行分析。
案例三的工作流需要你先设计“检索规则 → 分类 → 分支 → 改写或拒绝”的固定路径;Agent V2 则更像一个可以自主规划的执行者。你不需要提前定义每一步,只需要提供目标和文件,Agent 会根据数据结构和问题复杂度决定先读取文件、再做统计、是否需要追问、是否需要运行代码。
数据分析很适合用来体验 Agent V2,因为它天然具备三个特点:分析路径不固定、经常需要多步推理、需求可能需要澄清。同一份 Excel,不同用户可能关心产品销量、渠道 ROI、区域趋势或异常订单,固定工作流很难提前覆盖所有路径,而 Agent V2 可以根据问题动态规划。
### 4.2 准备内容
- 示例文件:准备一份销售数据 Excel 或 CSV 表格。
- 一个支持 Agent V2 的对话模型。
- 虚拟机能力已在当前环境中可用。
### 4.3 配置步骤
1. **创建 Agent V2 应用**
工作台点击新建应用,选择 `对话 Agent V2(Beta)`,名称填写为 `智能数据分析 Agent`。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-36.png)
2. **配置模型与 Prompt**
AI 配置继续使用 GLM-5.1 模型。系统提示词可以参考:
```md
你是一个资深数据分析师 Agent。你可以读取用户上传的数据文件、在沙箱中运行 Python 分析代码、并主动向用户追问澄清需求。
工具:
- 📄 **读取文件** — 读取用户上传的 Excel/CSV 数据
- 💻 **沙箱执行** — 运行 Python 脚本(pandas/matplotlib/numpy)
- ❓ **主动追问** — 分析需求不明确时向用户确认
工作方式:
1. 收到数据和问题后,先读取文件了解数据结构和内容
2. 制定分析计划,以步骤列表展示给用户
3. 按计划逐步执行,每步展示关键发现
4. 遇到模糊需求时主动追问,如指标定义不明确或缺少对比基准
5. 根据追问结果动态更新计划
6. 输出分析报告,包含数据概览、核心发现、可视化图表、业务建议
安全规则:
- 沙箱中只能做数据分析,禁止访问网络,禁止写文件到宿主机
- 数据仅用于本次分析,不在报告中暴露原始敏感数据
- 不确定的结论标注置信度
输出格式:
1. 📋 分析计划(根据数据自动生成)
2. 📊 数据概览(行数、列名、缺失值、基本统计)
3. 🔍 核心发现(3-5 个关键洞察,图表辅助)
4. 💡 业务建议(基于数据的可操作建议)
```
这段 Prompt 的重点是让 Agent 先规划再执行,而不是直接给结论。对于数据分析类任务,先读取数据结构、确认字段含义、制定分析计划,可以显著减少误解需求或误用指标的风险。正式使用时,可以继续补充企业内部指标定义,例如 GMV、ROI、转化率、有效客户、复购率等口径。
3. **配置开场白**
开场白用于引导用户上传数据文件并提出分析问题:
```text
你好!我是智能数据分析 Agent 📊
直接把 Excel 或 CSV 文件拖进来,告诉我你想分析什么。
例如:
- "分析这份销售数据,找出销量最好的产品和趋势"
- "帮我看看用户活跃度的变化,找出下降的原因"
- "对比三个渠道的转化率,哪个 ROI 最高?"
我会先了解你的数据,制定分析计划,然后在沙箱中运行分析代码。
需要确认的地方我会主动问你。
```
4. **开启虚拟机能力**
数据分析通常需要读取文件并执行代码,因此需要开启虚拟机配置。
虚拟机能力用于隔离代码执行环境。Agent 可以在其中运行数据分析脚本、读取上传文件、生成统计结果,但不会直接影响本地宿主环境。对于需要运行 Python、处理 Excel、绘制图表或做批量计算的场景,这是 Agent V2 区别于普通对话应用的重要能力。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-37.png)
5. **上传文件并测试**
上传销售数据示例文件,并输入问题:
```text
帮我分析这份销售数据,看看哪些产品卖得好,哪个渠道 ROI 最高
```
Agent 会先拆解任务,再逐步执行分析。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-38.png)
执行过程中可以看到任务在虚拟机中运行,不会影响本地环境。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-39.png)
测试时重点观察 Agent 是否具备完整的分析过程:是否先识别表格字段,是否解释分析计划,是否在需要时运行代码,是否根据结果给出业务建议。如果问题描述不清晰,理想行为不是强行分析,而是先向用户追问关键口径。
### 4.4 验证效果
最终结果应包含分析计划、数据概览、关键发现和业务建议。
![FastGPT 操作截图](/imgs/guide/getting-started/quick-start/image-40.png)
结果验证时建议关注四个维度:结论是否来自实际数据,指标口径是否清楚,图表或统计是否能支撑结论,业务建议是否可执行。数据分析 Agent 的价值不只是输出一段总结,而是把“读数据、算指标、解释结果、提出建议”的过程串起来。
### 4.5 业务价值
- **降低数据分析门槛**:业务人员可以直接上传 Excel 或 CSV,用自然语言提出问题,不必先写 SQL、Python 或复杂公式。
- **支持开放式探索**:同一份数据可以围绕销量、渠道、区域、客户、趋势、异常值等方向反复追问,适合没有固定分析路径的场景。
- **提升分析透明度**:Agent 会展示分析计划和关键步骤,用户可以看到它如何理解数据、如何计算指标、如何得出结论。
- **隔离代码执行风险**:通过虚拟机执行分析脚本,降低本地环境污染、依赖冲突和权限误用风险。
- **沉淀业务分析能力**:销售复盘、运营周报、活动归因、产品指标诊断等场景都可以复用这一类 Agent,把数据分析从专家任务变成日常工作流。
## 四种类型选型回顾
完成四个案例后,可以把 FastGPT 的常见应用类型理解为从简单到复杂的能力递进:对话 Agent 解决“怎么回答和生成内容”,知识库解决“基于什么资料回答”,工作流解决“按什么固定流程处理”,Agent V2 解决“面对开放任务如何自主规划和执行”。
| 应用类型 | 适合场景 | 核心能力 |
| ------------------- | -------------------------------------- | ------------------------------ |
| 对话 Agent | 轻量问答、文案生成、标准化输出 | Prompt、模型配置、工具调用 |
| 知识库 + 对话 Agent | 基于资料、制度、法条、产品手册的问答 | 文件导入、知识库检索、引用原文 |
| 工作流 | 固定步骤、条件分支、审核流、自动化处理 | 节点编排、判断器、人工确认 |
| Agent V2 | 数据分析、复杂任务、多步推理、动态规划 | 自主规划、工具调用、虚拟机执行 |
选型时可以按任务复杂度判断:
1. 如果只是做轻量对话或标准化文案生成,优先选择对话 Agent。
2. 如果回答必须基于已有资料,选择知识库 + 对话 Agent。
3. 如果流程固定且需要条件分支、人工确认或自动化处理,选择工作流。
4. 如果任务开放、步骤不固定,并且需要自主分析、工具调用或代码执行,选择 Agent V2。
实际项目中也可以组合使用这些能力。例如客服助手可以使用知识库回答产品问题,再通过工具查询订单;内容审核可以用工作流固定审核路径,同时用知识库维护规则;数据分析场景可以先用 Agent V2 完成探索,再把稳定下来的分析步骤沉淀成工作流。
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment