{
"tools": {
"create_knowledge_base": {
"zh": "创建一个新的知识库。知识库是文档的容器,每个知识库可以有自己的chunk_size和embedding配置。创建后需要调用select_knowledge_base来选择该知识库才能使用。\n\n参数说明:\n- kb_name:知识库名称(必填,必须唯一)\n- chunk_size:chunk大小,单位token(必填,例如512、1024)\n- embedding_model:向量化模型名称(可选,例如text-embedding-ada-002)\n- embedding_endpoint:向量化服务端点URL(可选)\n- embedding_api_key:向量化服务API Key(可选)\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含创建结果\n - kb_id:知识库ID\n - kb_name:知识库名称\n - chunk_size:chunk大小",
"en": "Create a new knowledge base. A knowledge base is a container for documents, and each knowledge base can have its own chunk_size and embedding configuration. After creation, you need to call select_knowledge_base to select this knowledge base before using it.\n\nParameters:\n- kb_name: Knowledge base name (required, must be unique)\n- chunk_size: Chunk size in tokens (required, e.g., 512, 1024)\n- embedding_model: Embedding model name (optional, e.g., text-embedding-ada-002)\n- embedding_endpoint: Embedding service endpoint URL (optional)\n- embedding_api_key: Embedding service API Key (optional)\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing creation results\n - kb_id: Knowledge base ID\n - kb_name: Knowledge base name\n - chunk_size: Chunk size"
},
"delete_knowledge_base": {
"zh": "删除指定的知识库。不能删除当前正在使用的知识库。删除知识库会级联删除该知识库下的所有文档和chunks。\n\n参数说明:\n- kb_name:知识库名称(必填)\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含删除结果\n - kb_name:已删除的知识库名称",
"en": "Delete the specified knowledge base. Cannot delete the currently active knowledge base. Deleting a knowledge base will cascade delete all documents and chunks under it.\n\nParameters:\n- kb_name: Knowledge base name (required)\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing deletion results\n - kb_name: Deleted knowledge base name"
},
"list_knowledge_bases": {
"zh": "列出所有可用的知识库。返回所有知识库的详细信息,包括当前选中的知识库。\n\n参数说明:\n无参数\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含知识库列表\n - knowledge_bases:知识库列表,每个知识库包含:\n - id:知识库ID\n - name:知识库名称\n - chunk_size:chunk大小\n - embedding_model:向量化模型\n - created_at:创建时间\n - is_current:是否为当前选中的知识库\n - count:知识库数量\n - current_kb_id:当前选中的知识库ID",
"en": "List all available knowledge bases. Returns detailed information about all knowledge bases, including the currently selected one.\n\nParameters:\nNo parameters\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing knowledge base list\n - knowledge_bases: List of knowledge bases, each containing:\n - id: Knowledge base ID\n - name: Knowledge base name\n - chunk_size: Chunk size\n - embedding_model: Embedding model\n - created_at: Creation time\n - is_current: Whether this is the currently selected knowledge base\n - count: Number of knowledge bases\n - current_kb_id: Currently selected knowledge base ID"
},
"select_knowledge_base": {
"zh": "选择一个知识库作为当前使用的知识库。选择后,后续的文档导入、查询等操作都会在该知识库中进行。\n\n参数说明:\n- kb_name:知识库名称(必填)\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含选择结果\n - kb_id:知识库ID\n - kb_name:知识库名称\n - document_count:该知识库下的文档数量",
"en": "Select a knowledge base as the currently active one. After selection, subsequent operations such as document import and search will be performed in this knowledge base.\n\nParameters:\n- kb_name: Knowledge base name (required)\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing selection results\n - kb_id: Knowledge base ID\n - kb_name: Knowledge base name\n - document_count: Number of documents in this knowledge base"
},
"import_document": {
"zh": "导入文档到当前选中的知识库(支持多文件并发导入)。支持TXT、DOCX、DOC格式。文档会被解析、切分为chunks,并异步批量生成向量存储到数据库中。多个文档会并发处理,提高导入效率。如果文档名称已存在,会自动添加时间戳避免冲突。\n\n参数说明:\n- file_paths:文件路径列表(绝对路径),支持1~n个文件(必填)\n- chunk_size:chunk大小,单位token(可选,默认使用知识库的chunk_size)\n\n返回值:\n- success:布尔值,表示是否成功(只要有文件成功导入即为true)\n- message:字符串,描述操作结果(包含成功和失败的数量)\n- data:字典,包含导入结果\n - total:总文件数\n - success_count:成功导入的文件数\n - failed_count:失败的文件数\n - success_files:成功导入的文件列表,每个包含:\n - file_path:文件路径\n - doc_name:文档名称\n - chunk_count:chunk数量\n - failed_files:失败的文件列表,每个包含:\n - file_path:文件路径\n - error:错误信息",
"en": "Import documents into the currently selected knowledge base (supports concurrent import of multiple files). Supports TXT, DOCX, and DOC formats. Documents will be parsed, split into chunks, and vectors will be generated asynchronously in batch and stored in the database. Multiple documents are processed concurrently to improve import efficiency. If the document name already exists, a timestamp will be automatically added to avoid conflicts.\n\nParameters:\n- file_paths: List of file paths (absolute paths), supports 1~n files (required)\n- chunk_size: Chunk size in tokens (optional, defaults to knowledge base's chunk_size)\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful (true if any file was successfully imported)\n- message: String, describing the operation result (includes counts of successful and failed imports)\n- data: Dictionary containing import results\n - total: Total number of files\n - success_count: Number of successfully imported files\n - failed_count: Number of failed files\n - success_files: List of successfully imported files, each containing:\n - file_path: File path\n - doc_name: Document name\n - chunk_count: Number of chunks\n - failed_files: List of failed files, each containing:\n - file_path: File path\n - error: Error message"
},
"search": {
"zh": "在当前选中的知识库中进行混合检索。结合关键词检索(FTS5)和向量检索(sqlite-vec),使用加权方式合并结果(关键词权重0.3,向量权重0.7),去重后使用Jaccard相似度重排序,返回最相关的top-k个结果。\n\n参数说明:\n- query:查询文本(必填)\n- top_k:返回数量(可选,默认从配置读取,通常为5)\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述检索结果\n- data:字典,包含检索结果\n - chunks:chunk列表,每个chunk包含:\n - id:chunk ID\n - doc_id:文档ID\n - content:chunk内容\n - tokens:token数量\n - chunk_index:chunk索引\n - doc_name:文档名称\n - score:综合检索分数\n - count:结果数量",
"en": "Perform hybrid search in the currently selected knowledge base. Combines keyword search (FTS5) and vector search (sqlite-vec), merges results using weighted approach (keyword weight 0.3, vector weight 0.7), deduplicates, reranks using Jaccard similarity, and returns the top-k most relevant results.\n\nParameters:\n- query: Query text (required)\n- top_k: Number of results to return (optional, default from config, usually 5)\n\nReturn value:\n- success: Boolean, indicating whether the search was successful\n- message: String, describing the search result\n- data: Dictionary containing search results\n - chunks: List of chunks, each containing:\n - id: Chunk ID\n - doc_id: Document ID\n - content: Chunk content\n - tokens: Number of tokens\n - chunk_index: Chunk index\n - doc_name: Document name\n - score: Combined search score\n - count: Number of results"
},
"list_documents": {
"zh": "查看当前选中的知识库下的所有文档列表。返回文档的详细信息。\n\n参数说明:\n无参数\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含文档列表\n - documents:文档列表,每个文档包含:\n - id:文档ID\n - name:文档名称\n - file_path:文件路径\n - file_type:文件类型\n - chunk_size:chunk大小\n - created_at:创建时间\n - updated_at:更新时间\n - count:文档数量",
"en": "List all documents in the currently selected knowledge base. Returns detailed information about the documents.\n\nParameters:\nNo parameters\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing document list\n - documents: List of documents, each containing:\n - id: Document ID\n - name: Document name\n - file_path: File path\n - file_type: File type\n - chunk_size: Chunk size\n - created_at: Creation time\n - updated_at: Update time\n - count: Number of documents"
},
"delete_document": {
"zh": "删除当前选中的知识库下的指定文档。删除文档会级联删除该文档的所有chunks。\n\n参数说明:\n- doc_name:文档名称(必填)\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含删除结果\n - doc_name:已删除的文档名称",
"en": "Delete the specified document from the currently selected knowledge base. Deleting a document will cascade delete all chunks of that document.\n\nParameters:\n- doc_name: Document name (required)\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing deletion results\n - doc_name: Deleted document name"
},
"update_document": {
"zh": "修改文档的chunk_size并重新解析文档。会删除原有的chunks,使用新的chunk_size重新切分文档,并异步批量生成新的向量。\n\n参数说明:\n- doc_name:文档名称(必填)\n- chunk_size:新的chunk大小,单位token(必填)\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含修改结果\n - doc_id:文档ID\n - doc_name:文档名称\n - chunk_count:新的chunk数量\n - chunk_size:新的chunk大小",
"en": "Update the document's chunk_size and re-parse the document. Will delete existing chunks, re-split the document using the new chunk_size, and asynchronously generate new vectors in batch.\n\nParameters:\n- doc_name: Document name (required)\n- chunk_size: New chunk size in tokens (required)\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing update results\n - doc_id: Document ID\n - doc_name: Document name\n - chunk_count: New number of chunks\n - chunk_size: New chunk size"
},
"export_database": {
"zh": "导出整个kb.db数据库文件到指定路径。\n\n参数说明:\n- export_path:导出路径(绝对路径,必填)\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含导出结果\n - source_path:源数据库路径\n - export_path:导出路径",
"en": "Export the entire kb.db database file to the specified path.\n\nParameters:\n- export_path: Export path (absolute path, required)\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing export results\n - source_path: Source database path\n - export_path: Export path"
},
"import_database": {
"zh": "导入一个.db数据库文件,将其中的内容合并到kb.db中。导入时会自动处理重名冲突,为知识库和文档名称添加时间戳。\n\n参数说明:\n- source_db_path:源数据库文件路径(绝对路径,必填)\n\n返回值:\n- success:布尔值,表示是否成功\n- message:字符串,描述操作结果\n- data:字典,包含导入结果\n - source_path:源数据库路径\n - imported_kb_count:导入的知识库数量\n - imported_doc_count:导入的文档数量",
"en": "Import a .db database file and merge its contents into kb.db. Import will automatically handle name conflicts by adding timestamps to knowledge base and document names.\n\nParameters:\n- source_db_path: Source database file path (absolute path, required)\n\nReturn value:\n- success: Boolean, indicating whether the operation was successful\n- message: String, describing the operation result\n- data: Dictionary containing import results\n - source_path: Source database path\n - imported_kb_count: Number of imported knowledge bases\n - imported_doc_count: Number of imported documents"
}
}
}