How to Build an AI Customer Service Bot Using FastGPT Knowledge Base (Part 1)

This article walks through the entire process of setting up an AI-powered customer service chatbot with FastGPT, covering the installation of Docker containers, configuring model keys, creating a knowledge base from Q&A pairs, indexing with RAG, building a simple application, testing queries, and publishing the bot for use.

Ubiquitous Tech
Ubiquitous Tech
Ubiquitous Tech
How to Build an AI Customer Service Bot Using FastGPT Knowledge Base (Part 1)

The rise of large language models is transforming the customer service industry by enabling AI chatbots that understand dialogue and answer complex queries, reducing costs and improving efficiency.

FastGPT is an open‑source AI knowledge‑base platform built on LLMs, offering out‑of‑the‑box data processing, model invocation, RAG retrieval, and visual workflow orchestration. The article uses FastGPT version 4.8.17 (later updated to 4.8.20) as the core component.

Before installing, prepare a Docker and Docker‑Compose environment and obtain API keys for a text‑generation model and a vector model (e.g., Zhipu or DeepSeek). The official FastGPT documentation provides the required config.json and docker-compose.yml files.

# Example docker‑compose.yml (excerpt)
version: '3.3'
services:
  pg:
    image: pgvector/pgvector:0.7.0-pg15
    container_name: pg
    ports:
      - 25432:5432
    environment:
      - POSTGRES_USER=username
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=postgres
  mongo:
    image: mongo:5.0.18
    container_name: mongo
    ports:
      - 37017:27017
    command: mongod --keyFile /data/mongodb.key --replSet rs0
  sandbox:
    image: ghcr.io/labring/fastgpt-sandbox:v4.8.17
    container_name: sandbox
  fastgpt:
    image: ghcr.io/labring/fastgpt:v4.8.17
    container_name: fastgpt
    ports:
      - 3000:3000
    environment:
      - OPENAI_BASE_URL=http://oneapi:3000/v1
      - CHAT_API_KEY=sk-fastgpt
      - DEFAULT_ROOT_PSW=1234
      - MONGODB_URI=mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
      - PG_URL=postgresql://username:password@pg:5432/postgres

Start the containers with docker-compose up -d, wait for services to initialize, then restart the OneAPI container to ensure proper connection.

Access FastGPT at http://localhost:3000. The first run creates a root user with password 1234. Log in to reach the main dashboard.

To build the knowledge base, select the "General Knowledge Base" option, create a new dataset, and upload Q&A pairs formatted as:

Q: Question description
A: Answer
======
Q: Another question
A: Another answer

Choose "Custom Segmentation" and set the delimiter to six equal signs ("======"). After uploading, FastGPT shows the vector model and text model used for indexing. Once indexing finishes, the knowledge is split into two fragments based on the delimiter.

Next, create a simple application: give it a name, select the knowledge base, choose a "Conversation Guidance" template, and configure prompts. The UI then allows you to ask a question, retrieving answers directly from the indexed knowledge base.

To publish the bot, click the "Publish" button, choose a public link or API access, and optionally enable a no‑login window. The published URL can be opened in a browser, where the bot responds to queries such as "How to evaluate work hours in a company?" using the stored knowledge.

In summary, this guide covers the first step of building an AI customer service system: installing FastGPT, configuring Docker, creating a knowledge base with RAG, building a basic chatbot application, testing it, and publishing it for external use.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerLLMRAGKnowledge baseAI chatbotOneAPIFastGPT
Ubiquitous Tech
Written by

Ubiquitous Tech

A ubiquitous public account for pirate enthusiasts, regularly sharing curated experiences, tech learning, and growth insights. Currently publishing articles on AI RAG customer service, AI MCP technology, and open-source design. Personal free Knowledge Planet: Awakening New World Programmer.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.