๐ค Build powerful AI agents with TypeScript. Agenite makes it easy to create, compose, and control AI agents with first-class support for tools, streaming, and multi-agent architectures. Switch seamlessly between providers like OpenAI, Anthropic, AWS Bedrock, and Ollama.
A modern, modular, and type-safe framework for building AI agents using typescript
Agenite is a powerful TypeScript framework designed for building sophisticated AI agents. It provides a modular, type-safe, and flexible architecture that makes it easy to create, compose, and control AI agents with advanced capabilities.
Type safety and developer experience
Tool integration
Provider agnostic
Advanced architecture
Model context protocol (MCP)
Package | Description | Installation |
---|---|---|
Core packages | ||
@agenite/agent | Core agent orchestration framework for managing LLM interactions, tool execution, and state management | npm install @agenite/agent |
@agenite/tool | Tool definition framework with type safety, schema validation, and error handling | npm install @agenite/tool |
@agenite/llm | Base provider interface layer that enables abstraction across different LLM providers | npm install @agenite/llm |
Provider packages | ||
@agenite/openai | Integration with OpenAI's API for GPT models with function calling support | npm install @agenite/openai |
@agenite/anthropic | Integration with Anthropic's API for Claude models | npm install @agenite/anthropic |
@agenite/bedrock | AWS Bedrock integration supporting Claude and other models | npm install @agenite/bedrock |
@agenite/ollama | Integration with Ollama for running models locally | npm install @agenite/ollama |
MCP package | ||
@agenite/mcp | Model Context Protocol client for connecting to standardized data sources and tools | npm install @agenite/mcp |
Middleware packages | ||
@agenite/pretty-logger | Colorful console logging middleware for debugging agent execution | npm install @agenite/pretty-logger |
For a typical setup, you'll need the core packages and at least one provider:
# Install core packages
npm install @agenite/agent @agenite/tool @agenite/llm
# Install your preferred provider
npm install @agenite/openai
# OR
npm install @agenite/bedrock
import { Agent } from '@agenite/agent';
import { Tool } from '@agenite/tool';
import { BedrockProvider } from '@agenite/bedrock';
import { prettyLogger } from '@agenite/pretty-logger';
// Create a calculator tool
const calculatorTool = new Tool<{ expression: string }>({
name: 'calculator',
description: 'Perform basic math operations',
inputSchema: {
type: 'object',
properties: {
expression: { type: 'string' },
},
required: ['expression'],
},
execute: async ({ input }) => {
try {
const result = new Function('return ' + input.expression)();
return { isError: false, data: result.toString() };
} catch (error) {
if (error instanceof Error) {
return { isError: true, data: error.message };
}
return { isError: true, data: 'Unknown error' };
}
},
});
// Create an agent
const agent = new Agent({
name: 'math-buddy',
provider: new BedrockProvider({
model: 'anthropic.claude-3-5-sonnet-20240620-v1:0',
}),
tools: [calculatorTool],
instructions: 'You are a helpful math assistant.',
middlewares: [prettyLogger()],
});
// Example usage
const result = await agent.execute({
messages: [
{
role: 'user',
content: [{ type: 'text', text: 'What is 1234 * 5678?' }],
},
],
});
Agents are the central building blocks in Agenite. An agent:
Tools extend agent capabilities by providing specific functionalities:
Currently supported LLM providers:
MCP is a standardized protocol for connecting LLMs to data sources:
// Create specialist agents
const calculatorAgent = new Agent({
name: 'calculator-specialist',
provider,
tools: [calculatorTool],
description: 'Specializes in mathematical calculations',
});
const weatherAgent = new Agent({
name: 'weather-specialist',
provider,
tools: [weatherTool],
description: 'Provides weather information',
});
// Create a coordinator agent
const coordinatorAgent = new Agent({
name: 'coordinator',
provider,
agents: [calculatorAgent, weatherAgent],
instructions: 'Coordinate between specialist agents to solve complex problems.',
});
// Create an iterator for fine-grained control
const iterator = agent.iterate({
messages: [{ role: 'user', content: [{ type: 'text', text: 'Calculate 25 divided by 5, then multiply by 3' }] }],
stream: true,
});
// Process the stream with custom handling
for await (const chunk of iterator) {
switch (chunk.type) {
case 'agenite.llm-call.streaming':
console.log(chunk.content);
break;
case 'agenite.tool-call.params':
console.log('Using tool:', chunk.toolUseBlocks);
break;
case 'agenite.tool-result':
console.log('Tool result:', chunk.result);
break;
}
}
For comprehensive documentation, visit docs.agenite.com:
git clone https://github.com/subeshb1/agenite.git
cd agenite
pnpm install
pnpm build
MIT
No configuration available
Related projects feature coming soon
Will recommend related projects based on sub-categories