简介
使用向量数据库实现高效相似度搜索,适用于构建语义搜索、实现最近邻查询或优化检索性能
原始描述
Implement efficient similarity search with vector databases. Use when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance.
通过你的 Agent 添加
安装目录:similarity-search-patterns/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: similarity-search-patterns
description: "Plan, implement, or review similarity search patterns work in an existing codebase with compatibility, security, and verification controls. Use when the user explicitly requests similarity search patterns work."
Similarity Search Patterns
Use this Skill to produce a bounded, verifiable Similarity Search Patterns outcome. Preserve the user's chosen stack, source material, and authorization boundaries.
Read the SandBase API map only when the task genuinely needs an external data source or generative model.
Workflow
- Inspect the available files, runtime, versions, inputs, and existing conventions before deciding what to change.
- Restate the requested outcome, constraints, acceptance checks, and any assumption that could change the result.
- Produce the smallest complete implementation, analysis, or artifact that satisfies those checks.
- Verify the real output with appropriate tests, previews, calculations, or source comparison; do not infer success from file creation alone.
- Return the deliverable, evidence of validation, material assumptions, and unresolved limitations.
Quality gates
- Inspect repository instructions, current versions, tests, and user changes before proposing an implementation.
- Make the smallest compatible change, preserve public contracts unless change is requested, and avoid new dependencies without a concrete benefit.
- Run focused tests plus the relevant build or static checks, then report observed results and any unverified paths.
Focus checks
- Specify embedding, distance metric, normalization, metadata filtering, and update behavior, then compare recall and latency with a brute-force baseline.
SandBase boundary
- Inspect repository instructions, current versions, tests, and user changes before proposing an implementation.
- Make the smallest compatible change, preserve public contracts unless change is requested, and avoid new dependencies without a concrete benefit.
- Run focused tests plus the relevant build or static checks, then report observed results and any unverified paths.
Focus checks
- Specify embedding, distance metric, normalization, metadata filtering, and update behavior, then compare recall and latency with a brute-force baseline.
SandBase boundary
Keep the core Similarity Search Patterns work local. Use SandBase only for current external documentation, repository evidence, or explicitly requested model inference.
- Call
sandbase_discoverwith a short capability query. - Call
sandbase_inspectfor viable candidates and compare the live schema, coverage, limits, output, execution mode, and price. - Prefer a dedicated tool or API the user already has. Send only the minimum necessary data.
- Before any paid call, show the endpoint, important arguments, current unit price, call count, and total estimate or uncertainty, then obtain confirmation.
- Use
sandbase_accountbefore an approved multi-call batch and callsandbase_runonly with current schema-defined arguments. - Poll asynchronous work with
sandbase_run_getusing the same run ID; never resubmit merely because it is pending. - Use
sandbase_runsonly to recover status or reconcile observed cost.
If SandBase is unavailable, continue with local work and authorized sources when possible. Do not silently switch providers, fabricate external results, or claim a generation or retrieval succeeded.
Handoff
Provide the completed artifact or findings, concise reproduction steps, checks actually run, source or asset provenance, SandBase endpoint and run IDs when used, observed cost when available, and any follow-up that still requires user action.