# knowledge-base > 连接并操作PITA数据库。当用户需要搜索、导入、更新或删除数据时使用此skill。支持自然语言查询、智能数据导入、实体管理、文件上传等操作。用户需在.env文件中配置KB_ACCESS_TOKEN。 - Author: alex90thu - Repository: alex90thu/skills - Version: 20260124100437 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/alex90thu/skills - Web: https://mule.run/skillshub/@@alex90thu/skills~knowledge-base:20260124100437 --- --- name: knowledge-base description: 连接并操作PITA数据库。当用户需要搜索、导入、更新或删除数据时使用此skill。支持自然语言查询、智能数据导入、实体管理、文件上传等操作。用户需在.env文件中配置KB_ACCESS_TOKEN。 --- # PITA 数据库操作 ## 快速使用 ```bash # 搜索 python kb_client.py search "基因编辑" 10 # 查看对象类型 python kb_client.py types # 智能导入 python kb_client.py import data.json "学术文献" # 更新/删除 python kb_client.py update 123 '{"FLD_000064": "新标题"}' python kb_client.py delete 123,456 ``` ## 核心命令 | 命令 | 说明 | |------|------| | `search [limit]` | 自然语言搜索 | | `types` | 获取对象类型列表 | | `type-fields ` | 获取类型的字段详情 | | `import [hint]` | 智能导入(LLM 分析) | | `create [mapping]` | 直接创建(更可靠) | | `update ` | 更新实体属性 | | `delete ` | 批量删除(逗号分隔) | ## 文件上传 ```python from files import upload_file upload_file("document.pdf") upload_file(["file1.pdf", "file2.pdf"]) ``` ## 注意事项 1. **写操作必须确认**: import/update/delete 操作前必须向用户确认 2. **批量限制**: 导入每批不超过 500 条 ## 进阶参考 根据需要阅读以下文档: | 场景 | 参考文档 | |------|----------| | 完整 API 端点参考 | [references/api-reference.md](references/api-reference.md) | | 对象类型和字段管理 | [references/schema-management.md](references/schema-management.md) | | 实体集合与关系管理 | [references/collections.md](references/collections.md) | | 智能导入失败、手动映射 | [references/advanced-import.md](references/advanced-import.md) | | Token 过期、编码问题 | [references/troubleshooting.md](references/troubleshooting.md) |