AgentSkillsCN

retrieval-rag

在实施搜索/RAG功能时使用此功能:对查询进行嵌入式编码,执行pgvector相似度搜索,可选关键词搜索,并以带引用的文献/区块信息返回答案。

SKILL.md
--- frontmatter
name: retrieval-rag
description: Use this when implementing search/RAG: embedding query, pgvector similarity search, optional keyword search, and returning answers with citations (document/block references).

Retrieval policy (MVP)

  • topK vector search on embedding table joined with chunk/content_block.
  • Return: chunks + doc title + block reference so UI can jump to evidence.
  • Keep response deterministic: include score, document_id, block_id.

Guardrails

  • Never hallucinate citations. If no evidence, say so and return empty citations.