Miscellaneous
Build production-ready AI Agents with Durable Execution.
Inferable is a platform for building production-ready AI Agents. At a high level, it allows you to:
...with minimal adoption curve
import { Inferable } from "inferable";
const inferable = new Inferable({
// Get yours at https://app.inferable.ai
apiSecret: ""
// Optional, if self-hosting (https://docs.inferable.ai/pages/self-hosting)
// baseUrl: "http://localhost:4000",
});
Register a tool which is available for your agents to use.
âšī¸ This example demonstrates Node.js. Tools can also be written in Go or .NET.
inferable.tools.register({
name: "greet",
func: async (input) => {
return `Hello, ${input.name}! My name is ${os.hostname()}.`;
},
schema: {
input: z.object({
name: z.string(),
}),
},
});
inferable.tools.listen();
Workflows are a way to orchestrate agents. They are durable, distributed, and run on the machine that they are registered on.
âšī¸ Workflow definitions can currently only be written in Node.js.
const workflow = inferable.workflows.create({
name: "greeting",
inputSchema: z.object({
executionId: z.string(),
userName: z.string(),
}),
});
workflow.version(1).define(async (ctx, input) => {
const greetingAgent = ctx.agent({
name: "greeter",
tools: ["greet"],
systemPrompt: helpers.structuredPrompt({
facts: ["You are a friendly greeter"],
goals: ["Return a greeting to the user"]
}),
resultSchema: z.object({
greeting: z.string(),
}),
});
const result = await greetingAgent.trigger({
data: {
name: input.userName,
}
});
console.log(result.result.greeting);
// ... or chain this to anther ctx.agent()
});
workflow.listen();
Tgger the workflow from your application code or via a HTTP request.
await inferable.workflows.trigger('greeting', {
executionId: `123`,
userName: "Alice",
});
curl -XPOST https://api.inferable.ai/clusters/$CLUSTER_ID/workflows/greeting/executions \
-d '{"executionId": "123", "userName": "Alice"}' \
-H "Authorization: Bearer $API_SECRET"
For more details, see our Quickstart.
Language | Source | Package |
---|---|---|
Node.js / TypeScript | Quick start | NPM |
Go | Quick start | Go |
.NET | Quick start | NuGet |
React (Chat-only) | Quick start | NPM |
Bash | Quick start | Source |
This repository contains the Inferable control-plane, as well as SDKs for various languages.
Core services:
/control-plane
- The core Inferable control plane service/app
- Playground front-end and management console/cli
- Command-line interface tool (alpha)SDKs:
/sdk-node
- Node.js/TypeScript SDK/sdk-go
- Go SDK/sdk-dotnet
- .NET SDK/sdk-react
- React SDKInferable is 100% open-source and self-hostable. See our self hosting guide for more details.
We welcome contributions to all projects in the Inferable repository. Please read our contributing guidelines before submitting any pull requests.
All code in this repository is licensed under the MIT License.