
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
@agenite/agent
Advanced tools
A simple and maintainable TypeScript library for building AI agents with tool integration capabilities.
npm install @agenite/agent
import { Agent } from '@agenite/agent';
import { OllamaProvider } from '@agenite/ollama';
// Create a simple calculator tool
const calculatorTool = new Tool({
name: 'calculator',
description: 'Perform basic math operations',
execute: async ({ input }) => {
// Tool implementation
return { success: true, data: result.toString() };
},
});
// Initialize the agent
const agent = new Agent({
name: 'math-buddy',
provider: new OllamaProvider({ model: 'llama2' }),
tools: [calculatorTool],
systemPrompt: 'You are a helpful math assistant.',
});
// Execute the agent
const result = await agent.execute({
input: 'What is 1234 * 5678?',
stream: true, // Enable streaming
});
The main class that orchestrates interactions between the LLM and tools. It handles:
Tools are functions that agents can use to perform specific tasks. Each tool has:
LLM providers that handle the actual language model interactions:
Maintain conversation history and state across multiple interactions:
const agent = new Agent({
name: 'stateful-calculator',
provider,
tools: [calculatorTool],
systemPrompt: `You are a helpful math assistant that maintains a running total.`,
});
let messages = [];
const result = await agent.execute({
input: [...messages, { role: 'user', content: query }],
stream: true,
});
messages = result.messages;
Create hierarchical agent structures where agents can delegate tasks:
// Specialist agents
const calculatorAgent = new Agent({
name: 'calculator-specialist',
provider,
tools: [calculatorTool],
});
const weatherAgent = new Agent({
name: 'weather-specialist',
provider,
tools: [weatherTool],
});
// Coordinator agent
const coordinatorAgent = new Agent({
name: 'coordinator',
provider,
tools: [
createDelegateTool('askCalculator', calculatorAgent),
createDelegateTool('askWeather', weatherAgent),
],
});
Process agent responses in real-time:
const iterator = agent.iterate({
input: 'Your query here',
stream: true,
});
for await (const chunk of iterator) {
switch (chunk.type) {
case 'streaming':
console.log(chunk.response.text);
break;
case 'toolUse':
console.log('Using tool:', chunk.tools[0]?.tool);
break;
// Handle other chunk types
}
}
new Agent({
name: string;
provider: LLMProvider;
tools?: Tool[];
systemPrompt?: string;
})
execute({
input: string | BaseMessage[];
stream?: boolean;
context?: ExecutionContext;
}): Promise<ExecutionResult>
iterate({
input: string | BaseMessage[];
stream?: boolean;
context?: ExecutionContext;
}): AsyncIterator<StreamChunk>
Check out the examples directory for more detailed examples:
basic/ - Simple examples showing core functionality
simple-chat.ts - Basic chat agent with calculator tooladvanced/ - More complex examples
nested-agents.ts - Agent composition and delegationstateful-agent.ts - Maintaining conversation statestreaming-agent.ts - Real-time response streamingmulti-tool-agent.ts - Using multiple toolsContributions are welcome! Please feel free to submit a Pull Request.
MIT
FAQs
Simple and maintainable agent library
We found that @agenite/agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.