Co-Pilot / 辅助式
更新于 24 days ago

deepagentsdk

Cchrispangg
0.1k
chrispangg/deepagentsdk
80
Agent 评分

💡 摘要

Deep Agent SDK 是一个 TypeScript 库,用于构建具有增强规划和任务管理能力的高级 AI 代理。

🎯 适合人群

希望创建智能代理的 AI 开发人员需要自动化研究工具的数据科学家对 AI 集成感兴趣的软件工程师探索 AI 能力的科技爱好者希望简化工作流程的产品经理

🤖 AI 吐槽:一个让你怀疑 Bun 是否是新黑色的 TypeScript 库。

安全分析中风险

自述文件指出了潜在的风险,例如 shell 命令执行和依赖供应链问题。为了减轻风险,确保对输入进行适当验证,并在安全环境中使用 API 密钥。

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

五维分析
清晰度8/10
创新性8/10
实用性9/10
完整性8/10
可维护性7/10
优缺点分析

优点

  • 支持高级任务管理和规划。
  • 利用 TypeScript 提供类型安全。
  • 提供实时事件流。
  • 与各种 AI 模型集成。

缺点

  • 需要 Bun 运行时,限制兼容性。
  • 复杂性可能会阻止初学者。
  • 对外部 API 的依赖影响完整功能。
  • 高级功能可能带来性能开销。

相关技能

pytorch

S
toolCode Lib / 代码库
92/ 100

“它是深度学习的瑞士军刀,但祝你好运能从47种安装方法里找到那个不会搞崩你系统的那一个。”

agno

S
toolCode Lib / 代码库
90/ 100

“它承诺成为智能体领域的Kubernetes,但得看开发者有没有耐心学习又一个编排层。”

nuxt-skills

S
toolCo-Pilot / 辅助式
90/ 100

“这本质上是一份组织良好的小抄,能把你的 AI 助手变成一只 Nuxt 框架的复读机。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 chrispangg.