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-sdkPackage 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 runtimeExports
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 usageSupported Models
| Model | Provider | Best For |
|---|---|---|
| gemini-3-flash-preview | Fast, cost-effective. Default model. | |
| gemini-1.5-pro | Complex reasoning, long context | |
| claude-sonnet | Anthropic | Nuanced writing, safety-focused |
| gpt-4o | OpenAI | General-purpose, multimodal |
Deep Dive
- AgentBuilder Class — Constructor, methods, and build pipeline
- Configuration Reference — All AgentConfig properties
- Event Handlers — onMessage, execution context, and lifecycle
- Tools Reference — All 17 built-in tools with parameters