Appearance
Embed adam in your own program ​
adam-rs is a library first (ADR 0001): a host binary composes crates, and the shipped adam-agent and adam-coder are two such compositions. If you only need to serve an agent made of files, do not embed: Write an agent. This page is about a server program; for adam inside an application, with no server at all (a desktop or a phone), read Embed adam in an application.
The generated API of every library crate is on the site: Rust API.
Pick a level ​
| You want | Depend on | Entry point |
|---|---|---|
| a folder's agent inside your process | adam-agent (also a library, publish = false) and adam-service | adam_agent::agents(def, card, workers) then adam_service::serve(&ServiceConfig, agents, shutdown) (adam-agent README) |
| your own agent with Rust tools | the adam facade | use adam::prelude::*: #[tool], tools!, LlmAgent; adam::include_agent!(); features macros and remote (default), a2a, mcp, dev (adam README) |
| only the process plumbing | adam-host | Role and Host: register components with .control_plane(name, f) and .worker(name, f); Host::run(shutdown) starts what the role runs and stops the control plane before the workers (README) |
| adam inside an application, with no server and nothing on the network of its own (a desktop or a phone) | adam-engine | Engine::builder(store, agent, model, alias).start().await?, then send, steer, answer, cancel, list, get, events and shutdown, with no A2A type in a signature (ADR 0047 slice 4; the SQLite store is still to come): the host gives the store, the model, the model profiles (and the root's reasoning level) and the secrets (Embed adam in an application). Turn off adam-a2a's server, adam-a2a-runtime's push, adam-assembly's remote (adam's too) and adam-ui's thread-tools on anything else you depend on, or Cargo turns them back on (README) |
| a different database | implement Store | Store adapters |
Steps ​
Pin by full commit. The crates are git dependencies on one 40-hex sha, never a branch or tag, all bumped together (two revs mean two copies of the same traits, with errors that name types that look equal).
tomladam-host = { git = "https://github.com/vymalo/another-adam-rs", rev = "<40-hex sha>", default-features = false, features = ["supervisor"] } adam-runtime = { git = "https://github.com/vymalo/another-adam-rs", rev = "<same sha>" }TLS is built in.
adam-store-postgresandadam-notify-postgresuserustlsonaws-lc-rs; theDATABASE_URLchooses the mode (sslmode,sslrootcert,sslcert,sslkey). There are no TLS Cargo features any more (sqlxleft with ADR 0053): a consumer that settls-rustlsortls-native-tlsremoves the line.Configuration is the host's.
adam-hostnever reads the environment. Withadam-servicethe variables are those of Environment; a host of your own owns its names.Map a failed
serveto an exit code withadam_service::exit_code(78 configuration, 69 dependency down, 71 OS, 70 internal), so a supervisor can tell restartable from not.Leave
devandmcpoff unless you need them: a release build must not watch files or start MCP processes unless it opts in.
Pitfalls ​
Roleis a closed enum: a new role at a later rev is a compile error in yourmatch, on purpose (runs_control_plane()andruns_workers()avoid it). So arePlacementandClaimScope.- A required trait method added at a later rev breaks implementers; the
adam-upgradeskill walks through a bump. - A tool is a plain
async fnas well: unit-test it by calling it. Tools must be safe to repeat.
A worked consumer is vymalo/another-agentic-system: its crate orchestrator/crates/agent-adam hosts adam agents in the orchestrator's process behind the off-by-default feature agent-local.
For an AI assistant doing this, use the adam-embed skill (npx skills add vymalo/another-adam-rs --skill adam-embed).