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 Fresh · Oct 17, 2026

content-agent has 1,026 recorded weekly downloads on npm, a decrease of 46.6% over the past 30 days.

It ranks #1391 of 2,256 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by -68.1%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
1,026
Official API · Oct 17, 2026
7-day growth
-50.8%
-1.1K weekly downloads
30-day growth
-46.6%
-895 weekly downloads
90-day growth
-68.1%
-2.2K weekly downloads
Rank
#1391
Among tracked npm listings

About content-agent

content-agent

Vercel AI SDK provider for Sanity Content Agent API.

Installation

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.

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

Tools

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

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:

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

Configuration

Pass a config object to control agent behavior:

Config fields

| Field | Type | Description |

| instruction | string | Custom instruction included in the system prompt | | userMessageContext | Record | Key-value pairs appended to each user message as XML tags | | capabilities | object | Controls what operations the agent can perform (read, write) | | filter | object | GROQ boolean expressions for document access control | | perspectives | object | Perspective locking for read and write operations |

Capabilities

Each capability can be true, false, or a preset object:

One-shot prompts

For stateless single-turn requests, use the provider's .prompt() method directly — no thread, no agent class:

Studio usage

createStudioAgent makes the provider work inside Sanity Studio with no token or manual configuration. It derives the API host, organization ID, and application from the Studio context:

The factory call is synchronous — async setup (org ID fetch, application resolution) runs lazily on the first API call and is cached at the module level. Wrap in useMemo so the provider and agent keep stable identities across renders.

Since there is no token in a Studio context, credentials: 'include' is set on all fetch calls automatically so the browser sends session cookies. The base URL is derived from the client's project-scoped getUrl method.

Using with useChat

For a streaming chat UI, pair with DirectChatTransport and useChat from the AI SDK:

Lower-level helpers

If you need more control than ContentAgent provides, the underlying primitives are still exported:

• provider.agent(threadId, settings) — returns a raw LanguageModelV3 you can pass to streamText/generateText/ToolLoopAgent directly • fromClient(client, workspace) — derives baseURL and application from a Sanity client • provider.resolveApplication(client, workspace) — fetches applications and matches by resource ID + workspace name

License

MIT

Description from the npm listing.

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

Charts

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

Adoption over time

content-agent weekly downloads on npm, last 90 days: 1,026 weekly downloads as of Oct 17, 2026, -68.1% over 90 days.content-agentWeekly downloads on npm · Last 90 days1,026downloads / week-68.1% over 90 days01K2K3K4K5K6KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 21, 2026 – Oct 17, 2026 · 89 observations · Updated Oc…pluginstats.com
content-agent weekly downloads on npm, last 90 days: 1,026 weekly downloads as of Oct 17, 2026, -68.1% over 90 days.
PNG SVG

7/30/90-day growth

content-agent weekly downloads growth on npm: -50.8% over 7 days, -46.6% over 30 days, -68.1% over 90 days.content-agentWeekly downloads growth on npm1,026downloads / week now7-day growth-1,059 weekly downloads-50.8%30-day growth-895 weekly downloads-46.6%90-day growth-2,192 weekly downloads-68.1%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
content-agent weekly downloads growth on npm: -50.8% over 7 days, -46.6% over 30 days, -68.1% over 90 days.
PNG SVG

Ranking history

content-agent npm ranking history: currently #1391 (by weekly downloads).content-agentnpm ranking · by weekly downloads · Last 90 days#1391current rank#1386#1387#1388#1389#1390#1391#1392#1393Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 18, 2026 – Oct 19, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
content-agent npm ranking history: currently #1391 (by weekly downloads).
PNG SVG

Listing placement

All npm2,256 listings · 113 pages · 1,130 shown · page 70, #12 (overall #1,392)
All npm: every listing in weekly downloads order
PNG SVG

Listing placement

AI SDKs250 listings · 13 pages · page 7, #5 (overall #125)
AI SDKs: every listing in weekly downloads order
PNG SVG

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 log 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 (121)
Recent weekly downloads observations for content-agent
Date (UTC)Weekly downloadsChange vs. previous
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-894
4,929—

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 19, 2026. See the methodology.