FastGPTFastGPT
Core Concepts & Principles

Knowledge Base Full Lifecycle

Understand the three-tier asset topology, asynchronous training pipeline, status transitions, and end-to-end lifecycle maintenance.

The knowledge base is FastGPT's core repository for structured and unstructured business information. Mastering its three-tier topology, background processing workflows, and status machines enables clean data organization and reliable question-answering quality.

Three-Tier Asset Topology

The platform manages knowledge assets across three distinct layers:

Knowledge asset hierarchyKnowledge asset hierarchy

  1. Knowledge Base: The top-level root configuring the embedding model, BM25 tokenizer settings, database persistence, and team-level collaborator permissions.
  2. Collection: The organizational container for assets. Content Collections store ingested files, scraped web pages, or synchronized platform records; Folder Collections establish nested hierarchical trees for batch authorization and tag categorization.
  3. Data Chunk: The granular unit produced by chunking algorithms. Each chunk preserves source text and index references such as index IDs and text. The vector backend stores embeddings, supporting standalone edits and index rebuilding.

Five Lifecycle Stages

Knowledge assets advance through five sequential lifecycle stages:

StageCore ResponsibilitySystem Actions and Deliverables
1. IngestionUpload files, import spreadsheets, crawl URLs, or connect external sourcesSecurity checks, upload to S3 storage, create collection records
2. Text ParsingExtract unstructured text and segment content by semantic boundariesGenerate pending data chunk records for worker queue consumption
3. IndexingInvoke models to generate embeddings and build inverted full-text indexesPersist to vector database and Mongo index store; mark status Ready
4. RetrievalRespond to user queries with multi-route recall and rerankingRetrieve top candidate chunks; deliver grounded context with citations
5. MaintenanceFine-tune chunks, overwrite updated files, filter by tags, and clean up obsolete dataTrigger localized vector rebuilding or cascade deletion to keep data fresh

Background Processing Pipeline and State Machine

Once file upload succeeds, the system processes assets asynchronously using a distributed queue (BullMQ and Mongo task records):

File processing and retriesFile processing and retries

Processing Stages and Collection Status

Waiting, parsing and chunking, optional enhancement, and indexing describe processing stages in the diagram. Queued tasks wait for consumption; processing failures enter retry or troubleshooting paths.

The collection status uses three enum values and displays stage-specific badges in the UI:

  • In progress (running): Tasks remain in progress, displaying stage badges such as Queue, Parsing, Image analysis, Index vectorization, Q&A extraction, Automatic index generation, Image index generation, Index rebuilding, or synonym rebuilding.
  • Ready (ready): Displays Ready; processing is complete and chunks are available for retrieval.
  • Indexing error (error): Displays Indexing error; inspect diagnostics in the Error list modal, fix file, model balance, or network prerequisites, and retry.

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.