Docs contents

Knowledge base

Give ShiritaiBot your manuals, rules, spreadsheets and lecture notes, and let it quote them when needed.

The knowledge base holds documents that don't change: product manuals, company rules, lecture notes, data tables. ShiritaiBot searches them when needed and answers by quoting the original text.

How it differs from memory

Long-term memoryKnowledge base
ContentPeople, things and events that change over timeFixed documents
Written byOrganized automatically from conversationsYou, by importing files
ChangesNew facts replace old ones; conflicts are checked with youDelete the whole document and import it again
UseAdded to the conversation each turn as neededSearched when the model decides to, never added automatically

Import documents

There are two ways:

  • Upload in the WebUI: open Library → Knowledge Base in the sidebar, pick the library to manage and upload files.
  • Send it in a private chat: as the owner, send the file in your QQ private chat and say "save this to the knowledge base". If you only send a file without saying what it's for, ShiritaiBot asks first.

Supported formats:

TypeFormats
Texttxt, md, rst, log, json, yaml, xml
Tablescsv, tsv, xlsx, xls
Documentspdf, docx, doc
Slidespptx, ppt (including notes)

Each file can be up to 50 MB. Scanned PDFs have no text layer and need OCR first. Encrypted files and RTF aren't supported yet.

Importing only parses and splits documents; it doesn't call a text model. Markdown and Word files are split by heading, PDFs and slides by page, and every table chunk repeats the header row so it still makes sense on its own.

ShiritaiBot runs a keyword search and a meaning-based search and merges the results. The keyword search handles Chinese word splitting and English word forms, so it finds a passage even when your question words it differently. Meaning-based search needs an embedding model in Models and routing; without one, only keywords are used, and imports still work.

Once it finds a relevant passage, the model can page backward and forward through the surrounding text before answering.

Several knowledge libraries

You can create libraries for different purposes, such as "Project files" and "Course notes", and bind them to WebUI chats, private chats or group chats:

  1. Open Settings → Knowledge base and add a library.
  2. Choose a library for each chat, or turn the knowledge base off for it. One library can be bound to many chats.
  3. Save.

Each chat can only search and import into its own library. Removing a library from settings doesn't delete its data; add it again with the same ID to restore it.

Group chats and permissions

ToolDoesWho can use it
kb_searchSearchPer chat permissions; also in Chat mode
kb_readRead the text around a matchSame as above
kb_listList documentsSame as above
kb_importImport a fileOwner's private chat only
kb_deleteDelete a documentOwner's private chat only

A group chat bound to a library can search the whole library, which makes it a handy Q&A helper for the group.