Oneiron is an open-source memory engine for AI agents, written in Rust. An agent saves memories to a local vault and recalls them in a later session. Each saved entry records where it came from. Embed Oneiron as a Rust library, or run its daemon and connect over HTTP or MCP.
Oneiron is pre-release. There is no release yet, so you build it from source. It is licensed under Apache-2.0.
Oneironは、AIエージェント向けのRust製オープンソース・メモリエンジンです。エージェントは記憶をローカルに保存し、別のセッションで取り出せます。保存した記憶には、情報の出どころが記録されます。現在はリリース前で、ビルド済みのバイナリもまだ公開していないため、ソースからビルドして使います。テスト環境では、ビルドに2時間以上かかり、メモリを最大で約37 GiB使いました。下のクイックスタートは、x86-64のLinuxで動作を確認しています。
Agent setup · Status and contributing · Storage layout · HTTP API
The quickstart script creates a local vault with authentication on and mints a credential for one agent. Over HTTP, the agent writes an entry to its private diary and reads it back, then saves a research note and recalls it. The script checks that MCP initializes, writes a client configuration for Claude Code, Codex or OpenCode, and prints its path. It uses no model and no external API key.
It needs Linux on x86-64, a built oneiron binary, Python 3.11 or newer and curl
7.76 or newer.
No prebuilt binary is published yet, so you build one from source. The build needs Git, rustup, a C/C++ compiler, CMake and pkg-config. The prerequisites name the Debian and Ubuntu packages.
git clone https://github.com/oneiron-dev/oneiron.git
cd oneiron
CARGO_BUILD_JOBS=1 cargo install --locked --path crates/oneiron-server --bin oneironOn our Linux x86-64 test host, in a job limited to 40 GiB of memory, this build took about 2 h 7 min and peaked at about 37.2 GiB. It reused part of the work of two earlier parallel attempts, with 16 and 4 jobs, which reached the 40 GiB limit and were stopped. We have not finished a build with less memory.
Cargo installs the binary as $HOME/.cargo/bin/oneiron by default. Run the
quickstart with it:
python3 examples/agent-quickstart/quickstart.py --binary "$HOME/.cargo/bin/oneiron" --keep-runningWith an existing binary, the run took about two seconds on the test host.
--keep-running leaves the vault running and prints the command that stops it.
On macOS, the script needs a signed oneiron binary with a keychain access group. A
plain Cargo build cannot mint the agent credential there. No signed macOS build has
been tested.
Setup and repair shows how to add the vault to a client. The complete example lists every option.
Last checked 2026-11-24: this script with a binary built from 01222999f56, on an
Arch Linux x86-64 host.
The open pull requests are our own work in progress, merged into main in batches after
we check them on our own machines while GitHub CI is paused. To report a bug or propose a
change, open an issue; CONTRIBUTING.md says what to include.
Agents need useful memory across sessions, not just a longer prompt. They also need to know where a memory came from and which changes are allowed. Oneiron brings storage, retrieval, provenance, and write policy into one engine that applications can embed or run as a daemon.
- Local storage. Each vault uses one LMDB environment.
BatchBuildercan write entities, indexes, and edges in one atomic transaction. - Hybrid retrieval. Vector and BM25F text search, graph expansion, time filters, and phonetic matching share a query pipeline. It ranks their candidate union with configurable memory metadata.
- Typed memory and guarded writes. Claims carry provenance and lifecycle state. Actor-write APIs check configured policy and consent before admitting claim changes. Policy decisions and scoped reads expose receipts.
- A server and replication layer.
oneiron-serverexposes HTTP and WebSocket interfaces, including MCP over HTTP. The optionalsyncfeature adds Loro-based replication. - Host-bound agent components. Dreamer consolidation, durable work, typed judgments, and optional JavaScript code execution have Rust implementations. Hosts supply the required inference, scheduling, policy, and budget bindings. Standard daemon startup does not bind a Dreamer model or code executor.
- Models behind one seam. Generative models plug in through the
LlmBackendtrait. Adapter crates cover a local in-process runtime, OpenAI-compatible and Anthropic Messages APIs, Gemini, and a self-hosted model server. Typed decisions use a separate seat,RemoteDecisionSeat; the System One adapter implements it. The host loads the model or holds the credentials; no adapter bundles model weights. Standard daemon startup binds no generative model. - Optional embedding backends. The daemon can run with no embedder, provision a local embedder, or use a configured endpoint.
- Owner actions. The CLI covers where the vault lives (
doctor), backups, restore rehearsal, restore, export, the secret-scan switch, and one-act approval of an import batch or an agent run. A running server offers the same actions under/v1/owner, except two: restore is CLI-only, and export isPOST /v1/core/facade/vault.export. None of them needs a model. See docs/ops/owner-actions.md. - Agents over MCP.
oneiron mcpconnects Claude Code and Codex to a running vault over stdio, with a scoped, revocable agent credential fromoneiron token agent. See docs/ops/connect-an-agent.md.
These are implemented APIs and components. Oneiron is pre-release.
This stores and reads a byte payload. It needs no model, embedding, or network service. It is a low-level storage example, not a typed claim or a retrieval query.
use oneiron::registry::ENTITY_TYPE_SUMMARY;
use oneiron::{EntityId, TimeRange, Vault, VaultConfig};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let vault = Vault::open("./my-vault", VaultConfig::device())?;
let id = EntityId::now();
let payload = b"Hello, Oneiron!";
let timestamp = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)?
.as_secs();
vault.put_entity(
&id,
ENTITY_TYPE_SUMMARY,
TimeRange {
start: timestamp,
end: timestamp,
},
timestamp,
payload,
)?;
assert_eq!(vault.get(&id)?.as_deref(), Some(payload.as_slice()));
println!("Stored and read entity {}", id.to_ulid());
Ok(())
}Vault::open can create a vault. On Linux, Vault::open_existing opens only an
initialized vault and never creates one.
This is the build from the agent quickstart, which gives its measured time and memory. Run it from the repository root:
CARGO_BUILD_JOBS=1 cargo install --locked --path crates/oneiron-server --bin oneironCargo uses the Rust toolchain pinned in rust-toolchain.toml
and installs oneiron in its bin directory. Without --bin oneiron, the
package also installs its companion binaries. Oneiron is pre-release and is not
published on crates.io, so install from a checkout. For the exact noninteractive init, agent
credential, serve and first-memory calls, see agent setup.
See DEPLOYMENT.md for service templates.
The SDK's generated Rust files are not committed: the crates that include them (oneiron, oneiron-server,
oneiron-remote, oneiron-napi, oneiron-uniffi, oneiron-code-check, oneiron-py, oneiron-verb-wire) run
the SDK generator (crates/oneiron-sdk-generator) inside their build scripts, once per change of the verb table
(scripts/sdk/verbs/), the Rust types it names or the generator itself, into the target directory. No Python
runs for this. The run key covers the generator's source, Cargo.lock, the manifests and the compiler. It does
not see a local override of the generator's dependencies ([patch] to a path, paths in .cargo/config, or
--config). After changing one, delete target/<profile>/sdk-generated.
An incremental build reruns those build scripts only when a file the last run depended on changes: a verb file,
type_names.json, a hand-written input, a crate source file that defined an item the generator resolved, or a
module file it walked (the run directory's .sdk-deps lists them), and Cargo.lock or the manifests. A body edit in
any other crate file reruns nothing. The limit: a new file, or a new same-named item in a file the generator did not
resolve from, is not seen by an incremental build until a watched file changes; delete
target//sdk-generated to force. A clean build always regenerates, and the merge train regenerates the SDK
outputs on every train top (TRAIN-REGEN).
The SDK packages make their generated files in their own builds: bun run build in packages/oneiron and
bun run prepare in packages/oneiron-client (each runs the generator with cargo run), and maturin build
for oneiron-py. The agent-SDK reference generated from the verb table (types.md, facade-types.md,
verbs.md) is published from main at https://oneiron-dev.github.io/oneiron/agent-sdk/, and every cargo build
keeps a local copy in target/debug/sdk-generated/agent-sdk/ (target/release/... for a release build).
Debug information is adjustable (details in build performance):
- Default: dev and test builds use
debug = "line-tables-only", so backtraces and panics still show file and line. - Perf work:
RUSTFLAGS="-C force-frame-pointers=yes" cargo build --profile profilingbuilds release code with full debug information and no LTO intotarget/profiling. - One run with full debug information:
CARGO_PROFILE_DEV_DEBUG=full cargo test ..., orcargo test --config 'profile.dev.debug="full"' ....
The web console and its desktop shell live in apps/web:
a TanStack Start console and workbench, and a Tauri desktop shell. The console
uses fixtures and does not connect to the engine.
Run its Bun commands from apps/web. Its Tauri package keeps its own Cargo
workspace and lockfile, separate from the engine workspace and the existing
macOS menu-bar app. See the frontend README for its setup
and current runtime boundaries.
This table lists selected crates, not the whole workspace. The
code map has a row for each engine crate under crates/ and links
to its modules and source files. It does not cover the applications under apps/.
| Crate | Role |
|---|---|
| oneiron | Local vault, retrieval, typed memory, and write policy. |
| oneiron-server | HTTP and WebSocket daemon around the vault. |
| oneiron-driver | In-process agent runtime driver. |
| oneiron-ffi | C interface to the engine. |
| oneiron-napi | Native Node.js bindings. |
| oneiron-py | Native Python extension. |
| oneiron-remote | Shared embedded and remote SDK backend. |
| oneiron-uniffi | UniFFI binding of the SDK verb table over the shared OneironClient (embedded and remote). |
| oneiron-android | JNI/Kotlin ownership adapter. |
| oneiron-llm | Text model wire adapters, one module per protocol: OpenAI-compatible (with its embeddings and the media client every family shares), Anthropic Messages, Gemini, the user-hosted model endpoint (oneiron_rpc), a host-supplied in-process model (local) and the remote typed-decision service (systemone). |
| oneiron-gen | Generation job wire adapters, one module per protocol: Gemini images and Veo video (gemini), OpenAI-compatible images and video jobs (openai_compat), the self-hosted ComfyUI image server (comfyui) and the OpenRouter Image API (openrouter). |
| oneiron-speech | Speech wire adapters, one module per protocol: the Soniox streaming ASR frame codec (asr::soniox), the Irodori and MOSS-local TTS submission adapters (tts::irodori_moss), the Cartesia and ElevenLabs speech and clone codecs (tts::hosted, design::hosted), the VoxCPM2 worker's render framing (tts::voxcpm2) and OpenAI-compatible speech and transcription (tts::openai_compat, asr::openai_compat). |
| oneiron-mesh-transport | Vault-scoped peer transport. |
| oneiron-linear | Linear issue-mirroring adapter. |
| oneiron-docedit | Native document editing and revision support. |
| oneiron-xlsx-formula | In-process spreadsheet formula recalculation. |
| oneiron-seal | PDF signature sealing and verification. |
| oneiron-guest | Linux sandbox guest agent and conformance adapter. |
| oneiron-sandbox-contract | Shared host/guest sandbox protocol rules. |
| oneiron-vault-contract | Supervisor-to-vault process protocol and limits. |
| oneiron-vm-outbox | A vault VM's root outbox companion binary. |
| oneiron-bench | Benchmark and evaluation harness. |
| oneiron-macos | macOS menu-bar voice recorder embedding the vault. |
This diagram matches the vault's named-database manifest. It shows storage components, not which optional runtime features are enabled.
The merge bar is cargo check --workspace --all-features on the head.
AGENTS.md covers the build rules and PRs.
Tests use cargo-nextest. The default profile skips the slow set; the full profile includes it.
cargo nextest run --locked -p oneiron --all-features
cargo nextest run --locked -p oneiron --features sync,test-hooks --profile fullThe second command runs the sync build with the slow set included.
Some integration tests reach crate-private items through oneiron::test_doors,
which builds only under --cfg oneiron_test_support (never a cargo feature):
RUSTFLAGS="--cfg oneiron_test_support" cargo test --locked -p oneiron --all-features --test <file>- oneiron.skills.md: HTTP API reference.
- docs/ops/owner-actions.md: backup, restore, export, and owner approvals.
- UPGRADING.md: authentication and text-index upgrade notes.