@upstash/context7-tools-ai-sdk has 323 recorded weekly downloads on npm, a decrease of 66.3% over the past 30 days, ranking #1609 of 2,322 tracked listings.
About @upstash/context7-tools-ai-sdk
Upstash Context7 AI SDK
@upstash/context7-tools-ai-sdk provides Vercel AI SDK compatible tools and agents that give your AI applications access to up to date library documentation through Context7.
Use this package to:
- Add documentation lookup tools to your AI SDK workflows with
generateTextorstreamText - Create documentation aware agents using the pre-configured
Context7Agent - Build RAG pipelines that retrieve accurate, version specific code examples
The package provides two main tools:
resolveLibrary- Searches Context7's database to find the correct library IDgetLibraryDocs- Fetches documentation for a specific library with optional topic filtering
Quick Start
Install
npm install @upstash/context7-tools-ai-sdk @upstash/context7-sdk ai zod
Get API Key
Get your API key from Context7
Usage
Using Tools with generateText
import { resolveLibrary, getLibraryDocs } from "@upstash/context7-tools-ai-sdk";
import { generateText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
const { text } = await generateText({
model: openai("gpt-6-astra"),
prompt: "How do I use React Server Components?",
tools: {
resolveLibrary: resolveLibrary(),
getLibraryDocs: getLibraryDocs(),
},
stopWhen: stepCountIs(5),
});
console.log(text);
Using the Context7 Agent
The package provides a pre-configured agent that handles the multi-step workflow automatically:
import { Context7Agent } from "@upstash/context7-tools-ai-sdk";
import { anthropic } from "@ai-sdk/anthropic";
const agent = new Context7Agent({
model: anthropic("claude-sonnet-5-5"),
});
const { text } = await agent.generate({
prompt: "How do I set up routing in Next.js?",
});
console.log(text);
Configuration
Environment Variables
Set your API key via environment variable:
CONTEXT7_API_KEY=ctx7sk-...
Then use tools and agents without explicit configuration:
const tool = resolveLibrary(); // Uses CONTEXT7_API_KEY automatically
Docs
See the documentation for details.
Contributing
Running tests
pnpm test
Building
pnpm build
Description from the npm listing.
- context7
- ai-sdk
- vercel
- documentation
- agent
- upstash
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 @upstash/context7-tools-ai-sdk 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/@upstash/context7-tools-ai-sdk. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.