@@ -9,18 +9,17 @@ circular dependencies.
99``` text
1010neuron-types (zero deps, the foundation)
1111 ^
12- |-- neuron-provider-* (each implements Provider)
13- |-- neuron-tool (implements Tool, registry, middleware)
14- |-- neuron-mcp (wraps rmcp, bridges to Tool)
15- +-- neuron-context (+ optional Provider for summarization)
12+ |-- neuron-provider-* (each implements Provider trait)
13+ |-- neuron-context (compaction strategies, token counting)
14+ +-- neuron-tool (Tool trait, registry, middleware)
1615 ^
17- neuron-loop (composes provider + tool + context )
18- ^
19- neuron-runtime (sessions, DurableContext, guardrails)
20- ^
21- neuron (umbrella re-export)
22- ^
23- YOUR PROJECT (SDK, CLI, TUI, GUI)
16+ |-- neuron-mcp (wraps rmcp, bridges to Tool trait )
17+ |-- neuron-loop (provider loop with tool dispatch)
18+ +-- neuron-runtime (sessions, DurableContext, guardrails, sandbox )
19+ ^
20+ neuron (umbrella re-export)
21+ ^
22+ YOUR PROJECT (SDK, CLI, TUI, GUI)
2423```
2524
2625## Layer by layer
@@ -67,31 +66,31 @@ Implements the tool system:
6766
6867Depends only on ` neuron-types ` .
6968
70- ### neuron-mcp (leaf node)
69+ ### neuron-mcp
7170
7271Wraps the ` rmcp ` crate (the official Rust MCP SDK) and bridges MCP tools into
73- neuron's ` ToolDyn ` trait. Depends only on ` neuron-types ` and ` rmcp ` .
72+ neuron's ` ToolDyn ` trait. Depends on ` neuron-types ` , ` neuron-tool ` , and ` rmcp ` .
7473
7574### neuron-context (leaf node)
7675
7776Implements ` ContextStrategy ` for client-side context compaction. Some strategies
7877(like summarization) optionally use a ` Provider ` for LLM calls, but the
7978dependency is on the trait, not on any concrete provider crate.
8079
81- ### neuron-loop (composition layer)
80+ ### neuron-loop
8281
83- The agentic while-loop that composes a provider, tool registry, and context
84- strategy. This is the ~ 300-line commodity loop that every agent framework
85- converges on. It depends on:
82+ The agentic while-loop that composes a provider and tool registry. This is the
83+ ~ 300-line commodity loop that every agent framework converges on. It depends on:
8684
87- - ` neuron-types ` (for all trait definitions)
85+ - ` neuron-types ` (for trait definitions)
86+ - ` neuron-tool ` (for ` ToolRegistry ` )
8887
89- The loop is generic over ` <P: Provider> ` and accepts a ` ToolRegistry ` and
90- optional ` ContextStrategy ` implementation .
88+ The loop is generic over ` <P: Provider, C: ContextStrategy > ` and accepts a
89+ ` ToolRegistry ` . ` neuron-context ` is a dev-dependency only (for tests) .
9190
92- ### neuron-runtime (runtime layer)
91+ ### neuron-runtime
9392
94- Adds cross-cutting runtime concerns on top of the loop :
93+ Adds cross-cutting runtime concerns:
9594
9695- ** Sessions** -- persistent conversation state via ` StorageError ` -aware backends
9796- ** DurableContext** -- wraps side effects for Temporal/Restate replay
@@ -100,7 +99,8 @@ Adds cross-cutting runtime concerns on top of the loop:
10099- ** PermissionPolicy** -- tool call authorization
101100- ** Sandbox** -- isolated tool execution environments
102101
103- Depends on ` neuron-types ` and ` neuron-loop ` .
102+ Depends on ` neuron-types ` and ` neuron-tool ` . ` neuron-loop ` and ` neuron-context `
103+ are dev-dependencies only (for tests).
104104
105105### neuron (umbrella)
106106
@@ -118,14 +118,15 @@ neuron = { version = "0.2", features = ["anthropic", "openai"] }
118118or below, never at layer N or above. This is enforced by ` Cargo.toml `
119119dependencies -- circular dependencies are a compile error in Rust.
120120
121- ** Each block knows only about ` neuron-types ` and the blocks directly below it .**
121+ ** Each block knows only about ` neuron-types ` and the blocks it directly depends on .**
122122` neuron-tool ` has no idea that ` neuron-loop ` exists. ` neuron-provider-anthropic `
123123has no idea that ` neuron-runtime ` exists. This means you can use any block
124124independently.
125125
126- ** No cross-leaf dependencies.** Provider crates do not depend on the tool crate.
127- The MCP crate does not depend on any provider crate. Leaf nodes are fully
128- independent of each other.
126+ ** Provider crates are fully independent.** Provider crates do not depend on the
127+ tool crate, the MCP crate, or each other. ` neuron-mcp ` , ` neuron-loop ` , and
128+ ` neuron-runtime ` share a dependency on ` neuron-tool ` but are independent of
129+ each other.
129130
130131## Practical implications
131132
0 commit comments