Skip to content

Latest commit

 

History

History
183 lines (132 loc) · 6.37 KB

README.md

File metadata and controls

183 lines (132 loc) · 6.37 KB
Inferable Logo

Inferable

Build production-ready AI Agents with Durable Execution.

NPM Version GitHub go.mod Go version NuGet Version License

What is Inferable?

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".

Inferable Deployment

👉 High-level Features

🧰 Tools

🤖 Agents

📜 Workflows

  • 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

⚡️ Quick Start

Initialize Client

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

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();

Create a Workflow

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();

Trigger the Workflow

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 Support

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

🚀 Open 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

💾 Self Hosting

Inferable is 100% open-source and self-hostable. See our self hosting guide for more details.

🤝 Contributing

We welcome contributions to all projects in the Inferable repository. Please read our contributing guidelines before submitting any pull requests.

📝 License

All code in this repository is licensed under the MIT License.