What CriogenAI is

CriogenAI runs AI agents and workflows. You write tools, agents and steps in Python, TypeScript or Rust; a Rust engine runs them: it schedules the steps, calls the models, checks every tool argument, saves progress, and records who did what.

from criogenai import Agent, ToolError, tool


@tool
async def get_order(order_id: str) -> dict:
    """Look up an order by id."""
    if order_id != "A-1001":
        raise ToolError(f"No order {order_id}")  # the model sees this and can recover
    return {"status": "shipped", "eta": "tomorrow"}


agent = Agent(
    "openai:gpt-5-mini",  # key from OPENAI_API_KEY
    instructions="You are a support agent. Be brief.",
    tools=[get_order],
)


async def main() -> None:
    result = await agent.run("Where is order A-1001?")
    print(result.text)


asyncio.run(main())
import { Agent, ToolError, tool } from "criogenai";

const getOrder = tool({
  name: "get_order",
  description: "Look up an order by id.",
  input: {
    type: "object",
    properties: { orderId: { type: "string" } },
    required: ["orderId"],
  },
  run: async ({ orderId }) => {
    if (orderId !== "A-1001") throw new ToolError(`No order ${orderId}`); // the model sees this
    return { status: "shipped", eta: "tomorrow" };
  },
});

const agent = new Agent({
  model: "openai:gpt-5-mini", // key from OPENAI_API_KEY
  instructions: "You are a support agent. Be brief.",
  tools: [getOrder],
});

const result = await agent.run("Where is order A-1001?");
console.log(result.text);
use criogenai_agent::{Agent, ToolError, tool_fn};
use criogenai_providers::{Endpoint, ProviderModel, ToolSpec};
use serde_json::json;

let model = ProviderModel::new(
    Endpoint::openai(std::env::var("OPENAI_API_KEY")?),
    "gpt-5-mini",
)?;

let get_order = tool_fn(
    ToolSpec::new(
        "get_order",
        "Look up an order by id.",
        json!({
            "type": "object",
            "properties": {"order_id": {"type": "string"}},
            "required": ["order_id"]
        }),
    ),
    |args, _ctx| async move {
        match args["order_id"].as_str() {
            Some("A-1001") => Ok(json!({"status": "shipped", "eta": "tomorrow"})),
            other => Err(ToolError::new(format!("No order {other:?}"))),
        }
    },
);

let agent = Agent::builder(model)
    .instructions("You are a support agent. Be brief.")
    .tool(get_order)
    .build()?;

let result = agent.run("Where is order A-1001?").await?;
println!("{}", result.text().unwrap_or_default());

What it is for#

Agents that do real work, where mistakes cost something:

  • A person approves risky actions. The run pauses before a refund, an email or a prescription, waits in the database (for minutes or days), and continues from any process when someone decides.
  • Nothing is lost when a process dies. Progress is saved after every step and every tool call. retry() continues where the run stopped, and tools that already ran are not run again.
  • You can prove what happened. An audit trail records every run, model call, tool call and decision, with who did it, and no message content. A hash chain shows if a record was changed or removed.
  • Sensitive data stays protected. Conversations and memory can be encrypted in the database, deleted on a schedule, or deleted per person.
  • Any model, including your own. OpenAI, Anthropic, Gemini, OpenRouter, or self-hosted models through Ollama, vLLM or LM Studio, with fallback when one is down.

How it fits together#

PartWhat it does
AgentsA model with tools, run as a loop until it answers: tool calls run concurrently, arguments are validated, limits stop runaway loops
WorkflowsA graph of steps: branches, parallel steps, joins, loops, pauses for a person
ThreadsDurable conversations: every step saved, approvals that wait, crash recovery, history and rewind
StorageIn memory, SQLite or Postgres; long-term memory per user; encryption, audit trail, retention
Patterns and specialistsReady-made designs (pipelines, review loops, coordinators, swarms), default specialist agents you can extend, and web search tools
GatewayAn OpenAI-compatible server in front of every provider, with keys, fallback and usage records

Where to start#