PandaWiki Setup Guide: Building an AI-Powered Knowledge Base

7月20日 Published inKnowledge Management

PandaWiki is an open-source knowledge base system built on large language models (LLMs). It is designed to help users quickly construct intelligent product documentation, technical manuals, FAQs, and blogs. By leveraging LLM capabilities, the platform provides AI-assisted writing, automated Q&A, and semantic search.

  • AI-driven: Speeds up knowledge processing through AI-assisted content creation, Q&A, and search.
  • Rich text editing: Supports Markdown and HTML, with export options for Word, PDF, Markdown, and other formats.
  • Third-party integration: Embed the system as a widget on any website or transform it into a chatbot for DingTalk, Feishu, or WeChat Work.
  • Flexible content import: Effortlessly pull content from URLs, sitemaps, RSS feeds, or local files.

Installing PandaWiki

System Requirements

Before beginning the installation, ensure your environment meets the following specifications:

  • OS: Linux
  • CPU Architecture: x86_64
  • Software: Docker 20.10.14+ and Docker Compose 2.0.0+
  • Resources:
    • Recommended: 1 CPU core, 4GB RAM, 20GB disk space.
    • Minimum: 1 CPU core, 2GB RAM, 5GB disk space.

Installation Process

PandaWiki can be deployed using a one-click installation script:

  1. Log into your server as the root user.
  2. Execute the following command: bash -c "$(curl -fsSLk https://release.baizhi.cloud/panda-wiki/manager.sh)"
  3. Follow the on-screen prompts to select an installation directory. The default location is /data/pandawiki. The setup process typically completes within a few minutes.

Accessing the Dashboard

Once the installation script finishes, the terminal will display the internal and external access URLs, the default username (admin), and a generated password. Open your browser, navigate to the provided URL, and enter your credentials to log in.

Connecting AI Models

To enable AI writing, Q&A, and search functions, you must first connect PandaWiki to your preferred AI models.

Required Model Types

  • Chat Model: Handles conversational tasks (e.g., GPT-4, DeepSeek-V3, or DeepSeek-R1).
  • Embedding Model: Converts documents into vector representations to enable intelligent search and content linking.
  • Reranker Model: Refines search results by re-ranking initial hits, ensuring high precision and better overall response quality.

Recommended Setup for Beginners

The Baizhi Cloud Model Plaza is a convenient starting point, offering new users a 5 RMB credit.

  1. Register and log in at Baizhi Cloud.
  2. Navigate to "Online Apps" in the top right, then select "Model Plaza – Use Now."
  3. Create an API Token: Locate "API Token" in the left-hand navigation menu, generate a token, and copy it.
  4. Configure PandaWiki: In the PandaWiki settings, select "Baizhi Cloud" as the provider, paste your token, and select your models.
    • Recommended configuration: Chat: DeepSeek-V3; Embedding: bge-m3; Rerank: bge-reranker-v3-m3.

Compatible Providers

PandaWiki is compatible with various providers, including DeepSeek, OpenAI, Ollama, SiliconFlow, and YueZhiMian (Kimi). It also supports any API that adheres to the OpenAI interface standard.

Cost Breakdown

Costs for embedding and reranker models are generally negligible. The primary expense is determined by the input tokens used by the chat model. A typical interaction uses between 1,000 and 10,000 input tokens. At a rate of 1 RMB per million tokens, each conversation costs significantly less than 0.01 RMB.

Managing Documents and Imports

Creating Documents

You can create a new, blank document directly within the interface by clicking the "Create" button.

Import Methods

PandaWiki offers several versatile methods for importing existing data:

  1. URL Import: Provide one URL per line. The system will crawl the web content and convert it into editable rich text.
  2. RSS Import: Enter an RSS or Atom feed URL to pull a list of articles. You can then select specific items to convert and save.
  3. Sitemap Import: Input a sitemap URL to retrieve a list of pages. This method supports nested sitemaps.
  4. Offline Files: Upload local files in bulk. Supported formats include .txt, .md, .xls, .xlsx, .docx, and .pdf (max 20MB per file).
  5. Notion Integration: Create an Integration Secret in Notion, paste it into PandaWiki, and select the documents you wish to pull.
  6. Wiki.js Migration: Export a page.json.gz file from your Wiki.js administration panel and upload it to PandaWiki.
  7. Feishu Docs: Configure your App ID, Client Secret, and User Access Token to import your Feishu knowledge base.
  8. Confluence Migration: Export a Confluence space as a ZIP file (up to 100MB) and upload it for import.

Document Status and Publishing

All newly created or imported documents are saved as Drafts by default. To make them visible on the public wiki site and accessible for AI processing, you must Publish them. If you edit a document that is already live, its status will change to "Update Not Published"; you must publish it again to apply the changes.

Web Widget Chatbot

Functional Overview

By integrating the PandaWiki Q&A widget into an external website, a floating icon will appear on the screen. When clicked, it opens a chat window where visitors can ask questions based on your knowledge base.

Configuration Steps

  1. Navigate to the Widget Settings page in PandaWiki.
  2. Enable the widget and customize the appearance, including color schemes and button text.
  3. Save your settings. The system will generate an embed code consisting of a <link> component and a <script> component.

Integration

To add the widget to another website, edit the target site's HTML:

  • Place the link portion inside the <head> tag.
  • Place the script portion inside the <body> tag.
  • Save the changes and refresh the page to see the widget in action.