neuron-state-memory 0.4.0

In-memory StateStore implementation for neuron
Documentation

neuron-state-memory

In-memory StateStore implementation for neuron

crates.io docs.rs license

Overview

neuron-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 neuron-state-fs instead.

Usage

[dependencies]
neuron-state-memory = "0.4"
use neuron_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 neuron workspace

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