v0.12.0 — Runtime & Persistence
What's New
NATS KV Checkpoint Backend (feature = "nats")
NatsKvCheckpoint stores checkpoints in NATS JetStream key-value buckets — distributed, replicated checkpoint storage with no external database required.
let cp = NatsKvCheckpoint::connect("nats://127.0.0.1:4222", "daimon-checkpoints").await?;
cp.save(&state).await?;
let loaded = cp.load("run-1").await?;Redis Checkpoint Backend (feature = "redis")
RedisCheckpoint stores checkpoints in Redis hashes — fast, shared checkpoint storage accessible from multiple processes.
let cp = RedisCheckpoint::new("redis://127.0.0.1/", "daimon:checkpoints").await?;
cp.save(&state).await?;Agent Hot-Reload
HotSwapAgent wraps an Agent behind a RwLock, enabling runtime reconfiguration without restart:
let hot = HotSwapAgent::new(agent);
// Use normally
let response = hot.prompt("Hello").await?;
// Swap model at runtime — next prompt uses the new model
hot.swap_model(new_model).await;
hot.swap_system_prompt(Some("New persona".into())).await;
hot.add_tool(my_tool).await;
hot.remove_tool("old_tool").await;Supports swapping: model, system prompt, memory, hooks, middleware, guardrails, tool retry policy, temperature, max tokens, and max iterations. Clone-friendly — all clones share the same underlying agent.
Streaming Distributed Execution
StreamingTaskWorker uses Agent::prompt_stream() and publishes each StreamEvent through a TaskEventBus, enabling real-time observation of agent progress across process boundaries:
let bus = InProcessEventBus::new(64);
let worker = StreamingTaskWorker::new(broker, bus.clone(), agent_factory);
let mut rx = bus.subscribe();
tokio::spawn(async move { worker.run().await });
while let Ok(evt) = rx.recv().await {
println!("{}: {:?}", evt.task_id, evt.event);
}Serializable TaskStreamEvent / SerializableStreamEvent types support JSON round-tripping for transport over Redis pub/sub, NATS, WebSocket, or any custom bus.
Full Changelog: v0.11.0...v0.12.0