Skip to main content

Crate nexo_memory_snapshot

Crate nexo_memory_snapshot 

Source
Expand description

Atomic point-in-time agent memory snapshots.

Captures a verifiable bundle of:

  • Git-backed memory dir (memdir/) as a git bundle
  • SQLite tables produced by the memory crate: long_term, vector, concepts, compactions
  • Extractor cursor + last dream_run registry row

The bundle is a tar.zst archive sealed with a SHA-256 manifest. An optional age encryption layer is available behind the snapshot-encryption Cargo feature; the manifest itself stays plaintext so integrity can be verified without the identity.

The crate ships:

See docs/src/ops/memory-snapshot.md for the operator surface.

Re-exports§

pub use config::EncryptionSection;
pub use config::EventsSection;
pub use config::MemorySnapshotConfig;
pub use config::RetentionSection;
pub use dream_adapter::MemoryMutationPublisher;
pub use dream_adapter::PreDreamSnapshotAdapter;
pub use error::SnapshotError;
pub use events::EventPublisher;
pub use events::LifecycleEvent;
pub use events::MutationEvent;
pub use events::MutationOp;
pub use events::MutationScope;
pub use events::NoopPublisher;
pub use events::LIFECYCLE_SUBJECT_PREFIX;
pub use events::MUTATION_SUBJECT_PREFIX;
pub use id::AgentId;
pub use id::SnapshotId;
pub use manifest::ArtifactKind;
pub use manifest::ArtifactMeta;
pub use manifest::EncryptionMeta;
pub use manifest::GitMeta;
pub use manifest::Manifest;
pub use manifest::RedactionReport;
pub use manifest::SchemaVersions;
pub use manifest::ToolVersions;
pub use manifest::BUNDLE_FORMAT;
pub use manifest::MANIFEST_VERSION;
pub use meta::GitDiffSummary;
pub use meta::RestoreReport;
pub use meta::SnapshotDiff;
pub use meta::SnapshotMeta;
pub use meta::SqliteDiffSummary;
pub use meta::StateDiffSummary;
pub use meta::VerifyReport;
pub use path_resolver::ClosureResolver;
pub use path_resolver::DefaultPathResolver;
pub use path_resolver::PathResolver;
pub use redaction::DefaultRedactionPolicy;
pub use redaction::RedactionPass;
pub use redaction::RedactionPolicy;
pub use request::DecryptionIdentity;
pub use request::EncryptionKey;
pub use request::RestoreRequest;
pub use request::SnapshotRequest;
pub use retention::RetentionConfig;
pub use retention::RetentionTickReport;
pub use retention::RetentionWorker;
pub use snapshotter::MemorySnapshotter;

Modules§

codec
Bundle codec primitives: SHA-256 streaming, tar+zstd packing, optional age encryption.
config
Operator-facing YAML schema for the snapshot subsystem.
dream_adapter
Adapters that bridge nexo-driver-types traits to the snapshot subsystem.
error
Typed errors for snapshot operations.
events
Wire-shape types and a thin publisher abstraction for memory snapshot lifecycle events + memory mutation events.
git_capture
Git memdir capture + restore via libgit2.
id
Stable identifiers for snapshots and agents.
local_fs
Default backend: bundles live on the local filesystem under <state_root>/tenants/<tenant>/snapshots/<agent_id>/.
manifest
On-disk manifest schema for a snapshot bundle.
memdir
Enumerate the human-curated files inside an agent’s memdir.
meta
Operator-facing summaries returned by crate::snapshotter::MemorySnapshotter.
metrics
Prometheus metrics for snapshot operations.
path_resolver
Per-agent path discovery for the snapshotter.
redaction
Inline secret redaction over the staged bundle’s text files.
request
Inputs to crate::snapshotter::MemorySnapshotter::snapshot and crate::snapshotter::MemorySnapshotter::restore.
retention
Retention sweeper + orphan staging cleanup.
snapshotter
The main port: anything that can capture, restore, and inspect bundles.
sqlite_backup
Online SQLite backup via the engine’s native VACUUM INTO.
state_capture
Pluggable capture/restore of agent runtime state outside the memdir and the SQLite memory tables.
tenant_path
Tenant + agent id validation and bundle path resolution.