skg-state-memory 0.4.0

In-memory StateStore implementation for skelegent
docs.rs failed to build skg-state-memory-0.4.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: skg-state-memory-0.4.1

skg-state-memory

In-memory StateStore implementation for skelegent

crates.io docs.rs license

Overview

skg-state-memory provides a thread-safe, async-ready in-memory implementation of the StateStore trait from layer0. State is stored as a HashMap behind a RwLock, scoped to the process lifetime.

Use it for:

  • Tests and CI (no disk I/O, no cleanup required)
  • Short-lived operator runs where durability is not needed
  • Development and prototyping

For durable persistence, use skg-state-fs instead.

Usage

[dependencies]
skg-state-memory = "0.4"
use skg_state_memory::MemoryStateStore;
use layer0::StateStore;
use std::sync::Arc;

let store: Arc<dyn StateStore> = Arc::new(MemoryStateStore::new());
store.write("session:42:last_tool", b"calculator").await?;
let val = store.read("session:42:last_tool").await?;

Part of the skelegent workspace

skelegent is a composable async agentic AI framework for Rust. See the book for architecture and guides.