microagents-storage
Session storage layer for the microagents framework.
Overview
This crate provides pluggable backends for persisting and retrieving agent session events. All backends implement the AgentStorage trait, which defines three core operations:
create_session– persist the initial event that starts a new sessionupdate_session– append an event to an existing sessionget_session– retrieve all events for a given session, ordered by time
Backends
| Backend | Module | Persistence |
|---|---|---|
| In-Memory | memory |
Ephemeral (data lost on process exit) |
| JSON Lines | jsonl |
One .jsonl file per session in ~/.microagents/sessions |
| SQLite | sqlite |
Single SQLite database at ~/.microagents/sessions.db |
Backend selection is controlled by AgentStorageChoice.
Usage
use ;
let storage = new.await?;
storage.create_session.await?;
storage.update_session.await?;
let events = storage.get_session.await?;
License
MIT