Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Mergetober: keeping an agent in sync with a Sanity CMS, with cognee

Description and use

The Sanity connector for cognee keeps the knowledge agent in sync by tracking document revisions and re‑rendering dependent content, ensuring accurate answers after edits or renames.

Problem

An agent that answers questions about content in a Sanity CMS must stay up‑to‑date when articles, authors, or other referenced documents are edited, unpublished, or deleted.

Outcome

The connector successfully keeps the agent’s memory in sync with Sanity by tracking revisions of referenced documents, ensuring that renames or updates propagate to all dependent articles.

Workflow

  • 1. Create a Sanity connector with cognee specifying project_id, dataset, document_types, and a read‑only token.
  • 2. Call cognee.remember() to ingest the selected documents into the agent’s memory.
  • 3. When a document or its referenced document changes, the connector detects the new _rev and re‑renders all dependent documents.
  • 4. The agent answers queries based on the latest rendered text.
  • 5. Guard against empty listings by raising an error if no documents are returned unless allow_empty_listing=True.

Evidence

An agent that answers questions about that content needs to stay in step with it: when an article is edited, unpublished or deleted, its answers should change too.

Source

The connector tracks the revisions of the documents each article references too, so the author's new revision re-rendered both articles that point to her.

Source

If a run lists nothing but earlier runs synced documents, the connector raises and forgets nothing.

Source

  • Record date: 2026-11-02T06:28:44.939Z