Tool Registry & Auto-Prompt Generation
Register tools once, generate LLM-ready prompts automatically. Organize by category, search by tags, and convert to LangChain tools seamlessly.
Build powerful AI agents with TypeScript, LangGraph, and battle-tested patterns
# Create a new project
npx @agentforge/cli create my-agent
# Navigate to project
cd my-agent
# Install dependencies
pnpm install
# Run your first agent
pnpm devimport { createReActAgent } from '@agentforge/patterns';
import { ChatOpenAI } from '@langchain/openai';
import { calculator, currentDateTime } from '@agentforge/tools';
const agent = createReActAgent({
model: new ChatOpenAI({ model: 'gpt-4' }),
tools: [calculator, currentDateTime],
maxIterations: 5
});
const result = await agent.invoke({
messages: [{
role: 'user',
content: 'What is 25 multiplied by 4, and what time is it?'
}]
});
console.log(result.messages[result.messages.length - 1].content);import { ToolRegistry, toolBuilder, ToolCategory } from '@agentforge/core';
import { z } from 'zod';
// Create a registry
const registry = new ToolRegistry();
// Register tools with rich metadata
registry.register(
toolBuilder()
.name('search-web')
.description('Search the web for information')
.category(ToolCategory.WEB)
.tag('search')
.tag('internet')
.schema(z.object({ query: z.string() }))
.example('Search for TypeScript tutorials', { query: 'TypeScript tutorials' })
.implement(async ({ query }) => {
// Implementation here
return `Results for: ${query}`;
})
.build()
);
// Automatically generate LLM-ready prompts
const prompt = registry.generatePrompt({
includeExamples: true,
groupByCategory: true
});
console.log(prompt);
// Available Tools:
//
// WEB TOOLS:
// - search-web: Search the web for information
// Parameters: query (string)
// Example: Search for TypeScript tutorials
// Input: { "query": "TypeScript tutorials" }
// Use with any agent
const agent = createReActAgent({
model: new ChatOpenAI({ model: 'gpt-4' }),
tools: registry.toLangChainTools(), // Seamless conversion!
systemPrompt: prompt // Use auto-generated prompt!
});
// Mix custom tools with 69+ standard tools from @agentforge/tools
import { calculator, httpGet, fileReader } from '@agentforge/tools';
registry.registerMany([calculator, httpGet, fileReader]);
// Create specialized registries for different agents
const webScraperRegistry = new ToolRegistry();
webScraperRegistry.registerMany([httpGet, jsonParser]);
const dataAnalystRegistry = new ToolRegistry();
dataAnalystRegistry.registerMany([fileReader, calculator]);Don't reinvent the wheel. Use battle-tested agent patterns that work in production.
Register tools once with rich metadata, then automatically generate LLM prompts, query by category/tags, and convert to LangChain tools. No manual prompt engineering needed.
Interactive tutorials, API reference, and real-world examples to get you started quickly.
Full TypeScript support with Zod validation ensures your agents are reliable and maintainable.
Built-in resource management, monitoring, and deployment templates for production workloads.
MIT ยฉ 2026 Tom Van Schoor