AgentSkillsCN

notion-ingest

在构建Notion同步功能时使用此功能:增量拉取、规范化处理、分块存储、校验码/去重处理,以及将数据插入PostgreSQL表与pgvector向量数据库。

SKILL.md
--- frontmatter
name: notion-ingest
description: Use this when building Notion sync: incremental fetch, normalization, chunking, checksum/dedup, and upserting into Postgres tables and pgvector.

Rules

  • Treat Notion data as source-of-truth; store a normalized snapshot in source_document.raw_json.
  • Prefer incremental sync (based on last_synced_at / updated time) with retry + backoff.
  • Persist stable identifiers: source_id, block_id.
  • Generate chunk records deterministically; update embeddings only when chunk text checksum changes.

Outputs

  • Sync job that can run repeatedly without duplicating data.
  • Logs/metrics-friendly job status rows (optional table sync_job_run).