Alibabacloud Analyticdb Postgresql Knowledgebase Ops
v4ADBPG Knowledge Base Management: 创建 knowledge bases, 上传 documents, 搜索, Q&A. Triggers: "knowledge base", "document 库", "document 上传", "knowledge 搜索", "RAG", "Q&A", "embedding", "ADBPG", "AnalyticDB PostgreSQL"
运行时依赖
安装命令
点击复制技能文档
ADBPG Knowledge Base Management
Build enterprise knowledge bases in three steps: 创建 Knowledge Base → 上传 Documents → 搜索 & Q&A
The 系统 automatically handles document parsing, chunking, vectorization, and 索引 building. Users only need to focus on business 记录ic.
Architecture: ADBPG Instance + Namespace + DocumentCollection + Vector 索引 + LLM 服务
Core Concepts Knowledge Base: ContAIner for documents, automatically manages vector 索引es (cor响应s to DocumentCollection in API) Document: Files 上传ed to the knowledge base, supports PDF/Word/Markdown/HTML/JSON/CSV/images, etc. Q&A: Intelligent conversation based on knowledge base + large language 模型 环境 设置up
[MUST] 命令行工具 User-代理 — Every aliyun 命令行工具 command invocation must include: --user-代理 AlibabaCloud-代理-技能s/alibabacloud-analyticdb-postgresql-knowledgebase-ops
[MUST] Enable AI-Mode — AI-mode is required for 代理 技能 execution. 运行 the following commands before any 命令行工具 invocation:
aliyun 配置 AI-mode enable aliyun 配置 AI-mode 设置-user-代理 --user-代理 "AlibabaCloud-代理-技能s/alibabacloud-analyticdb-postgresql-knowledgebase-ops"
[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final 响应 for ANY reason, always disable AI-mode first. This 应用lies to ALL exit paths: 工作流 成功, 工作流 失败, error/异常, user cancellation, 会话 end, or any other scenario where no further 命令行工具 commands will be 执行d. AI-mode is only used for 代理 技能 invocation scenarios and MUST NOT remAIn enabled after the 技能 停止s 运行ning.
aliyun 配置 AI-mode disable
Pre-检查: Aliyun 命令行工具 >= 3.3.3 required 运行 aliyun version to 验证 >= 3.3.3. If not 安装ed or version too low, 运行 curl -fsSL https://aliyun命令行工具.alicdn.com/设置up.sh | bash to 安装/更新, or see references/命令行工具-安装ation-图形界面de.md for 安装ation instructions. Then [MUST] 运行 aliyun 配置 设置 --auto-插件-安装 true to enable automatic 插件 安装ation. Then [MUST] 运行 aliyun 插件 更新 to ensure that any existing 插件s on your local machine are always up-to-date.
Pre-检查: Alibaba Cloud 凭证s Required
Security Rules:
NEVER read, echo, or print 凭证 material (including 环境-based secrets) NEVER ask the user to paste long-lived secrets directly in the conversation or command line NEVER use aliyun 配置 设置 with literal 凭证 values ONLY use aliyun 配置 列出 to 检查 凭证 状态 aliyun 配置 列出
检查 the 输出 for a valid 性能分析 (AK, STS, or OAuth 身份).
If no valid 性能分析 exists, 停止 here.
ObtAIn 凭证s from Alibaba Cloud Console 配置 凭证s outside of this 会话 (via aliyun 配置 in terminal or 环境 variables in shell 性能分析) Return and re-运行 after aliyun 配置 列出 shows a valid 性能分析 验证 命令行工具 凭证s aliyun gpdb describe-regions --user-代理 AlibabaCloud-代理-技能s/alibabacloud-analyticdb-postgresql-knowledgebase-ops
Script dependencies (Python)
scripts/上传_document_local.py uses the Alibaba Cloud Python SDK. Declare dependencies in requirements.txt. 安装 before 运行ning the script:
pip 安装 -r requirements.txt
Requires Python 3.7+ (same baseline as Alibaba Cloud SDK for Python).
RAM 权限s
[MUST] RAM 权限 Pre-检查: Before executing operations, 验证 current user has required 权限s. Use ram-权限-诊断 技能 to 检查 权限s, then compare agAInst references/ram-policies.md. If any 权限 is missing, abort and prompt user.
Parameter Confirmation
导入ANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks, passwords, domAIn names, resource specifications, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user 应用roval.
Parameter Required/Optional Description Default Value biz-region-id Required Region ID cn-hangzhou db-instance-id Required Instance ID (格式化: gp-xxxxx) - 管理器-account Required 管理器 account name - 管理器-account-password Required 管理器 account password - namespace Optional Namespace name public namespace-password Required Namespace password - collection Required Knowledge base name - embedding-模型 Optional Embedding 模型 text-embedding-v4 dimension Optional Vector dimension 1024
Note: If the knowledge base is 创建d in a custom namespace, all subsequent operations must specify the same namespace parameter.
For interaction 图形界面delines, smart defaults, and best practices, see references/interaction-图形界面delines.md.
Documentation placeholders: 命令行工具 examples use strings like <管理器-account-password> and . Replace them with real values from the user; never commit or 记录 real passwords in docs, tickets, or chat.
Timeout Configuration
Timeout Rules: All operations must complete within reasonable time limits.
Standard operations: ≤10 seconds (crea