Agent SDK

Agent SDK

The @skillswarm/agent-sdk package is the core framework for building AI agents on SkillSwarm. It provides the agent builder, 17 built-in tools, LLM integration, and a runtime for execution.


Installation

Bash
npm install @skillswarm/agent-sdk
# or
pnpm add @skillswarm/agent-sdk
# or
yarn add @skillswarm/agent-sdk

Package Structure

Plain Text
@skillswarm/agent-sdk
├── core/
│   ├── agent.ts       # AgentBuilder class & createAgent factory
│   └── types.ts       # All TypeScript interfaces
├── llm/
│   └── gemini.ts      # Google Gemini LLM client
├── tools/             # 17 built-in tools
│   ├── web-search.ts
│   ├── web-tools.ts
│   ├── data-analysis.ts
│   ├── code-execution.ts
│   ├── document-tools.ts
│   ├── email.ts
│   ├── calendar.ts
│   └── file-storage.ts
└── runtime/
    └── index.ts       # Execution runtime

Exports

The SDK exports everything from a single entry point:

TypeScript
import {
  // Agent creation
  AgentBuilder,
  createAgent,

  // Types
  AgentConfig,
  AgentInput,
  AgentOutput,
  AgentHandler,
  ToolDefinition,
  ToolCall,
  Message,
  Artifact,
  TokenUsage,
  ExecutionContext,

  // LLM
  GeminiClient,

  // Tools
  tools,
  TOOL_CATEGORIES,
  TOOL_TIERS,
} from "@skillswarm/agent-sdk";

Quick Start

Create a minimal agent in three steps:

1. Import the SDK

TypeScript
import { createAgent, tools } from "@skillswarm/agent-sdk";

2. Define Your Agent

TypeScript
const agent = createAgent({
  name: "Research Assistant",
  systemPrompt: "You are a research assistant that searches the web and summarizes findings.",
  tools: [tools.webSearch, tools.webScrape],
});

3. Execute

TypeScript
const handler = agent.build();

const result = await handler({
  taskId: "task-123",
  userId: "user-456",
  userEmail: "user@example.com",
  data: { query: "Latest AI research papers" },
  integrations: {},
});

console.log(result.message);
console.log(result.toolCalls); // Tools that were used
console.log(result.usage);     // Token usage

Supported Models

ModelProviderBest For
gemini-3-flash-previewGoogleFast, cost-effective. Default model.
gemini-1.5-proGoogleComplex reasoning, long context
claude-sonnetAnthropicNuanced writing, safety-focused
gpt-4oOpenAIGeneral-purpose, multimodal

Deep Dive