Home / Companies / Sanity / Blog / Post Details
Content Deep Dive

Build a content-aware Telegram agent with Vercel AI SDK and Chat SDK

Blog post from Sanity

Post Details
Company
Date Published
Author
-
Word Count
3,334
Language
English
Hacker News Points
-
Summary

A Telegram bot has been developed to assist conference organizers by seamlessly integrating with a content management system (CMS), closing the gap between messaging apps where decisions are made and the CMS where data resides. This bot, built for a fictional ContentOps Conf, leverages the Content Agent API to access Sanity's Content Lake, allowing it to read and write content scoped by GROQ filters, ensuring security by preventing access outside specified document types. The bot can handle tasks such as querying session details, creating announcements, and updating content simply through chat commands, without the need to open the CMS. It operates on three layers: the Sanity Content Agent for permissions, Vercel AI SDK for conversation handling, and Chat SDK for platform routing, making it versatile across platforms like Telegram, Slack, or Discord. The system maintains conversation state for continuity and can analyze interactions to optimize its responses. This setup is part of a dual-agent architecture, with an attendee-facing agent using a different configuration to provide read-only access, highlighting the flexibility and control offered by the Content Agent API and Agent Context for various user needs.