mimir_core
Foundational crate of Mimir, an experimental pre-1.0 memory governance system for AI agents. mimir_core provides the librarian's deterministic core: a compiler-pipeline (lex → parse → bind → semantic → emit) over a Lisp-shaped agent-native IR, plus the bi-temporal append-only canonical store, plus the read-side query engine.
Pre-1.0 status. This crate is part of Mimir's active-development tree. APIs, storage details, and wire-format compatibility may change before v1. Public crates.io releases wait for the first alpha.
Install
Until the first alpha release, use a workspace or path dependency:
[]
= { = "/path/to/Mimir/crates/mimir-core" }
Quickstart
use ;
#
What's in here
- Compiler pipeline:
lex,parse,bind,semantic,pipeline::Pipeline::compile_batch— agent input → typed canonical records. - Canonical wire format:
canonical—[opcode][varint length][body]framing, 18 opcodes, fully self-describing, fuzz-target-covered. - Append-only store:
Storeover aLogBackend-abstractedCanonicalLog. Two-phase commit with crash-injection-tested rollback. - Read-side:
Pipeline::execute_queryover the in-memory current-state index; p50 ≈ 0.57 µs on a 1 M-memory warm index. - Decay: integer-fixed-point exponential decay via a hand-baked 256-entry lookup table — bit-identical across architectures.
- Workspace partitioning:
WorkspaceId=hash(git_remote_url)with an in-process.git/configparser. The current implementation keeps raw workspace memories isolated; the draft scope model adds governed promotion above this layer.
Engineering posture
#![forbid(unsafe_code)]workspace-wide.- Full test suite: unit + property + doctest + integration + crash-injection + 3 fuzz targets (live counts in
STATUS.mdfrontmatter). - 19
thiserror-derived error enums — one per subsystem. cargo deny checkgates licenses + advisories + sources on every PR.unwrap_used = "deny",expect_used = "deny",dbg_macro = "deny"workspace-wide; relaxed only inside#[cfg(test)].
Specs
The original 14 architecture specs in docs/concepts/ are all authoritative; scope-model.md is a draft mandate-expansion spec. Every load-bearing claim in this crate cites the spec section that backs it via module-level //! docs.