Introducing CriogenAI: an open-source AI agent framework built on Rust
CriogenAI (also written Criogen AI) is an open-source AI agent framework. A Rust engine runs your agents and workflows; you write them in Python, TypeScript or Rust. It is free to use, also commercially, under MIT or Apache-2.0.
pip install criogenai
npm install criogenaiWatch the 50-second introduction on the home page.
Why another agent framework#
Agents in production need more than a prompt loop. They crash halfway through a task. They call tools that move money or change records. In regulated work, every step has to be accounted for. Most frameworks leave those problems to you. CriogenAI puts them in the runtime:
- Fast. The engine is Rust. In our benchmark, an agent turn costs 0.29 ms of framework overhead, about 4× less than LangGraph, and 1,000 concurrent agent runs finish in 0.33 s, 8.6× faster.
- Reliable. Every step is saved. Kill the process mid-run, retry, and the run resumes from the last saved step. A tool that already ran is not run again: a charged card is charged once.
- Human in the loop. Mark the sensitive tools. The run stops before them and waits, in the database, until a person approves, edits or rejects the call. See human approval.
- Built in. Memory with keyword and semantic search, MCP tools, evals, tracing, multi-agent workflows, encryption at rest and a tamper-evident audit trail.
- Any model. OpenAI, Anthropic, Gemini, Azure OpenAI, Amazon Bedrock, Google Vertex AI, OpenRouter and more, or your own servers with Ollama or vLLM.
One engine, three languages#
The Python and TypeScript packages are thin layers over the same Rust engine, so an agent behaves the same in every language: the same scheduling, the same validation, the same error codes.
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());Where to start#
- Quickstart: your first agent in a few minutes.
- Benchmarks: the numbers, the method and a kit to rerun them.
- Pattern playground: 19 agent patterns running in your browser.
- Docs: guides for agents, tools, approvals, threads, memory and workflows.
CriogenAI is at version 0.1 and moving fast. The Windows packages of 0.1.7 are on PyPI and npm; the Linux and macOS packages follow.