What is Inferable?

Inferable is a developer platform that allows you to build secure, agentic workflows from your existing code via Functions or Rest / GraphQL APIs.

How It Works

Imagine you have a set of internal services that power your product.

You can use Inferable to leverage these to create multi-step, LLM-driven workflows.

1

Functions are wrapped using the Inferable SDK

Functions within your code are wrapped using one of the Inferable SDKs.

This provides Inferable with context about the functions and registers them as message queue consumers for use in Runs.

import { Inferable } from "inferable";
import { z } from "zod";

// Initialize the Inferable client with your API secret.
// Get yours at https://app.inferable.ai.
export const i = new Inferable({
  apiSecret: "YOUR_API_SECRET",
});

// Define a function to submit a support ticket
const submitTicket = async (input: {
  userName: string;
  userEmail: string;
  issue: string;
}) => {
  console.log("Submitting support ticket", input);
  // Add logic to submit the ticket
  return `Ticket submitted for ${input.userName}`;
};

// Register the service (using the 'default' service)
const submitTicketFunc = i.default.register({
  name: "submitTicket",
  description: "Submit a support ticket",
  func: submitTicket,
  schema: {
    input: z.object({
      userName: z.string(),
      userEmail: z.string(),
      issue: z.string(),
    }),
  },
});

// Start the 'default' service
i.default.start();

Inferable functions handlers are just functions that run within your application.

We also provide a Proxy pattern which generates functions which call existing REST / GraphQL APIs.

2

Create a Run with a prompt and optional structured output

Runs can be triggered via prompt using the Inferable Web UI, CLI or API.

Issue the prompt with the Inferable web application.

3

Inferable control plane orchestrates execution of your functions

When a Run occurs, the Inferable Control Plane uses LLMs to perfom the request using the available functions.

  • Runs are “agentic”. Multiple steps can be performed in order to complete the request, evaluating the results and repeating as necessary.
  • The decision making process is orchestrated by the .
  • The control plane will make a plan, and run an evaluation loop recursively until the objective is met.
  • All the functions run on your infrastructure, and are not exposed via HTTP due to the long polling nature of the SDK.
4

Get a structured output back

A Run can be provided a ensuring that the result conforms to your desired schema from Step 2.

A run may take some time to complete, and the output will be returned as a JSON object with a result field and a status field. See the Run API for more details.

If the run completes successfully, Inferable provides a guarantee that either:

  1. The output conforms to the provided schema.
  2. The output is null.
{
  "id": "run_123456789",
  "jobHandle": "job_987654321",
  "userId": "user_abcdef123",
  "status": "done",
  "failureReason": null,
  "test": false,
  "feedbackComment": "Great job! The ticket was submitted quickly.",
  "feedbackScore": 5,
  "result": "{\"ticketId\": \"TKT-001\", \"message\": \"Support ticket submitted successfully for John Doe\"}",
  "summary": "A support ticket was successfully created for user John Doe regarding a login issue.",
  "metadata": {
    "createdAt": "2023-04-15T14:30:00Z",
    "completedAt": "2023-04-15T14:30:05Z"
  },
  "attachedFunctions": [
    "submitTicket"
  ]
}

Learn More