@gaia-agent/sdk

中文文档
0.1.26发布于 2026/04/07Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 4006

Production-ready AI agent library using AI SDK v6 ToolLoopAgent for GAIA benchmarks with swappable providers

原始使用文档
文档目录37 节
  1. 🤖 Build GAIA-Benchmark-ready Super AI Agents in seconds, no…
  2. ✨ Features
  3. 🚀 Zero Configuration
  4. 🧠 ReAct Reasoning Pattern
  5. � Planning & Verification
  6. �🔧 18+ Built-in Tools
  7. 🔄 Swappable Providers
  8. 🌐 AI-Powered Search
  9. 🛡️ Secure Sandbox
  10. 🖥️ Browser Automation
  11. 🧠 Agent Memory
  12. 📦 Tree-Shaking Friendly
  13. 🎯 Why GAIA Agent?
  14. 🌟 Our Mission
  15. ❌ Traditional Approach
  16. ✅ With GAIA Agent
  17. 🌟 What is the GAIA Benchmark?
  18. 🚀 Quick Start
  19. Installation
  20. Basic Usage
  21. Environment Setup
  22. 🛠️ Built-in Tools
  23. 🔄 Swap Providers
  24. 🎯 GAIA Benchmark
  25. 📚 Wrong Answers Collection
  26. 📊 Enhanced Benchmark Results
  27. 📈 Benchmark Results
  28. 🧪 Testing
  29. 🎯 Advanced Usage
  30. Custom Tools
  31. ToolSDK Integration
  32. Extend GAIAAgent Class
  33. 📚 Documentation
  34. 📖 Guides
  35. 🔧 Reference
  36. 🤝 Contributing
  37. 📄 License
GAIA Agent Logo

GAIA Super Agent SDK

🤖 Build GAIA-Benchmark-ready Super AI Agents in seconds, not weeks

Production-ready Super AI agent with 18+ tools and swappable providers
Built on AI SDK v6 ToolLoopAgent & ToolSDK.ai with ReAct reasoning

npm version License TypeScript AI SDK

Quick Start · Features · GAIA Benchmark · Documentation


✨ Features

🚀 Zero Configuration

Pre-configured agent ready for GAIA benchmarks out of the box

🧠 ReAct Reasoning Pattern

Built-in Reasoning + Acting framework for structured thinking

� Planning & Verification

Multi-step planning + answer verification for complex tasks

�🔧 18+ Built-in Tools

Organized by category with official SDKs (Tavily, Exa, E2B, BrowserUse, Steel)

🔄 Swappable Providers

Easy provider switching for sandbox, browser, search, and memory

Integrated Tavily and Exa for intelligent web search

🛡️ Secure Sandbox

E2B cloud sandbox with code execution + filesystem operations

🖥️ Browser Automation

Steel, BrowserUse or AWS AgentCore for web interactions

🧠 Agent Memory

Persistent memory with Mem0 or AWS AgentCore

📦 Tree-Shaking Friendly

ESM with granular exports, TypeScript-first


🎯 Why GAIA Agent?

🌟 Our Mission

Empower developers to build world-class Super AI Agents in minutes, not months.

Whether you're creating a production-ready AI assistant for your product or competing in GAIA benchmarks, GAIA Agent provides the enterprise-grade foundation you need.

❌ Traditional Approach

  • Days/weeks setting up APIs
  • Writing tool wrappers manually
  • Error handling for each service
  • Figuring out which providers to use
  • Integration testing headaches

✅ With GAIA Agent

  • 3 lines of code to get started
  • 16 tools ready with official SDKs
  • GAIA benchmark ready immediately
  • Swap providers with one line
  • Production-tested implementations

Time savings: From weeks of infrastructure setup → 3 lines of code

Result: A world-class, production-ready Super Agent that rivals top AI systems

🌟 What is the GAIA Benchmark?

The GAIA Benchmark is a comprehensive evaluation suite designed to test the capabilities of AI agents across a wide range of tasks, including reasoning, search, code execution, and browser automation.

📖 Read more about GAIA →


🚀 Quick Start

Installation

npm install @gaia-agent/sdk ai @ai-sdk/openai zod

Basic Usage

import { createGaiaAgent } from '@gaia-agent/sdk';

// Create the agent - reads from environment variables
const agent = createGaiaAgent();

const result = await agent.generate({
  prompt: 'Calculate 15 * 23 and search for the latest AI papers',
});

console.log(result.text);

Environment Setup

Create a .env file:

# Required
OPENAI_API_KEY=sk-...

# Default providers (at least one required)
TAVILY_API_KEY=tvly-...      # Search
E2B_API_KEY=...              # Sandbox
STEEL_API_KEY=steel_live_... # Browser

📖 Complete environment variables guide →


🛠️ Built-in Tools

CategoryToolsProviders
🧮 Corecalculator, httpRequestBuilt-in
� Planningplanner, verifierBuilt-in
�🔍 SearchtavilySearch, exaSearch, exaGetContentsTavily (default), Exa
🛡️ Sandboxe2bSandbox, sandockExecuteE2B (default), Sandock
🖥️ BrowsersteelBrowser, browserUseTool, awsBrowserSteel (default), BrowserUse, AWS
🧠 Memorymem0Remember, mem0Recall, memoryStoreMem0 (default), AWS AgentCore

📖 Full tools documentation →
📖 Provider comparison →
📖 ReAct + Planning guide → ⭐ NEW


🔄 Swap Providers

Switch providers with one line:

import { createGaiaAgent } from '@gaia-agent/sdk';

const agent = createGaiaAgent({
  providers: {
    search: 'exa',              // Use Exa instead of Tavily
    sandbox: 'sandock',         // Use Sandock instead of E2B
    browser: 'browseruse',      // Use BrowserUse instead of Steel
  },
});

Or set via environment variables:

GAIA_AGENT_SEARCH_PROVIDER=exa
GAIA_AGENT_SANDBOX_PROVIDER=sandock
GAIA_AGENT_BROWSER_PROVIDER=browseruse

🎯 GAIA Benchmark

Run official GAIA benchmarks with enhanced results tracking:

# Basic benchmark
pnpm benchmark                  # Run validation set
pnpm benchmark --limit 10       # Test with 10 tasks

# Resume interrupted runs
pnpm benchmark --resume         # Continue from checkpoint

# Filter by capability
pnpm benchmark:files            # Tasks with file attachments
pnpm benchmark:code             # Code execution tasks
pnpm benchmark:search           # Web search tasks
pnpm benchmark:browser          # Browser automation tasks

# Stream mode (real-time thinking)
pnpm benchmark:random --stream  # Watch agent think in real-time

# Wrong answers collection
pnpm benchmark:wrong            # Retry only failed tasks

📚 Wrong Answers Collection

Automatically track and retry failed tasks:

# 1. Run benchmark (auto-creates wrong-answers.json)
pnpm benchmark --limit 20

# 2. View wrong answers
cat benchmark-results/wrong-answers.json

# 3. Retry only failed tasks
pnpm benchmark:wrong --verbose

# 4. Keep retrying until all pass
pnpm benchmark:wrong
# → "🎉 No wrong answers! All previous tasks passed."

📖 Wrong answers guide →
📖 Resume feature guide →
📖 Benchmark module docs →
📖 GAIA setup guide →


📊 Enhanced Benchmark Results

Benchmark results now include full task details:

{
  "taskId": "abc123",
  "question": "What year was X founded?",
  "level": 2,
  "files": ["image.png"],
  "answer": "1927",
  "expectedAnswer": "1927",
  "correct": true,
  "durationMs": 5234,
  "steps": 3,
  "toolsUsed": ["search", "browser"],
  "summary": {
    "totalToolCalls": 5,
    "uniqueTools": ["search", "browser", "calculator"],
    "hadError": false
  },
  "stepDetails": [ /* ... */ ]
}

Easier to analyze and debug! 🎉


📈 Benchmark Results

Latest benchmark performance across different task categories:

Benchmark CommandTimestampResultsAccuracyModelProvidersDetails
pnpm benchmark2025-11-26 08:3322/5341.51%gpt-4oSearch: tavily, Sandbox: e2b, Browser: steelView Details
pnpm benchmark:level12025-11-27 10:3816/5330.19%gpt-4oSearch: openai, Sandbox: e2b, Browser: steel, Memory: mem0-
pnpm benchmark:level12025-12-03 04:1221/5339.62%Claude Sonnet 4.5Search: openai, Sandbox: e2b, Browser: steel, Memory: mem0View Details

📖 See detailed task-by-task results →

Note: Benchmark results are automatically updated after each benchmark run.


🧪 Testing

Run unit tests with Vitest:

pnpm test                # Run all tests
pnpm test:watch          # Watch mode
pnpm test:coverage       # Coverage report

📖 Testing guide →


🎯 Advanced Usage

Custom Tools

import { createGaiaAgent, getDefaultTools } from '@gaia-agent/sdk';
import { tool } from 'ai';
import { z } from 'zod';

const agent = createGaiaAgent({
  tools: {
    ...getDefaultTools(),
    weatherTool: tool({
      description: 'Get weather',
      inputSchema: z.object({ city: z.string() }),
      execute: async ({ city }) => ({ temp: 72, condition: 'sunny' }),
    }),
  },
});

ToolSDK Integration

Integrate thousands of tools from ToolSDK.ai ecosystem:

import { createGaiaAgent, getDefaultTools } from '@gaia-agent/sdk';
import { ToolSDKApiClient } from 'toolsdk/api'; // npm install toolsdk

// Initialize ToolSDK client
const toolSDK = new ToolSDKApiClient({ apiKey: process.env.TOOLSDK_AI_API_KEY });

// Load tools from ToolSDK packages
const emailTool = await toolSDK.package('@toolsdk.ai/mcp-send-email', {
  RESEND_API_KEY: process.env.RESEND_API_KEY,
}).getAISDKTool("send-email");

const agent = createGaiaAgent({
  tools: {
    ...getDefaultTools(),
    emailTool
  },
});

const result = await agent.generate({
  prompt: 'Help me search for the latest AI news and send it to [email protected]',
});

📖 ToolSDK Packages →

Extend GAIAAgent Class

import { GAIAAgent } from '@gaia-agent/sdk';

class ResearchAgent extends GAIAAgent {
  constructor() {
    super({
      instructions: 'Research assistant specialized in AI papers',
      additionalTools: { /* custom tools */ },
    });
  }
}

📖 Advanced usage guide →
📖 API reference →


📚 Documentation

📖 Guides

🔧 Reference


🤝 Contributing

This project uses automated NPM publishing. When changes are merged to main:

  1. ✅ Tests run automatically
  2. 📦 Version bumps to next patch (e.g., 0.1.0 → 0.1.1)
  3. 📝 Changelog created in changelog/
  4. 🚀 Published to NPM
  5. 🏷️ Git tag created

For manual version bumps (minor/major), see docs/NPM_PUBLISH_SETUP.md.


📄 License

Apache License 2.0


Made with ❤️ for the AI community

版本与发布记录

@gaia-agent/sdk 共发布 24 个版本,首次发布于 2025/11/11;过去 12 个月发布了 17 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.26latest2026/04/077 个月前
0.1.242025/12/3110 个月前
0.1.232025/12/0311 个月前
0.1.222025/11/2811 个月前
0.1.212025/11/2711 个月前
0.1.202025/11/2511 个月前

关于 @gaia-agent/sdk 的常见问题

@gaia-agent/sdk 是什么?

Production-ready AI agent library using AI SDK v6 ToolLoopAgent for GAIA benchmarks with swappable providers

如何安装 @gaia-agent/sdk?

在项目目录运行 npm install @gaia-agent/sdk,或使用 pnpm add / yarn add / bun add。

@gaia-agent/sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gaia-agent/sdk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@gaia-agent/sdk 可以商用吗?

@gaia-agent/sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@gaia-agent/sdk 的下载量有多少?

根据 npm 官方下载统计,@gaia-agent/sdk 在 2026/10/16 – 2026/11/14 这 30 天内被下载 4,006 次,日均约 134 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gaia-agent/sdk 还在维护吗?

最新版本 0.1.26 发布于 2026/04/07(7 个月前);至今共发布 24 个版本,其中过去 12 个月发布了 17 个;首次发布于 2025/11/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。