Skip to content

Infer

Infer

Inference turns a prompt into a single structured output — one model call, or a short chain of calls. It is the narrow capability narrow capability: no loop, no tools, no state. When work needs multi-step reasoning and tool use, that is an agent, not an inference.

One-shot inference

A single model call that returns one structured output — classify a record, extract fields from a document, or summarize a row.

Multi-step inference

A short, fixed chain of calls where each step feeds the next — still one structured output at the end. The chain is authored, not decided by the model.

Structured output

The result is validated against a Effect Schema schema, so callers get typed data — never freeform text they must parse.

Inference in action

One call in, one structured value out — a schema-checked result, ready to type:

import { Schema } from 'effect';
import { defineQueryHandler } from '@norbital-ai/bolt/authoring';

const ReviewOutcome = Schema.Struct({
  approved: Schema.Boolean,
  reason: Schema.String,
  suggested_priority: Schema.Literals('low', 'medium', 'high')
});

export default defineQueryHandler({
  description: 'Reviews one purchase request.',
  schema: Schema.Struct({ request_id: Schema.String }),
  handler: ({ request_id }, api) =>
    Effect.gen(function* () {
      // One call in, one structured value out — validated, typed, never freeform
      return yield* api.infer({
        schema: ReviewOutcome,
        prompt: 'Review this purchase request.'
      });
    })
});

The ai facility port

Model access flows through the ai facility port: Bolt defines the contract, the host binds the concrete provider at runtime, and tenant code never sees credentials. See Facilities for the full port list.

Sessions are data

Each conversation is one tenant-owned aggregate: chat_session — its ordered messages, nested turns, title, status and usage sync atomically like any other collection.

Infer vs Agent

Infer is one prompt in, one structured output out. Agents are agentic workloads: a loop that reasons across many steps, calls tools, reads and writes collections, and can draft source. Agents use inference under the hood — but they are a different surface to author and a different runtime to run.