Skip to main content

Knowledge Base Guide

Knowledge Base enables you to store, organize, and retrieve documents for RAG (Retrieval-Augmented Generation), allowing AI agents to answer questions based on your specific documents.


🎯 Overview​

What is Knowledge Base?​

Knowledge Base is a document storage and retrieval system that enables RAG. It allows AI agents to search through your documents and provide answers grounded in your specific content.

Core Benefits​

BenefitDescription
Grounded ResponsesAI answers based on your documents
Source CitationsEvery answer includes references to source documents
Smart ChunkingAutomatic document splitting optimized for retrieval
Flexible RetrievalVector, keyword, or hybrid search modes

Finding Knowledge Bases​

The knowledge page lists active libraries you can currently access directly.

EntryContents
AllAll accessible libraries returned by the existing list API, including company libraries
Created by mePersonal and team libraries you created, excluding company libraries
Shared with meLibraries created by others and accessible through user, team, or other grants, excluding company-space libraries
Company knowledgeLibraries that belong to company spaces

Filter by the library's actual personal or team space. All also supports company spaces; Company knowledge hides the space filter. Sharing with a team does not change ownership. Multiple access paths produce one row per library. Sidebar counts remain independent of local filters; filter option counts reflect the current entry, search, and type. Leaving a team does not trigger additional discovery beyond the existing list API.

On mobile, expand navigation and use the vertical list to see names, spaces, and actions. Unknown space categories are shown as unknown; unconfirmed effective permissions are hidden in the list. The permissions action confirms effective access and its sources with the server; managers can also manage members and roles. Existing library links, code libraries, and migration actions remain available.


πŸ†• Creating Knowledge Bases​

Step 1: Navigate to Knowledge Base​

  1. Log in to Wegent
  2. Navigate to Knowledge Base section in the sidebar
  3. Click Create Knowledge Base

Step 2: Choose Knowledge Base Type​

TypeDocument LimitChat SupportBest For
Notebook50 documentsβœ… YesInteractive research, Q&A sessions
ClassicUnlimited❌ NoLarge document collections, archives

See Knowledge Base Types for detailed comparison.

Step 3: Configure Basic Settings​

FieldDescriptionExample
NameDisplay name (1-100 chars)"Product Documentation"
DescriptionOptional description (max 500 chars)"Internal product docs and guides"

Step 4: Configure Retrieval Settings​

SettingOptionsDescription
Retrieval ModeVector / Keyword / HybridSearch method
top_k1-10 (default: 5)Number of results
score_threshold0.0-1.0 (default: 0.5)Minimum relevance score

Step 5: Upload Documents​

  1. Click Add Document
  2. Choose source type (File / Text / URL / External Table)
  3. Configure chunking settings (optional)
  4. Click Upload

Space and Authorization After Creation​

New libraries default to personal space. Choose another space where you can create libraries under More settings. If you have filtered by a team where you can create, the dialog selects that team and explains that team permissions are inherited. If creation is unavailable there, explicitly choose personal space or another authorized space.

After creation, Library created confirms that the library is saved. Authorize people, teams, or other supported targets immediately, or finish later; closing authorization does not delete the library. Retry only failed grants. If a result is uncertain, existing grants are verified before another write. A failed list refresh can be retried separately without creating another library. Existing role choices and permission restrictions still apply.


πŸ“„ Document Management​

Supported Sources​

SourceDescription
File UploadUpload from local computer
Text PastePaste text content directly
External TableImport from DingTalk/Feishu
Web ScrapingScrape content from URL

Supported Formats​

  • .txt - Plain text files
  • .md - Markdown files
  • .pdf - PDF documents
  • .doc, .docx - Word documents

See Document Management for detailed guide.


πŸ”ͺ Chunking Strategies​

Available Strategies​

StrategyBest ForDescription
Smart ChunkingGeneral documentsAuto-detect structure
Sentence-basedFAQ, Q&A contentSplit by sentence boundaries
SemanticLong articlesSplit by semantic similarity

Key Parameters​

ParameterRangeDefaultDescription
chunk_size128-8192500Characters per chunk
chunk_overlap0-204850Overlapping characters

See Chunking Strategies for detailed guide.


πŸ” Retrieval Test​

For smaller knowledge bases, the system may also use an all-chunks direct injection path to load the full chunk set into the model. This exists mainly to compensate for cases where vector retrieval recall is not stable enough.

See Retrieval And Direct Injection for the design rationale and permission model.

Before saving retrieval configuration, you can test the retrieval effectiveness.

How to Use​

  1. Go to Knowledge Base Retrieval Settings
  2. Configure retrieval parameters
  3. Enter a test query in the Retrieval Test area
  4. Click Test button
  5. Review returned chunks and relevance scores
  6. Adjust parameters based on results
  7. Click Save when satisfied

πŸ“ Summary Features​

Document Summaries​

When enabled, the system automatically generates summaries for each document:

  1. Document is uploaded and indexed
  2. Summary model processes content
  3. Summary stored with document metadata
  4. Available for quick reference

Knowledge Base Summary​

Generate an aggregate summary of the entire Knowledge Base:

  1. Navigate to Knowledge Base settings
  2. Click Generate Summary
  3. View combined summary of all documents

Manually Editing Knowledge Base Summary​

Knowledge base summaries can be edited manually to correct AI-generated content, add missing context, or rewrite the summary in a form that better fits team usage.

  • Manual summary takes priority in UI display
  • Manual summary takes priority when injected into knowledge-base chat context
  • AI summary generation continues running in the background
  • Use Restore AI Summary to switch back to the latest AI-generated summary

Notes:

  • The current version only supports manual editing of the knowledge base long summary
  • Document summaries are still generated automatically
  • If Auto Generate Summary is disabled, new AI summaries stop updating, but saved manual summary content can still be displayed

Summary Retry​

If summary generation fails:

  1. Find the document with failed summary
  2. Click Retry Summary button
  3. System will attempt to regenerate

πŸ€– Integration with Agents​

Selecting Knowledge Base in Chat​

  1. Click the context selector near the chat input
  2. Select Knowledge Base from options
  3. Choose your desired Knowledge Base
  4. Send your question

Notebook Mode Chat​

In Notebook mode, you can chat directly within the Knowledge Base:

  1. Open a Notebook-type Knowledge Base
  2. Use the chat panel on the right
  3. Select specific documents for context (optional)
  4. Ask questions about your documents

πŸ“‘ Citations and References​

Citation Format​

AI responses include numbered citations linking to source documents:

Based on your product documentation [1], the feature works by...
Additionally, the troubleshooting guide [2] suggests...

Sources:
[1] product-overview.pdf (Section 3)
[2] troubleshooting-guide.md (Chunk 15)

Viewing Source Content​

  1. Click on a citation number in the response
  2. View the original chunk content
  3. See surrounding context
  4. Navigate to full document if needed

πŸ” Permission Management​

Knowledge bases support fine-grained access control through the Share Service architecture. You can manage members, assign roles, and authorize external entities (e.g., groups) to access your knowledge bases.

Member Roles​

RolePermissions
OwnerFull control, can transfer ownership and manage all members
MaintainerCan manage documents, settings, and invite members
DeveloperCan read and contribute documents
ReporterRead-only access

Managing Members​

The library list's Permission Details, document management's Permission Management, and the Library created page share the same member management and add flow. On mobile, open permission details from the list's More menu.

  1. Search existing collaborators to see members and roles. Pending requests remain visible independently of the search.
  2. Click Add collaborator, select people by username or email, or search for groups.
  3. Choose Maintainer, Developer, Reporter, or RestrictedAnalyst for each selected target. Owner cannot be assigned through this flow.
  4. Click Authorize. Partial success leaves only failed targets for retry; uncertain results are checked against existing grants first.

The member list supports role changes, removal, and request review. View-only users see their effective permission and access sources.

After creation, Finish / Configure later keeps the library. A failed list refresh can be retried separately without creating the library again or repeating grants.

Group Authorization​

Select a group and assign its role in Add collaborator. Group members inherit that access; existing group grants appear under the management view's Group tab.

Note: Libraries received through group grants appear under Shared with Me, rather than the receiving group's native library list.

Permission Source Visualization​

When viewing members, the system displays how each member gained access:

  • Direct β€” Added directly as a member
  • Entity β€” Access granted through a group or namespace
  • Link β€” Access obtained via a share link

Role Conflict Resolution​

When a user has multiple access paths to the same knowledge base (e.g., direct membership and group membership), the system automatically resolves conflicts by selecting the highest-privilege role.

Ownership Transfer​

Owners can transfer ownership to another member:

  1. In Permission Management, locate the target member
  2. Click Transfer Ownership next to their name
  3. Confirm the transfer in the dialog

The previous owner is downgraded to Maintainer, and the new owner gains full control.


πŸ”„ Automatic DingTalk document updates​

Enable Automatically update DingTalk documents under Advanced settings when creating or editing a knowledge base (off by default). A daily scan checks the source update time of existing and subsequently imported DingTalk copies. Successful, available copies are skipped when the saved timestamp is unchanged, or when the source reports no update time while a baseline exists; all other copies are reimported, including copies without a baseline, and the refresh establishes that baseline only when DingTalk reports an update time. The scan runs daily at 02:00 Asia/Shanghai (18:00 UTC); when the service is unavailable at that time, the run waits for the next schedule instead of catching up.

  • Each copy uses its original importer's DingTalk authorization. That account must remain active and retain permission to maintain documents in the target knowledge base.
  • Copies remain shared under the target knowledge base's permissions. New documents in source folders are not imported automatically. Source deletion or revoked access does not delete the Wegent document record.
  • Updates use the same processing flow as manual reimport. Content may be unavailable during an update. Failures appear through the existing error and retry controls and are attempted again in a later cycle.
  • Disabling the setting skips automatic jobs that have not started; processing already underway finishes. Manual reimport remains available.
  • A failed timestamp probe preserves the available copy. Failed processing remains retryable even if the source timestamp is unchanged. Manual reimport always updates and invalidates the old automatic comparison baseline.

The document list offers Sync now on DingTalk copies so the latest source body can be fetched without waiting for the daily scan; the entry reads Retry sync when the source is unavailable or indexing failed, and is disabled with Syncing while a refresh is in flight. A source that has been deleted or lost access marks the copy Source unavailable, and a failed latest sync marks it Synchronization failed. A previously imported copy keeps its existing body and index when source probing or body fetching fails. If conversion or indexing fails after a new body is attached, the copy may be temporarily unavailable. The mark clears once the source is reachable again and a sync succeeds.

Fetching a fresh body still requires the node to be present in the original importer's local DingTalk directory. If that directory entry is missing, sync fails; sync the DingTalk directory again before retrying the copy. A missing local entry alone does not establish that the DingTalk source file was deleted.

This first version accepts delayed DingTalk MCP updateTime values: content may change before the timestamp does, causing a scan to skip it; a copy whose source stops reporting a time keeps its saved baseline and stays skipped until a time is reported again. After rollout, observe timestamp delays by format, persistently unchanged nodes, and actual content freshness. This behavior was observed with online documents; recovery on the next cycle is not guaranteed. Use manual reimport when an immediate update is needed; the backend sync trigger still applies timestamp comparison.

Deployment requires SCHEDULED_TASKS_ENABLED plus DINGTALK_SYNC_SCHEDULE_ENABLED (off by default), which is what registers the daily schedule; run Celery Beat and a Worker consuming the default queue. Restart these processes after upgrading to load the new tasks. The manual trigger does not depend on DINGTALK_SYNC_SCHEDULE_ENABLED. No database migration is needed.

For testing, an authenticated knowledge-base manager can call POST /api/knowledge-bases/{knowledge_base_id}/dingtalk-sync with no request body after enabling automatic updates. It queues the same daily scan for that knowledge base only; workers retain each copy's original importer authorization. HTTP 202 with {"task_id":"...","status":"queued"} means queued, not successfully updated. Check document processing results in the document list. A disabled setting returns 400, insufficient management permission returns 403, and enqueue failure returns 503. A Worker is required, but there is no need to wait for the next Beat tick.

❓ Troubleshooting​

Upload Issues​

ProblemSolution
File upload failsCheck file size (max 50MB) and format
Document stuck in "Processing"Wait for large documents or re-upload

Retrieval Issues​

ProblemSolution
No results returnedLower score_threshold or try different query
Irrelevant resultsReduce chunk_size or try hybrid mode

πŸ’‘ Best Practices​

Document Organization​

PracticeDescription
Meaningful namesUse descriptive document names
Consistent formatStandardize document formatting
Regular updatesRe-index when documents change
Clean contentRemove irrelevant headers/footers

Retrieval Tuning​

ScenarioModetop_kthreshold
Precise answersVector3-50.8
Broad searchHybrid8-100.6
Exact matchingKeyword50.7