neuron
Composable async agentic AI framework for Rust
Overview
neuron is the umbrella re-export crate for the neuron workspace. It provides a single
dependency entry point for the most common combination of crates, controlled by feature flags.
The framework is built on a 6-layer protocol model where each layer is a Rust trait:
layer0: Operator | StateStore | Environment | Orchestrator | Hook | Observable
↓ ↓ ↓ ↓ ↓ ↓
operators state credentials workflows middleware events
Every layer is independently replaceable. You can use the Anthropic provider with the OpenAI operator interface, swap in-memory state for filesystem state, plug in Vault secrets without changing your operator code, and so on.
Quick start
[]
= { = "0.4", = ["op-react", "provider-anthropic", "state-memory", "env-local"] }
= { = "1", = ["full"] }
use *;
use Arc;
async
Feature flags
| Flag | Includes | Description |
|---|---|---|
core (default) |
layer0, neuron-context, neuron-tool, neuron-turn |
Protocol + wiring |
hooks (default) |
core + neuron-hooks |
Hook middleware |
op-react |
hooks + neuron-op-react |
ReAct loop operator |
op-single-shot |
hooks + neuron-op-single-shot |
Single-turn operator |
mcp |
core + neuron-mcp |
MCP bridge |
orch-kit |
core + neuron-orch-kit |
Orchestration wiring |
orch-local |
orch-kit + neuron-orch-local |
In-process orchestrator |
env-local |
core + neuron-env-local |
Local environment |
state-memory |
core + neuron-state-memory |
In-memory state store |
state-fs |
core + neuron-state-fs |
Filesystem state store |
provider-anthropic |
core + neuron-provider-anthropic |
Anthropic Claude |
provider-openai |
core + neuron-provider-openai |
OpenAI GPT |
provider-ollama |
core + neuron-provider-ollama |
Ollama local models |
providers-all |
all three providers | All built-in providers |
Workspace crates
The workspace is split into focused crates you can depend on individually:
Core protocol
layer0— foundational protocol traits (no implementations)neuron-turn— Provider trait + LLM typesneuron-tool— Tool + ToolRegistryneuron-context— context window strategies
Operators
neuron-op-react— ReAct reasoning loopneuron-op-single-shot— single model call
Providers
neuron-provider-anthropic— Claudeneuron-provider-openai— GPTneuron-provider-ollama— Ollama
Orchestration
neuron-orch-kit— wiring kitneuron-orch-local— in-process orchestrator
Hooks & security
neuron-hooks— hook registry and middlewareneuron-hook-security— redaction + DLP hooks
State
neuron-state-memory— in-memory storeneuron-state-fs— filesystem store
Environment & credentials
neuron-env-local— local environmentneuron-secret— secret resolution traitsneuron-auth— authentication traitsneuron-crypto— cryptographic traits
MCP
neuron-mcp— Model Context Protocol bridge
License
neuron is dual-licensed under MIT and Apache 2.0.