import { createLemonAgent, lemonTool, z }
const agent = await createLemonAgent({
model: 'gpt-4o-mini',
tools: [lemonTool({ name: 'search_docs', ... })],
});LemonGrove
orchestrator
research_agent
Research tasks
writer_agent
Writing tasks
Waiting for grove.run()…Why Lemon AI Agent
Register specialist agents as tools; LemonGrove delegates—no graph editor or engine lock-in.
Built for Next.js routes, Express handlers, and background jobs on your server.
One npm install—compiled artifact in node_modules, not a sprawling source tree.
OpenAI, Anthropic, and Gemini adapters included—your keys, your endpoints.
What you get
Automatic tool rounds with optional step tracing.
Child agents exposed as tools; orchestrator synthesizes the final answer.
Token, tool-start, tool-end, and done chunks for live UIs and SSE.
Zod-validated final JSON via built-in formatting tool.
Secondary model if the primary call fails.
Approve irreversible tools before they run with humanGate.
Quick start
npm install lemon-ai-agent
import { createLemonAgent, lemonTool, z } from 'lemon-ai-agent';
const agent = await createLemonAgent({
model: 'gpt-4o-mini',
tools: [
lemonTool({
name: 'search_docs',
description: 'Search internal documentation',
schema: z.object({ query: z.string() }),
run: async ({ query }) => `Results for: ${query}`,
}),
],
});
const result = await agent.invoke({
input: 'Summarize what changed in our last release',
});
console.log(result.output);Ask about access, fit, or how it works with your setup.