@dbos-inc/vercel-ai weekly downloads statistics
DBOS durable execution integration for the Vercel AI SDK
@dbos-inc/vercel-ai has 7,196 recorded weekly downloads on npm, an increase of 3.4% over the past 30 days, ranking #1046 of 2,322 tracked listings.
About @dbos-inc/vercel-ai
@dbos-inc/vercel-ai
DBOS durable execution for the Vercel AI SDK.
This package makes AI SDK agents durable, backed by your Postgres database.
All you have to do is wrap your model with durableCalls and your tools with durableTools and run your agents inside a DBOS workflow.
Then, this integration automatically checkpoints every action your agents take in Postgres.
If your process is interrupted, DBOS replays your agent from its checkpoints so it resumes from where it left off.
import { DBOS } from '@dbos-inc/dbos-sdk';
import { generateText, wrapLanguageModel } from 'ai';
import { openai } from '@ai-sdk/openai';
import { durableCalls } from '@dbos-inc/vercel-ai';
const model = wrapLanguageModel({
model: openai('gpt-5'),
middleware: durableCalls({ retriesAllowed: true, maxAttempts: 5 }),
});
const researchAgent = DBOS.registerWorkflow(
async (question: string) => {
const { text } = await generateText({
model,
prompt: question,
system: 'You are a helpful research assistant.',
});
return text;
},
{ name: 'researchAgent' },
);
DBOS.setConfig({ name: 'my-agent', systemDatabaseUrl: process.env.DBOS_SYSTEM_DATABASE_URL });
await DBOS.launch();
console.log(await researchAgent('Why did the agent cross the road?'));
Installation
npm install @dbos-inc/vercel-ai @dbos-inc/dbos-sdk ai
Requires DBOS v4.27+ or v5, AI SDK v7+, and a Postgres database for DBOS.
Durable Model Calls
To durably checkpoint each call you make to a model, wrap your model in durableCalls.
Then, call your model or agent from a workflow:
import { DBOS } from '@dbos-inc/dbos-sdk';
import { ToolLoopAgent, wrapLanguageModel } from 'ai';
import { openai } from '@ai-sdk/openai';
import { durableCalls } from '@dbos-inc/vercel-ai';
const model = wrapLanguageModel({ model: openai('gpt-5'), middleware: durableCalls() });
const agent = new ToolLoopAgent({ model, instructions: 'You are a helpful research assistant.', tools });
const researchAgent = DBOS.registerWorkflow(
async (question: string) => {
const result = await agent.stream({ prompt: question });
for await (const delta of result.textStream) process.stdout.write(delta);
return await result.text;
},
{ name: 'researchAgent' },
);
You can parameterize durableCalls to configure model call retries and timeouts:
durableCalls({
name?: string; // step name (default: "<provider>.<modelId>.<operation>")
retriesAllowed?: boolean; // retry failed model calls (default: true)
maxAttempts?: number; // total attempts when retries are allowed (default: 3)
intervalSeconds?: number; // delay before first retry (default: 1)
backoffRate?: number; // exponential backoff multiplier (default: 2)
shouldRetry?: (error: unknown) => boolean; // default: skip provider-declared non-retryable errors and aborts
timeoutMS?: number; // per-attempt timeout
durableStream?: string; // stream each call's output to this durable stream
include?: { requestBody?: boolean; responseBody?: boolean }; // checkpoint raw provider bodies; match generateText's `include` (default: false)
});
Durable Tools
To durably checkpoint your agents' tool calls, wrap them in durableTools:
import { tool, stepCountIs } from 'ai';
import { durableTools } from '@dbos-inc/vercel-ai';
import { z } from 'zod';
const tools = durableTools({
getWeather: tool({
description: 'Get the weather for a city',
inputSchema: z.object({ city: z.string() }),
execute: ({ city }) => fetchWeather(city),
}),
});
const agent = DBOS.registerWorkflow(async (question: string) => {
const result = await generateText({ model, prompt: question, tools, stopWhen: stepCountIs(10) });
return result.text;
}, { name: 'weatherAgent' });
You can pass step configuration (such as timeouts or retries) to durableTools.
You can set defaults for all tools or configure tools individually.
Retries are off by default.
const tools = durableTools(myTools, {
timeoutMS: 30_000,
tools: {
getWeather: { retriesAllowed: true, maxAttempts: 3 },
},
});
When using durable tools, to ensure the ordering of parallel tool calls is consistent during recovery, do not await I/O in callbacks that run before a tool executes, such as onToolExecutionStart.
Durable Streams
You can durably stream agent or model output so it can be read by an external client or UI.
To do this, configure durableCalls or durableTools/durableMCPTools with a durable stream name:
import { createUIMessageStreamResponse, streamText } from 'ai';
import { durableCalls, durableTools, readDurableStream } from '@dbos-inc/vercel-ai';
const model = wrapLanguageModel({ model: openai('gpt-5'), middleware: durableCalls({ durableStream: 'ui' }) });
const tools = durableTools(myTools, { durableStream: 'ui' });
const chatTurn = DBOS.registerWorkflow(async (messages: ModelMessage[]) => {
const result = streamText({ model, messages, tools, stopWhen: stepCountIs(10) });
return await result.text;
}, { name: 'chatTurn' });
export async function POST(req: Request) {
const { messages, messageId } = (await req.json()) as { messages: ModelMessage[]; messageId: string };
const handle = await DBOS.startWorkflow(chatTurn)(messages);
return createUIMessageStreamResponse({
stream: readDurableStream({ workflowID: handle.workflowID, key: 'ui', messageId }),
});
}
You can read from a durable stream using readDurableStream, for example to stream it to a UI.
It emits a stream of AI SDK UIMessageChunk.
You can also pass a DBOSClient into readDurableStream to read it from a different process.…
Description from the npm listing.
- dbos
- ai
- vercel
- ai-sdk
- durable-execution
- workflow
- llm
- agent
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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 (544)Similar npm AI SDKs plugins
All 20 @dbos-inc/vercel-ai alternativesData 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/@dbos-inc/vercel-ai. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.