惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
U
Unit 42
人人都是产品经理
人人都是产品经理
罗磊的独立博客
Recent Announcements
Recent Announcements
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
GbyAI
GbyAI
Blog — PlanetScale
Blog — PlanetScale
I
InfoQ
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
B
Blog RSS Feed
WordPress大学
WordPress大学
腾讯CDC
H
Help Net Security
博客园 - Franky
博客园 - 【当耐特】
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
B
Blog
Vercel News
Vercel News
博客园 - 司徒正美

Sanity.io

A Board Game agent built using Sanity Context and Vercel's AI SDK | Sanity Build a prototype with Claude Code that your whole team can edit | Sanity What’s New - May 2026 | Sanity I built a London pub guide with v0 and the Sanity MCP in six hours. Here's what I learned. | Sanity Build a conference concierge with Agent Context and Anthropic | Sanity Build a content-aware Telegram agent with Vercel AI SDK and Chat SDK | Sanity How I used Agent API to generate photos for my family’s recipes | Sanity What’s New April - 2026 | Sanity Better context, better matches: An AI love story (for dogs) | Sanity How to write for an agent | Sanity Content Agent, meet Slack: AI content operations in your workflow | Sanity Structure powers intelligence | Sanity Your agent needs better content. Here's how to give it. | Sanity How to serve content to agents (a field guide) | Sanity Sanity TypeGen GA: Automatic TypeScript types for content and GROQ | Sanity Sanity is now available on the Vercel Marketplace | Sanity The logo soup problem (and how to solve it) | Sanity Content Releases: From scattered updates to coordinated publishing | Sanity What's New - February 2026 | Sanity How we solved the agent memory problem | Sanity v0 Builder Challenge: The winners | Sanity Introducing: Sanity Agent Skills | Sanity Content Agent: Days of work in one conversation | Sanity Our Sanity Values | Sanity Open Source Pledge 2025: Stepping up when it matters | Sanity v0 builder challenge: $3000 in prizes | Sanity Why AI Breaks Without Structured Content Operations | Sanity What’s New January - 2026 | Sanity BFCM 2025: What teams built when infrastructure stopped being the problem | Sanity How AI shaped holiday shopping and what it means for content in 2026 | Sanity
Agent Actions: AI building blocks for structured content ...
Ken Jones · 2025-05-23 · via Sanity.io

Why Agent Actions matter

Ever wished AI could work directly with your structured content instead of operating in isolation? Agent Actions solve this problem by:

  • Validating outputs against your content's structure
  • Running from anywhere you can execute code
  • Eliminating tedious reformatting work

As part of Sanity's Content Operating System, Agent Actions run directly in the Content Lake alongside your content, allowing you to trigger automation from Studio, Functions, Apps, your frontend, or anywhere your code lives. Use Agent Actions to adapt content to business needs across applications.

The Agent Actions toolkit

At the time of this writing, Sanity offers three specialized Agent Actions that work with your schema, not against it: Generate, Transform, and Translate.

Generate

When you need fresh content created that aligns with your schema, Generate is your go-to action. It creates new structured content based on instructions and context you provide.

With Generate, you can:

Transform

When you need to modify an existing document's content, Transform is what you want. It applies changes to documents while respecting the original structure and formatting.

Transform excels at:

  • Changing document tone or style
  • Standardizing content across your dataset
  • Applying consistent terminology changes

Translate

When you need content in multiple languages, Translate makes the process seamless. It's a specialized version of Transform designed with internationalization in mind.

Translate supports:

  • Document-level translation
  • Field-level translation (coming soon)
  • Style guides to maintain consistent voice

Getting started with Agent Actions

Let's walk through setting up and using Agent Actions in your project.

Prerequisites

Before we begin, you'll need:

  • @sanity/client v7.1.0 or higher
  • sanity CLI v3.88.0 or higher
  • A Sanity project with a schema
  • A read/write API token
  • Your projectId and dataset name

Step 1: Deploy your schema

Agent Actions require a schemaId to understand your content model. First, check if you've already deployed your schema:

If you don't see your schema (or want to update it), deploy it:

Once deployed, run sanity schema list again and copy the schema ID. It'll look something like _.schemas.default.

Step 2: Configure the client

Create a file for your Agent Action code and set up the Sanity client:

Step 3: Create your first instruction

Now, let's write an instruction for Generate to create a new blog post:

This will create a new draft post with AI-generated content based on your instruction. The content will be structured according to your schema, so fields like title, body, and others will be populated and formatted appropriately.

Step 4: Trying Transform

Let's see how Transform differs from Generate:

This instruction will update only the specified fields, keeping everything else exactly as it was.

Step 5: Translating content

And here's how you'd use Translate to create an Italian version of a post:

Real-world use cases

Here's how Agent Actions solve actual content challenges:

Content creation at scale

Imagine you have a product catalog with hundreds of items but minimal descriptions. You could use Generate to create draft descriptions based on product attributes:

Automated translations

When expanding to new markets, you could set up a Sanity Function that automatically creates translated versions when a post is published:

Custom Studio components

Create a button that generates content suggestions right in the Studio:

Sanity Studio input component preview
AI Suggestion Studio input component

Final thoughts

Agent Actions transform (pun intended) the way you think about automating your content creation workflows. No more hacking around AI outputs and wrestling with content that doesn't mesh with your content's schema.

Key advantages:

  • Schema-aware outputs that fit your model
  • Run from anywhere in your stack
  • Field-level control with precise targeting for inclusion or exclusion
  • Context-aware from existing content and validation
  • Native integration with Sanity and part of the Sanity Client you already know and love.

Whether you're creating fresh content, standardizing existing assets, or expanding to new languages, Agent Actions help you put content at the core of your business.

Ready to start? Check out the complete documentation.

Join the conversation

What will you build with Agent Actions? We'd love to see your implementations. Join us on Discord to discuss your projects, ask questions, or share tips.