01Install
Install the core package with your package manager.
pnpm add @lov3kaizen/agentsea-core
# Optional: the CLI, installed globally
pnpm add -g @lov3kaizen/agentsea-cli
# Optional: the NestJS integration
pnpm add @lov3kaizen/agentsea-nestjs02Agent with Claude
Set ANTHROPIC_API_KEY first. AnthropicProvider reads it when no key is passed.
import { Agent, AnthropicProvider, ToolRegistry } from '@lov3kaizen/agentsea-core';
const agent = new Agent(
{
name: 'assistant',
description: 'General assistant',
model: 'claude-opus-4-8',
provider: 'anthropic',
systemPrompt: 'You are a helpful assistant.',
},
new AnthropicProvider(process.env.ANTHROPIC_API_KEY),
new ToolRegistry(),
);
const response = await agent.execute('Hello!', {
conversationId: 'user-123',
sessionData: {},
history: [],
});
console.log(response.content);03Local agent with Ollama
Run the model on your own machine. No API key is needed. Start the Ollama server, then pull the model.
ollama serve
ollama pull llama2import { Agent, OllamaProvider, ToolRegistry } from '@lov3kaizen/agentsea-core';
const provider = new OllamaProvider({ baseUrl: 'http://localhost:11434' });
// Optional: pull the model from code. Ollama must be running.
await provider.pullModel('llama2');
const agent = new Agent(
{
name: 'local-assistant',
description: 'Local assistant',
model: 'llama2',
provider: 'ollama',
systemPrompt: 'You are a helpful assistant.',
},
provider,
new ToolRegistry(),
);
const response = await agent.execute('What is 2+2?', {
conversationId: 'conv-1',
sessionData: {},
history: [],
});
console.log(response.content);The local models guide covers other local servers.
04Add a tool
Register a tool in a ToolRegistry, then list it in the agent config so the model knows it exists.
import { Agent, AnthropicProvider, ToolRegistry, calculatorTool } from '@lov3kaizen/agentsea-core';
const tools = new ToolRegistry();
tools.register(calculatorTool);
const agent = new Agent(
{
name: 'math',
description: 'Arithmetic helper',
model: 'claude-opus-4-8',
provider: 'anthropic',
tools: [calculatorTool],
},
new AnthropicProvider(process.env.ANTHROPIC_API_KEY),
tools,
);
const response = await agent.execute('What is 42 * 58?', {
conversationId: 'math-1',
sessionData: {},
history: [],
});05Connect an MCP server
An MCPRegistry starts an MCP server and exposes its tools. Register them in the ToolRegistry like any other tool.
import { Agent, AnthropicProvider, ToolRegistry, MCPRegistry } from '@lov3kaizen/agentsea-core';
const mcpRegistry = new MCPRegistry();
await mcpRegistry.addServer({
name: 'filesystem',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'],
});
const toolRegistry = new ToolRegistry();
toolRegistry.registerMany(mcpRegistry.getTools());
const agent = new Agent(
{ name: 'files', description: 'Filesystem assistant', model: 'claude-opus-4-8', provider: 'anthropic' },
new AnthropicProvider(process.env.ANTHROPIC_API_KEY),
toolRegistry,
);
const response = await agent.execute('List the files in /tmp', {
conversationId: 'files-1',
sessionData: {},
history: [],
});The MCP guide covers transports and server setup.
06Sequential workflow
A sequential workflow runs agents one after another. Each agent takes a full AgentConfig, so it needs a name, description, model and provider.
import { WorkflowFactory, AnthropicProvider, ToolRegistry } from '@lov3kaizen/agentsea-core';
const workflow = WorkflowFactory.create(
{
name: 'research-workflow',
type: 'sequential',
agents: [
{ name: 'researcher', description: 'Gathers facts', model: 'claude-opus-4-8', provider: 'anthropic', systemPrompt: 'Research information.' },
{ name: 'writer', description: 'Writes the summary', model: 'claude-opus-4-8', provider: 'anthropic', systemPrompt: 'Write a summary.' },
],
},
new AnthropicProvider(process.env.ANTHROPIC_API_KEY),
new ToolRegistry(),
);
const result = await workflow.execute('Research AI agents', {
conversationId: 'research-1',
sessionData: {},
history: [],
});07Next steps
- Agents: configuration options for agents.
- Tools: built-in and custom tools.
- Workflows: orchestrating several agents.
- Examples: complete, runnable examples for every feature.
Note
sea code.