Inferable is a platform for building production-ready AI Agents. At a high level, it allows you to:
- Register Tools from your new or existing distributed systems.
- Define Agents that can use these tools to perform multi-step reasoning and take actions.
- Create Durable Workflows that compose agent intractions with "workflow as code".
- Wrap your existing code as tools, and let agents trigger them with our SDKs.
- Tools run on your own infrastructure, Inferable takes care of the orchestration.
- Built-in retry, caching, and failover support for tools.
- Multi-step reasoning agents who can iteratively design their own execution plan.
- Context-aware tool selection and built-in Service Discovery for tools.
- Composable agents with structured outputs.
- Define "workflow as code" to orchestrate agents and tools.
- Mix agent reasoning with deterministic code execution to build complex workflows.
- All workflows are durable, and run on your own infrastructure.
...with minimal adoption curve
- No network ingress needed. Everything works via long-polling HTTP endpoints.
- Trigger workflows from external events, or from other workflows. It's just HTTP.
- Fully open-source and self-hostable.
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 SDK
Inferable 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.