polygres-retrieval-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePolygres Retrieval Design
Polygres检索设计
Produce a reviewable plan before retrieval configuration or application work.
This skill is advisory: it must not mutate a project directly.
在检索配置或应用开发前生成可评审的计划。
本技能仅提供咨询建议:不得直接修改项目。
Workflow
工作流程
- Extract the user outcome, authorization, latency, freshness, and expected result shape from the prompt and inspected application. Ask only for a missing fact that changes the recommendation; representative questions are useful evidence, not a mandatory interview.
- Resolve project mode, then inspect the supplied schema, verified row identifiers, sample data, and existing retrieval configuration. Label missing evidence as unresolved; never infer production facts from a table or column name.
- Select the smallest sufficient strategy using
. Reject an unsupported strategy rather than inventing a capability.
references/strategy-selection.md - For graph retrieval, apply . For an existing vector configuration, TSVector, or fuzzy retrieval, apply
references/graph-modeling.md.references/vector-and-text-design.md - For pgContext collections, point synchronization, registered filters, or
Context retrieval modes, apply .
references/context-design.md - For multi-stage retrieval or RAG, apply
.
references/hybrid-and-rag-plan.md - Write the result with . When called by
references/plan-template.md, return the selected and omitted components plus exact public-interface handoffs in a machine-readable section so the caller can continue without another interview.$polygres-data-pipeline - In a design-only request, stop before mutation. In an active data-pipeline setup, return control to the orchestrating skill; its consolidated review and approval govern the implementation.
- 从提示信息和待检查应用中提取用户目标、权限、延迟要求、数据新鲜度以及预期结果形态。仅询问会影响推荐结果的缺失信息;代表性问题可作为有用依据,但无需进行强制性访谈。
- 确定项目模式,然后检查提供的 schema、已验证的行标识符、样本数据和现有检索配置。将缺失的依据标记为未解决;切勿从表名或列名推断生产环境事实。
- 使用选择最小且足够的策略。对于不支持的策略直接拒绝,而非凭空创造能力。
references/strategy-selection.md - 针对图检索,应用。对于现有向量配置、TSVector或模糊检索,应用
references/graph-modeling.md。references/vector-and-text-design.md - 针对pgContext集合、点同步、已注册过滤器或Context检索模式,应用。
references/context-design.md - 针对多阶段检索或RAG,应用。
references/hybrid-and-rag-plan.md - 使用撰写结果。当被
references/plan-template.md调用时,在机器可读部分返回已选和未选组件以及精确的公共接口交接内容,以便调用方无需再次访谈即可继续操作。$polygres-data-pipeline - 在仅设计的请求中,在修改操作前停止。在活跃的数据管道设置中,将控制权交还给编排技能;其综合评审和批准将指导实施工作。
Design rules
设计规则
- Prefer relational retrieval for exact predicates, joins, aggregates, and transactions that do not need a retrieval index.
- For a synced project, keep exact SQL, transactions, and source mutations in the source PostgreSQL database. Use only the supported Runtime retrieval and retrieval-configuration surfaces on Polygres.
- Treat graph, vector, text, and Context indexes and point mappings as derived project resources whose readiness and refresh behavior must be validated.
- Use exact schema identifiers and stable row ID values from verified data. Do not use invented row IDs or fuzzy-match schema names.
- Bound graph direction, depth, fan-out, result count, and cycle behavior.
- Record the embedding model, dimensions, metric, input construction, and response to a dimension mismatch or empty embedding.
- Default new semantic retrieval plans to a Polygres AI Context collection.
Decide explicitly whether distinct embeddings belong as named vectors in one
collection or require separate collection-level source and policy settings.
Record any existing pgvector configuration that must remain compatible or
needs a migration plan. Never treat those resources as interchangeable.
On a synced project, use only an existing synchronized source table and
embedding column; do not plan or
add_columnon the target.new_table - State TSVector language/configuration choices and fuzzy thresholds.
- For hybrid retrieval, define stage order, provenance, deduplication, authorization, and token budget.
- Include rebuild or reindex triggers, readiness checks, and rollback or fallback behavior.
- 对于不需要检索索引的精确谓词、连接、聚合和事务,优先使用关系型检索。
- 对于同步项目,将精确SQL、事务和源修改保留在源PostgreSQL数据库中。仅在Polygres上使用受支持的Runtime检索和检索配置界面。
- 将图、向量、文本和Context索引以及点映射视为派生项目资源,必须验证其就绪状态和刷新行为。
- 使用来自已验证数据的精确schema标识符和稳定行ID值。不得使用虚构的行ID或模糊匹配的schema名称。
- 限制图的方向、深度、扇出、结果数量和循环行为。
- 记录embedding模型、维度、度量标准、输入构造方式,以及对维度不匹配或空embedding的处理方式。
- 新的语义检索计划默认使用Polygres AI Context集合。明确决定不同的embedding应作为命名向量放在一个集合中,还是需要单独的集合级源和策略设置。记录任何必须保持兼容或需要迁移计划的现有pgvector配置。切勿将这些资源视为可互换的。在同步项目中,仅使用现有的同步源表和embedding列;不得在目标端计划或
add_column操作。new_table - 说明TSVector语言/配置选择和模糊阈值。
- 对于混合检索,定义阶段顺序、来源、去重、权限和token预算。
- 包含重建或重新索引触发器、就绪检查以及回退或 fallback 行为。
Boundaries
边界限制
- This skill must not mutate a project, generate secrets, or claim that a plan has been applied.
- Do not write mutating command examples. Route approved configuration work to
and approved Python integration to
$polygres-cli.$polygres-sdk - Filters are not an authorization boundary. Apply access control before data enters retrieval and again when results are resolved.
- If required columns, stable IDs, or a usable sample are absent, make a reversible provisional recommendation when possible. Stop only when the missing evidence makes every safe recommendation invalid.
- 本技能不得修改项目、生成密钥或声称计划已被应用。
- 不得编写修改性命令示例。将已批准的配置工作路由到,已批准的Python集成路由到
$polygres-cli。$polygres-sdk - 过滤器不是权限边界。在数据进入检索前应用访问控制,并在结果解析时再次应用。
- 如果缺少必要的列、稳定ID或可用样本,尽可能做出可逆的临时建议。仅当缺失的依据导致所有安全建议都无效时才停止操作。
Completion
完成要求
Return the completed reviewable plan, the unresolved assumptions, the
recommended public-surface handoffs, and the explicit approval needed before
any mutation or implementation.
返回已完成的可评审计划、未解决的假设、推荐的公共界面交接内容,以及在进行任何修改或实施前所需的明确批准。