@rutvikmakvana/agentkit-node
v1.0.0
Published
Turn any function in your Node.js backend into a callable AI tool. The official AgentKit SDK.
Maintainers
Readme
AgentKit Node SDK
The official Node.js SDK for AgentKit.
AgentKit lets you expose your existing backend functions as AI-callable tools without rewriting your application or exposing public endpoints.
Features
- 🚀 Register existing backend functions as AI tools
- 🔒 Outbound-only WebSocket connection (no public endpoints required)
- 📦 TypeScript-first
- ✅ Supports Zod and JSON Schema
- ⚡ Automatic reconnection
- ❤️ Works with Express, NestJS, Fastify and any Node.js server
Installation
npm install @rutvikmakvana/agentkit-nodeQuick Start
import { agentkit } from "@rutvikmakvana/agentkit-node";
import { z } from "zod";
agentkit.init({
projectKey: process.env.AGENTKIT_PROJECT_KEY!,
});
agentkit.tool({
name: "getOrder",
description: "Get order details by ID",
input: z.object({
orderId: z.string(),
}),
handler: async ({ orderId }) => {
return orderService.getOrder(orderId);
},
});
agentkit.connect();API
Initialize
agentkit.init({
projectKey: "...",
});Register Tool
agentkit.tool({
name,
description,
input,
handler,
});Connect
agentkit.connect();Disconnect
agentkit.disconnect();Supported Schemas
Zod
input: z.object({
id: z.string(),
});JSON Schema
input: {
type: "object",
properties: {
id: {
type: "string"
}
}
}Events
agentkit.on("connected", ...);
agentkit.on("disconnected", ...);
agentkit.on("toolCalled", ...);
agentkit.on("error", ...);Supported Frameworks
- Express
- NestJS
- Fastify
- Hono
- Koa
- Any Node.js HTTP server
How AgentKit Works
Your Backend
│
│
agentkit.connect()
│
▼
Outbound WebSocket
│
▼
AgentKit Cloud
│
▼
LLM invokes your tool
│
▼
Your existing function executes
│
▼
Response returned to the AINo public API endpoints.
No ngrok.
No inbound ports.
Works locally and in production.
Requirements
- Node.js 18+
- TypeScript 5+
License
MIT
