neuron-runtime
Production runtime layer for the neuron agent blocks ecosystem. Provides session management, sub-agent orchestration, input/output guardrails, durable execution contexts, and tool sandboxing.
Key Types
Session-- a conversation session with messages, state, and timestamps. Created withSession::new(id, cwd).SessionState-- mutable runtime state within a session (working directory, token usage, event count, custom metadata).SessionStoragetrait -- async trait for persisting and loading sessions.InMemorySessionStorage--Arc<RwLock<HashMap>>storage for testing.FileSessionStorage-- one JSON file per session on disk.InputGuardrail/OutputGuardrail-- traits for safety checks that run before input reaches the LLM or before output reaches the user.GuardrailResult--Pass,Tripwire(reason), orWarn(reason). A tripwire halts execution immediately.SubAgentConfig-- configuration for spawning sub-agents (system prompt, tool filter, max depth, max turns).SubAgentManager-- registers and spawns sub-agents.LocalDurableContext-- passthroughDurableContextfor local development (no journaling or replay).Sandboxtrait /NoOpSandbox-- tool execution isolation boundary.
Usage
use PathBuf;
use ;
// Create a session and persist it to disk
async
// Define an input guardrail that blocks secrets
;
Part of neuron
This crate is one block in the neuron
composable agent toolkit. It depends on neuron-types, neuron-tool, and
neuron-loop.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.