> For the complete documentation index, see [llms.txt](https://tinyhumans.gitbook.io/openhuman/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tinyhumans.gitbook.io/openhuman/developing/embed/cookbook.md). Agents can also search and read this documentation through its [MCP server](https://tinyhumans.gitbook.io/openhuman/~gitbook/mcp).

# Cookbook

Executable recipes are indexed from their source headers. Each entry records the declared run mode and any named Embed feature required by the example. Full source includes the surrounding setup and assertions.

## Polling and callback approvals with cancellation

Allow and deny real parked writes, then cancel an in-flight callback without losing its pending request.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/approvals.rs) · offline with loopback stubs; no live path.

Run: `cargo run -p openhuman-embed --example approvals`

## Stable capability metadata before and after boot

Stable capability metadata before and after boot.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/capability_report.rs) · offline with loopback stubs; no live path.

Run: `cargo run -p openhuman-embed --example capability_report`

## Stateless completion without booting an agent runtime

Stateless completion without booting an agent runtime.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/completer.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL.

Run: `cargo run -p openhuman-embed --example completer`

## Run and inspect an agent cron job

Run and inspect an agent cron job.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/cron.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL.

Run: `cargo run -p openhuman-embed --example cron`

## Native custom providers, fallback and workload role pins

Inject deterministic native models and prove fallback and role selection without inference HTTP.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/custom_provider.rs) · offline; no live inference path.

Run: `cargo run -p openhuman-embed --example custom_provider`

## Runtime defaults and per-agent overrides

Runtime defaults and per-agent overrides.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/defaults_overrides.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL.

Run: `cargo run -p openhuman-embed --example defaults_overrides`

## A per-agent post-turn hook observes completed turns

A per-agent post-turn hook observes completed turns.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/hooks.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL.

Run: `cargo run -p openhuman-embed --example hooks`

## Host tools and HostOnly keep the advertised tool catalog exact

Host tools and HostOnly keep the advertised tool catalog exact.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/host_tools.rs) · offline with loopback stubs; no live path.

Run: `cargo run -p openhuman-embed --example host_tools`

## Lean runtime without background services

Lean runtime without background services.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/lean_headless.rs) · offline with loopback stubs; optional live via OPENHUMAN\_EXAMPLE\_LIVE.

Run: `cargo run -p openhuman-embed --example lean_headless`

## Linux agent fleet memory and latency

Measure retained runtime-owned agents using loopback inference and two worker threads.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/linux_fleet.rs) · offline on Linux; use a fresh constrained cgroup for release measurements. · feature: mcp,storage-sqlite

Run: `cargo run -p openhuman-embed --release --example linux_fleet --no-default-features --features mcp,storage-sqlite`

## Connect an actual MCP protocol stub over loopback

Connect an actual MCP protocol stub over loopback.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/mcp.rs) · offline with loopback stubs; no live path. · feature: mcp,storage-sqlite

Run: `cargo run -p openhuman-embed --example mcp --features mcp,storage-sqlite`

## Tenant scoped memory facade with an in-memory engine

Tenant scoped memory facade with an in-memory engine.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/memory.rs) · offline with loopback stubs; no live path.

Run: `cargo run -p openhuman-embed --example memory`

## SaaS profiles isolate conversation history

SaaS profiles isolate conversation history.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/profiles.rs) · offline with loopback stubs; no live path. · feature: channels,storage-sqlite

Run: `cargo run -p openhuman-embed --example profiles --features channels,storage-sqlite`

## Hello agent: a prompt in and a reply out

Hello agent: a prompt in and a reply out.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/run_turn.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL.

Run: `cargo run -p openhuman-embed --example run_turn`

## Runtime lifecycle events and live hook registration

Observe ordered metadata and add/remove a runtime-wide hook while agents keep running.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/runtime_events.rs) · offline with a loopback provider; no live path.

Run: `cargo run -p openhuman-embed --example runtime_events`

## Access tiers and explicit sandbox choices

Access tiers and explicit sandbox choices.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/sandbox_access.rs) · offline with loopback stubs; no live path.

Run: `cargo run -p openhuman-embed --example sandbox_access`

## Embed an agent behind a host-owned HTTP server

Embed an agent behind a host-owned HTTP server.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/server.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL.

Run: `cargo run -p openhuman-embed --example server`

## Copy a skill bundle into its agent workspace

Copy a skill bundle into its agent workspace.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/skills.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL. · feature: skills

Run: `cargo run -p openhuman-embed --example skills --features skills`

## SQLite writes and MongoDB configuration through Embed

Open a real local SQLite backend and describe a MongoDB deployment without connecting.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/storage.rs) · offline; optional live MongoDB with OPENHUMAN\_EXAMPLE\_MONGODB\_URL and storage-mongodb. · feature: storage-sqlite

Run: `cargo run -p openhuman-embed --example storage --features storage-sqlite`

## Streaming progress with a draining receiver

Streaming progress with a draining receiver.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/streaming.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL.

Run: `cargo run -p openhuman-embed --example streaming`

## Structured output parsed and checked against the request

Structured output parsed and checked against the request.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/structured_output.rs) · offline with loopback stubs; no live path.

Run: `cargo run -p openhuman-embed --example structured_output`

## Telegram channel answered by its bound agent via a local Bot API

Telegram channel answered by its bound agent via a local Bot API.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/telegram.rs) · offline with loopback stubs; no live path. · feature: channels

Run: `cargo run -p openhuman-embed --example telegram --features channels`

## Two agents with independent prompts and working folders

Two agents with independent prompts and working folders.

[Source](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/examples/two_agents.rs) · offline; optional live via OPENHUMAN\_EXAMPLE\_LIVE=1 and BASE\_URL/API\_KEY/MODEL.

Run: `cargo run -p openhuman-embed --example two_agents`
