# `Alloy.Memory.Router`
[🔗](https://github.com/alloy-ex/alloy/blob/v0.12.4/lib/alloy/memory/router.ex#L1)

Routes `memory_20250818` tool calls to a configured `Alloy.Memory`
store.

This module is deliberately independent of `Alloy.Tool.Executor`.
Anthropic's memory tool is a typed tool (`{"type": "memory_20250818"}`),
not a generic function tool — its command vocabulary, argument shape,
and result-string conventions are fixed by the provider contract, so
it does not benefit from the generic tool pipeline's concurrency,
tagging, or schema validation.

The router's job is narrow: take a list of memory tool-use blocks,
dispatch each command to the store in order, and return the matching
`tool_result` blocks.

# `dispatch_all`

```elixir
@spec dispatch_all(
  [map()],
  {module(), term()}
) :: [map()]
```

Dispatch a list of memory tool-use blocks to the configured store.

Returns `[%{type: "tool_result", tool_use_id: id, content: text, is_error: bool}]`
in the same order as the input blocks.

`memory_config` is the `{module, opts}` tuple that `Alloy.run/2`
received as the `:memory` option. The second element is passed to
every callback as the opaque `store` term.

# `memory_call?`

```elixir
@spec memory_call?(map()) :: boolean()
```

Predicate: is this tool-use block a memory call?

# `tool_name`

```elixir
@spec tool_name() :: String.t()
```

Returns the tool name that provider wiring uses for the
`memory_20250818` tool. Exposed so providers and `Turn` can
partition tool calls without re-declaring the string.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
