Skip to content
PluginStats

content-agent weekly downloads statistics

By sanity-io · npm · AI SDKs

Vercel AI SDK provider for Sanity Content Agent API

View on npm Stale · Oct 18, 2026

content-agent has 1,445 recorded weekly downloads on npm, a decrease of 40.8% over the past 30 days, ranking #1413 of 2,391 tracked listings.

Weekly downloads
1,445
Official API · Oct 18, 2026
7-day growth
-29.0%
-590 weekly downloads
30-day growth
-40.8%
-996 weekly downloads
90-day growth
-56.3%
-1.9K weekly downloads
Rank
#1413
Among tracked npm listings

About content-agent

content-agent

Vercel AI SDK provider for Sanity Content Agent API.

Installation

npm install content-agent ai

Usage

ContentAgent extends the AI SDK's ToolLoopAgent — it inherits .generate(), .stream(), telemetry, and every other capability of the AI SDK's first-class agent abstraction. Construction is the only thing that differs: pass a provider and threadId instead of a model, and ContentAgent resolves the model for you.

import { createContentAgent } from "content-agent";
import { ContentAgent } from "content-agent/agent";

const provider = createContentAgent({
  organizationId: "your-org-id",
  token: "your-sanity-token",
});

const agent = new ContentAgent({
  provider,
  threadId: "my-thread",
});

const { text } = await agent.generate({
  prompt: "What blog posts do I have?",
});

provider is reusable — create it once per organization and instantiate as many ContentAgents as you need.

Why a class instead of streamText({ model, ... })?

The AI SDK 6 explicitly invites SDK authors to ship their own Agent implementations: "The Agent is now an interface instead of a class, which allows developers to implement their own agent abstractions for specific needs." ContentAgent is that implementation for the Sanity Content Agent — it preconfigures stopWhen, prepareStep, and toolChoice for the final_answer reply pipeline so you don't have to.

Migrating from streamText({ model: provider.agent(threadId) })? Nothing breaks — the lower-level API is still supported and works exactly as before. Switch to ContentAgent to pick up the safe defaults that prevent empty responses when the model burns its step budget on client tool calls. See How replies work below.

Streaming

const result = await agent.stream({
  prompt: "Summarize my latest content",
});

for await (const text of result.textStream) {
  process.stdout.write(text);
}

Tools

Pass AI SDK tools to the constructor — schemas are forwarded to the agent, and execution happens locally on the client:

import { ContentAgent } from "content-agent/agent";
import { tool } from "ai";
import { z } from "zod";

const agent = new ContentAgent({
  provider,
  threadId: "my-thread",
  tools: {
    submit_for_review: tool({
      description: "Submit a document for editorial review.",
      inputSchema: z.object({
        documentId: z.string().describe("The Sanity document _id"),
        email: z.string().email().describe("Reviewer email"),
        note: z.string().optional().describe("Note for the reviewer"),
      }),
      execute: async ({ documentId, email, note }) => {
        const res = await fetch("https://workflows.example.com/api/review", {
          method: "POST",
          body: JSON.stringify({ documentId, email, note }),
        });
        return res.json();
      },
    }),
  },
});

const result = await agent.stream({
  prompt: "Find all draft blog posts and submit them for review.",
});

How replies work

Every reply is delivered through a server-side final_answer tool call. The agent streams final_answer.message to the wire as text-delta chunks (parsed incrementally from the tool-call args) and includes structured suggestions for clients that render reply buttons. There's no separate "streaming mode" — every conversation, every client follows the same path.

ContentAgent adjusts the loop control primitives to make this safe by default:

  1. stopWhen defaults to "stop on the first step that contains a final_answer tool call," plus a stepCountIs(20) safety cap. A final_answer accompanied by other tool calls in the same step is the canonical act-and-answer pattern — the loop terminates without an extra round-trip.
  2. prepareStep is composed with a safety net that, on the cap step, forces toolChoice { type: 'tool', toolName: 'final_answer' } if the model has been calling tools without ever converging on final_answer. This guarantees a reply on the wire even in pathological cases where the model would otherwise burn its step budget on client-tool round-trips.
  3. Server-side recovery (SAGE-248) — if the model fails to call final_answer naturally on any single turn, the agent runner retries that turn with forced tool_choice. Anthropic's API enforces forced tool choice strictly; the recovery is guaranteed to produce a final_answer chunk.

If you pass your own stopWhen or prepareStep, they take precedence — ContentAgent doesn't reach into them.

Applications

Each application key uniquely identifies a deployed Sanity Studio workspace. Since multiple studios can share the same project ID and dataset, the application key disambiguates which one to target.

List available applications for your organization, then target one by its key:

const apps = await provider.applications();
const app = apps.find((app) => app.title === "My Studio");

const agent = new ContentAgent({
  provider,
  threadId: "my-thread",
  application: { key: app.key },
});

You can also set a default application on the provider so every agent and .prompt() call inherits it:

const provider = createContentAgent({
  organizationId: "your-org-id",
  token: "your-token",
  application: resolvedApp,
});

Configuration

Pass a config object to control agent behavior:…

Description from the npm listing.

  • sanity
  • content-agent
  • ai-sdk
  • vercel-ai
  • provider

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

content-agent weekly downloads on npm, last 90 days: 1,445 weekly downloads as of Oct 18, 2026, -56.3% over 90 days.content-agentWeekly downloads on npm · Last 90 days1,445downloads / week-56.3% over 90 days01K2K3K4K5K6KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 23, 2026 – Oct 18, 2026 · 88 observations · Updated Oc…pluginstats.com
content-agent weekly downloads on npm, last 90 days: 1,445 weekly downloads as of Oct 18, 2026, -56.3% over 90 days.

7/30/90-day growth

content-agent weekly downloads growth on npm: -29.0% over 7 days, -40.8% over 30 days, -56.3% over 90 days.content-agentWeekly downloads growth on npm1,445downloads / week now7-day growth-590 weekly downloads-29.0%30-day growth-996 weekly downloads-40.8%90-day growth-1,859 weekly downloads-56.3%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
content-agent weekly downloads growth on npm: -29.0% over 7 days, -40.8% over 30 days, -56.3% over 90 days.

Ranking history

content-agent npm ranking history: currently #1413 (by weekly downloads).content-agentnpm ranking · by weekly downloads · Last 90 days#1413current rank#1385#1390#1395#1400#1405#1410#1415Jul 23Aug 7Aug 22Sep 6Sep 21Oct 6Oct 21rankOct 18, 2026 – Oct 21, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
content-agent npm ranking history: currently #1413 (by weekly downloads).

Listing placement

All npm2,389 listings · 120 pages · 1,196 shown · page 72, #8 (overall #1,428)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs264 listings · 14 pages · page 6, #17 (overall #117)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for content-agent
Date (UTC)Weekly downloadsChange vs. previous
1,445+419
1,026-169
1,195+252
943-342
1,285-541
1,8260
1,826-209
2,035-50
2,085-5
2,090-387
2,477-878
3,355-33
3,388-647
4,035—

Similar npm AI SDKs plugins

All 20 content-agent alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/content-agent. First seen Oct 16, 2026; last successful collection Oct 21, 2026. See the methodology.