# Knowledge Base Mount

> Cube Agent 2.4.1 Release (Build 2004105) User Guide.
> Category: Models & AI. Content baseline: 2026-12-05.
> Web page: https://cubeagent.app/en/docs/knowledge_base/

## What a Knowledge Base is

A Knowledge Base is a multi-file container that can be mounted to assistants. It is ideal for project docs, product manuals, glossaries, and fixed reference material so you do not have to paste them into every conversation. A single knowledge base can hold multiple files in different formats, all managed in one place.

## Storage and backup

Knowledge bases are stored locally on your device—connecting to Cube Agent online services does not back them up automatically. Open **Backup & Restore** from the Knowledge Base home page to go to Data Backup and back up to Huawei Cloud Drive, WebDAV, or SMB (SMB requires configuring an accessible shared folder first). Confirm that your backup succeeds before uninstalling or switching devices; after reinstalling, verify existing backups before restoring.

## Nested folders and search

Inside any knowledge base, you can create folders, drill down through nested levels, and use the path breadcrumbs to jump back to parent or ancestor folders. The folder menu supports renaming, moving, and deleting empty folders; non-empty folders must have their contents handled first, and a folder cannot be moved into itself or its own subfolder.

Use a document's menu to move it, or enter multi-select mode to move files in bulk to a target folder. New text notes and imported files go into the current folder by default. When not searching, Select All applies to the current folder; searching by filename or source filename in the title bar searches across all folders, Select All applies only to the search results, and changing folders or keywords clears the current selection.

Importing system folders or standard document ZIPs preserves the relative folder structure of valid files; exporting multiple documents produces a ZIP with folders preserved. Merging knowledge bases creates subfolders named after each source base while preserving hierarchy. Exporting documents alone is not a full knowledge base backup—empty folders containing no selected documents are not included in a document package.

## Moving files across knowledge bases

When moving selected files (or a single file via its menu), the destination picker displays the current knowledge base. Tap **Change knowledge base** to select another document knowledge base, then choose a folder inside it; the base root is the top level of that knowledge base, not a system folder. Worldbooks cannot be selected as destinations, and folders themselves can only be moved within the same knowledge base.

- The file's body text, original attachment, drafts, and version history move together; if a file with the same name exists in the target base, a numeric suffix is added automatically instead of overwriting.
- Keyword search works immediately after moving across bases, while vector indexes must be rebuilt in the target knowledge base.
- Files currently being indexed, OCR'd, optimized, or exported cannot be moved—wait until those tasks finish and try again.
- During a batch move, tap **Stop remaining moves**: already-moved files stay in the target base while the rest remain in the source base.

Moving folders or documents does not rewrite body text, document IDs, or existing indexes. Search results include folder paths to distinguish same-named files; assistants still mount whole knowledge bases, and indexing and coverage are calculated per knowledge base. Up to 16 folder levels and 2,000 folders per base are supported; older versions may discard folder fields, so use a version with folder support to restore and maintain nested folders.

## Copying knowledge base files to the workspace

In a regular conversation, ask the assistant to "copy this file from the knowledge base to the workspace" to copy it locally into the current session's `outputs` folder and show a file card. This requires the current assistant to have **Manage Knowledge Bases** and the source knowledge base enabled. By default, preserved PDF or image originals are copied as-is, while other documents are copied as Markdown; you can also explicitly request the current Markdown text. Duplicate names automatically receive a numeric suffix, originals and indexes remain untouched, and the AI does not need to read or rewrite the full file.

Office or EPUB originals that were not retained cannot be reconstructed on export; incognito conversations do not keep workspace files. Copying between knowledge bases and copying to the workspace are two separate actions, each governed by its own confirmation policy in Settings.

## How to import

Open **Settings → Knowledge Base** and tap **Import**, or open a knowledge base's details and tap **Import Files**. Supports text (`.md`/`.txt`) and documents (`.pdf`/`.docx`/`.xlsx`/`.ofd`/`.ppt`/`.pptx`/`.epub`—text is extracted automatically, and EPUB books are converted in full to Markdown); the file picker shows only supported formats. Text imports automatically detect encoding (UTF-8 / UTF-16 / GB18030, covering legacy GBK files) with no manual conversion required. If you already have knowledge bases, the app asks **which base to import into** (create new or append to an existing one); you can also tap **New** in the title bar to create an empty base first and add content later.

## Batch import

The file picker lets you select multiple files at once (up to 100). Choosing multiple files opens the Batch Import page: files parse one by one with live status and character count, failed files can be removed so you can proceed, and one confirmation at the bottom saves everything and opens the knowledge base details page. Text-based PDFs extract text automatically; scanned PDFs can keep the original PDF marked "Pending OCR" so you can import them into the knowledge base first and run OCR from the document later.

Single-file import previews the parsed result first, giving you two choices:

- **Import directly**: Saves the text as-is (labeled "Original").
- **Optimize to Markdown in background (optional)**: Pick a configured chat model; once confirmed, the original text saves first and the app cleans up paragraphs, headings, lists, and tables in the background. You can leave the page and track progress under document tasks; once finished, review the draft and accept it to replace the body text. If the task fails, the original text stays intact and can be retried.

If you skip optimization during import, you can run it anytime later: optimize a single file from its menu, or enter multi-select, choose files, and tap **LLM optimize**. Each batch supports up to 100 documents—choose one model to queue them all, with up to 2 processed concurrently globally. You can leave the page and check per-document progress, cancel, or retry only unfinished items in task history. Background execution remains subject to OS limits; if the process terminates, interrupted records are kept without automatically re-running billed requests.

Optimization has no character limit. Very long documents may take longer or exceed the chosen model's context or maximum output length, causing failures or incomplete output—always verify completeness before accepting.

Optimization produces a review draft first rather than overwriting immediately. Confirming replaces the active content while preserving a restore option for the original text; accepting invalidates the old semantic index so you will need to rebuild it. Unselected files are unaffected.

## Import ZIP directly

On the Knowledge Base page, choose **Import Knowledge Base (ZIP)**, select an app-exported document ZIP, and pick either a new base or an existing one to append to (also available inside any knowledge base's details). Preview the file list and confirm—no manual unzipping needed.

Supports app-exported document ZIPs and recognized plain document archives; app-exported manifests verify body text and integrity metadata. Limits: up to 256 MiB compressed, up to 256 MiB unpacked, and up to 100 documents per import. For full app backup packages, use **Settings → Data & sync → Import Data** instead of the knowledge base document importer.

## Multi-select delete

Enter multi-select mode in knowledge base details, select documents, tap **Delete selected**, and confirm the count. Canceling preserves your selection; deletion removes only the selected documents and their indexes while keeping the knowledge base and unselected documents. Deletion cannot be undone directly from the knowledge base—export any text you need to keep beforehand.

## Renaming, privacy lock, and export

Both knowledge bases and files inside them can be renamed; renaming changes only the display name and does not alter text, indexes, or mount relationships. Authorized assistants can also submit renames via **Manage Knowledge Bases**, displaying old and new names on the confirmation panel by default (or following that assistant's rename policy while still verifying the original name).

Under a knowledge base's **Settings** or a worldbook's **Settings**, you can turn on **Require authentication** (lock screen password / fingerprint / face): once enabled, a lock badge appears in the list, and viewing details, appending imports, merging, or exporting requires passing system authentication (unlock state lasts only for the current app process and re-prompts after full exit). This switch provides entry-point protection only—it **does not affect** normal injection or retrieval by mounted assistants during chat; knowledge base text is not additionally encrypted.

Export from a file's menu or the multi-select bar. Multi-select exports all selected files in the current folder or search results, up to 256 MiB per batch. Text exports as Markdown, images keep their originals, and multiple files are packaged into a ZIP with a source and integrity manifest. Once prepared, pick a save location in document tasks (canceling save lets you resume later). Exports exclude original attachments of text files, unaccepted optimization drafts, semantic indexes, and locally parsed images.

## Create text manually

Tap **New text** in knowledge base details to enter a filename and body directly—great for notes, lore, or rules that do not need to be imported from external files. Existing text files can also be opened and edited.

## Save directly from chat

After working out a conclusion with an assistant, you do not have to export a Markdown file and re-import it manually. Turn on **Assistants → Edit assistant → Tools → Manage Knowledge Bases** and enable target bases under **Assistants → Edit assistant → KB**, then simply say "Save that to the XX knowledge base" or just "Save to knowledge base" so the assistant can list enabled bases for you to pick. Disabled or unmounted bases cannot be listed, read, or written—enabling the management tool never expands scope. Supported actions include:

- **New note**: Organizes discussion takeaways into a new note inside a base (and can create the target base if it does not exist yet).
- **Append**: Adds follow-up content to the end of an existing note so one topic does not scatter across many files.
- **Targeted edit & mid-document insert**: Replaces only a specific sentence or paragraph, removes a snippet, or inserts new text before or after a specific heading or paragraph. The assistant locates the source text and submits only the relevant snippet and new content, saving tokens compared to reading and rewriting the whole note.
- **Copy file**: Copies a file within the same knowledge base or between two enabled knowledge bases, with optional target folder and copy name. Body text, original attachment, and revisions are copied locally while preserving the source file, with an automatic numeric suffix on name conflicts—no manual copying by the AI. Semantic indexing is off by default for copies and can be toggled on the confirmation card using the target base's embedding model.
- **Overwrite**: Rewrites an entire existing note.
- **Delete**: Deletes a single note (deleting an entire knowledge base is not supported here and must be done in Knowledge Base center).
- **Inspect / read**: Lists knowledge bases and files, locates text by keyword, or reads notes in sections. Inspecting is read-only and does not interrupt you.

For example, you can say: "Change the service period in 'Service Policy' in the Support KB from 7 days to 15 days and keep everything else unchanged," or "Insert the following note before the 'Refund Process' heading in this note..." When copying, say: "Copy 'Service Policy' from the Support KB into the Onboarding folder of the Training KB as 'Service Policy Copy'." Just describe the source and destination clearly without pasting the entire document yourself. For end-of-note additions, simply say: "Append the following to the end of this note..."

By default, every write shows a **knowledge draft card** in chat and saves only after you confirm; tapping Cancel discards it. You can configure granular confirmation rules in **Tool Services → Permissions → Knowledge base** for: new note, import file, copy file, import & append, append content, edit text, rename document/knowledge base, new folder, move document, and delete document. Choose a global default or set per-assistant rules to **Follow / Ask / Allow** (assistant-level settings override global defaults). Tap **Allow multiple** next to **Confirmation** to check multiple actions and approve them in one step (Delete is unchecked by default; unchecked actions keep their current setting, and an assistant's batch grant affects only that assistant). **Reset** on the same row switches all actions for that target back to Ask; assistants can also reset everything to Follow global (actions already set to Allow globally will still execute directly). Tapping **Always allow for this assistant** on a draft card saves approval only for that assistant and that specific operation. Permissions stay on this device, do not migrate via backup or sharing, and can be revoked anytime on the Permissions page; creating and mounting a new knowledge base always asks for confirmation. Always Allow never enables the management tool or widens which bases an assistant can access, and overwrite/delete still verify content versions. New notes and full overwrites let you inspect the full body; targeted edits show a **diff preview** comparing original and replacement text. You can edit the replacement text directly—leaving it empty deletes the snippet. By default, only a unique match is replaced; if you want to change every occurrence, explicitly say "replace all" and check the card prompt. If the original text is not found, matches multiple places, or changed while editing, the assistant must re-locate or re-read before resubmitting.

After adding, importing, or editing succeeds, only that updated item is semantically indexed by default (if a knowledge embedding model is configured; otherwise it skips with a notice). Copying a file skips automatic indexing by default to save embedding usage. You can adjust the index toggle on the confirmation card or organize indexes later in details. Copies do not inherit the original file's vector index; keyword search and full injection continue working regardless.

Skill Center includes a built-in **Knowledge Capture** skill: mounting it on an assistant guides structured formatting (title, conclusion, key points, source, and date) before saving so raw chat blocks are not dumped straight into your knowledge base.

## Organizing with tags

Add multiple tags in a knowledge base's details—such as "Project A", "Product Docs", or "To Organize." Tags appear in the knowledge base list for quick filtering and grouping.

## Semantic indexing and background keep-alive

To enable semantic retrieval, tap **Build index for all documents** on the details summary card, or trigger indexing on a single file card. If no embedding model is configured yet, a model picker pops up and indexing continues automatically once you choose one. Indexing can keep running in the background (via continuous task keep-alive) so you do not have to stay on the page; any failures show the exact count with a Retry button. Import-time text optimization also supports continuing in the background.

## How to mount to assistants

Choose either of two entry points depending on your workflow:

- **Batch mount from a knowledge base**: Open knowledge base details and tap **Mount to assistants** on the summary card, or open **Enabled for** in knowledge base settings to open the assistant picker, check multiple assistants at once (supports Select All and Invert), and close to save differences automatically. Assistants already mounted with this base keep their existing load mode, injection position, and depth settings; newly mounted assistants use defaults (**On-demand** if a semantic index exists, otherwise **Full inject**).
- **Configure per assistant**: Go to **Assistants → Edit assistant → KB**, turn on the knowledge bases you want, or mount/unmount a group by tag, and fine-tune load mode and injection position for that assistant.

Mounting works at the whole knowledge base level (all files inside take effect together), with two load modes:

- **Full inject**: Aggregates all file text in the knowledge base and injects it into the request context. Best for short docs and rulebooks.
- **On-demand**: Does not pre-fill the context; when needed, the model calls `search_knowledge_base` to fetch relevant excerpts. Best for long documents and multi-document collections.

## Hybrid search (keyword + semantic)

In On-demand mode, the system runs both keyword search and semantic vector search and fuses the top excerpts (the semantic channel activates only when an Embedding model is configured). Without an Embedding model, it falls back automatically to pure keyword search without interrupting chat.

Configure the global Embedding model in **Settings → Models & usage → Default Models → Knowledge embedding**, or override it with a different Embedding model inside a specific knowledge base's details. After switching a knowledge base's embedding model, old indexes become invalid—tap **Build index for all documents** manually to rebuild (it does not auto-rerun everything).

## System vs. @Depth

When using Full inject, choose the injection position:

- **System**: Merged into the system prompt—more stable and better suited to long-term rules.
- **@Depth**: Inserts material closer to recent messages. Depths closer to the end draw stronger attention from the model, ideal for more temporary or focus-critical reference material.

## How it differs from Skills

Skills act like "how-to methods + multi-file reference guides loaded on demand," ideal for workflows, standards, and tool instructions. Knowledge Bases act like "searchable or injectable reference text," ideal for attaching documentation for long-term assistant reference.

## Notes and limits

Full injection increases context length and token consumption. All full-injected knowledge bases combined in a single chat are capped at 1,000,000 characters and no more than half of the active model's context window (by estimated tokens; character cap only if the model's context window is unset). Any overflow is truncated in mount order and file order, and the model receives a truncation notice along with the skipped file count. Documents over 200,000 characters can still be imported—use On-demand search with a vector index to save context space. Knowledge base text and vector indexes are stored in local app directories; deleting a knowledge base automatically unmounts it from all assistants. Backup and restore preserve both multi-file contents and vector indexes so restored vectors work right away without recomputing. Legacy single-file knowledge bases auto-migrate on upgrade with all mount relationships intact.

## List sorting, original PDF page jump, and Markdown edge scrollbar

- **List sorting**: The top of both Knowledge Base and World Books lists lets you sort by newest created, oldest created, recently updated, name ascending/descending, and file count (entry count for World Books), remembering your chosen preference.
- **Original PDF quick page jump**: When viewing a preserved original PDF inside a knowledge base, the bottom toolbar includes **First / Last page** shortcuts; tap the page counter (such as `3 / 506`) to enter a target page number directly without scrolling page by page.
- **Markdown right-edge scrollbar**: When viewing a knowledge base Markdown document, a theme-adaptive edge scrollbar on the right lets you drag the thumb to jump quickly through long documents while automatically avoiding the bottom gesture bar and edit button.

## Merging knowledge bases

From the Knowledge Base list, you can merge multiple knowledge bases into one—handy for consolidating duplicate or related collections. Merging gathers files from selected bases into the target base and transfers all existing assistant mounts over. If any individual file fails to migrate, its source base is kept intact to prevent data loss, and a summary displays exact migrated, failed, and kept counts.

## Best practices

- Make sure the target knowledge base has a clear name before merging so sources stay easy to distinguish afterward.
- Merging does not build indexes automatically; tap **Build index** afterward to jump straight to the target base and tap **Build index for all documents** on the summary card.
- Merging consolidates source bases into the target—back up important material before starting.
