npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

deepagentsdk

v0.16.2

Published

Deep Agent implementation using Vercel AI SDK - build controllable AI agents with planning, filesystem, and subagent capabilities

Readme

Deep Agent SDK

npm version License: MIT Ask DeepWiki Documentation

Note: This package requires Bun runtime. It uses Bun-specific features and TypeScript imports.

A TypeScript library for building controllable AI agents using Vercel AI SDK. This is a reimplementation of deepagentsjs without any LangChain/LangGraph dependencies.

What is Deep Agent?

Using an LLM to call tools in a loop is the simplest form of an agent. This architecture, however, can yield agents that are "shallow" and fail to plan and act over longer, more complex tasks.

Deep Agent addresses these limitations through four core architectural components:

| Component | Purpose | Implementation | |-----------|---------|----------------| | Planning Tool | Long-term task breakdown and tracking | write_todos for maintaining task lists | | Sub Agents | Task delegation and specialization | task tool for spawning specialized agents | | File System Access | Persistent state and information storage | Virtual filesystem with read_file, write_file, edit_file | | Detailed Prompts | Context-aware instructions | Sophisticated prompting strategies |

Installation

This package requires Bun runtime:

# Install Bun if you haven't already
curl -fsSL https://bun.sh/install | bash

# Install the package
bun add deepagentsdk

# Or install globally for CLI usage
bun add -g deepagentsdk

Why Bun? This package publishes TypeScript source directly and uses Bun-specific optimizations for better performance.

Quick Start

import { createDeepAgent } from 'deepagentsdk';
import { anthropic } from '@ai-sdk/anthropic';

const agent = createDeepAgent({
  model: anthropic('claude-sonnet-4-5-20250929'),
  systemPrompt: 'You are an expert researcher.',
});

const result = await agent.generate({
  prompt: 'Research the topic of quantum computing and write a report',
});

console.log(result.text);
console.log('Todos:', result.state.todos);
console.log('Files:', Object.keys(result.state.files));

Features

Structured Output

Deep agents can return typed, validated objects using Zod schemas alongside text responses:

import { z } from 'zod';

const agent = createDeepAgent({
  model: anthropic('claude-sonnet-4-5-20250929'),
  output: {
    schema: z.object({
      summary: z.string(),
      keyPoints: z.array(z.string()),
    }),
    description: 'Research findings',
  },
});

const result = await agent.generate({
  prompt: "Research latest AI developments",
});

console.log(result.output?.summary);      // string
console.log(result.output?.keyPoints);    // string[]

Streaming with Events

Stream responses with real-time events for tool calls, file operations, and more:

for await (const event of agent.streamWithEvents({
  prompt: 'Build a todo app',
})) {
  switch (event.type) {
    case 'text':
      process.stdout.write(event.text);
      break;
    case 'tool-call':
      console.log(`Calling: ${event.toolName}`);
      break;
    case 'file-written':
      console.log(`Written: ${event.path}`);
      break;
  }
}

Built-in Tools

  • Planning: write_todos for task management
  • Filesystem: read_file, write_file, edit_file, ls, glob, grep
  • Web: web_search, http_request, fetch_url (requires Tavily API key)
  • Execute: Shell command execution with LocalSandbox backend
  • Subagents: Spawn specialized agents for complex subtasks

Documentation

For comprehensive guides, API reference, and examples, visit deepagentsdk.vercel.app/docs

Key Documentation Sections

  • Get Started - Installation and basic setup
  • Guides - In-depth tutorials on:
    • Configuration options (models, backends, middleware)
    • Custom tools and subagents
    • Agent memory and persistence
    • Prompt caching and conversation summarization
    • Web tools and API integration
  • Reference - Complete API documentation

CLI

The interactive CLI is built with Ink:

# Run without installing (recommended)
bunx deepagentsdk

# Or install globally
bun add -g deepagentsdk
deep-agent

# With options
bunx deepagentsdk --model anthropic/claude-haiku-4-5-20251001

API Keys: Load from environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY, TAVILY_API_KEY) or .env file.

License

MIT