# mead v0.1.1 - Table of Contents > Runtime for LLM-backed assistants on Elixir/OTP: supervised sessions, a local/cloud model router, and an MCP client and server. ## Pages - [README](readme.md) - [README.pt](readme-pt.md) - [mead Architecture Specification](architecture.md) - [Contributing](contributing.md) - [Security policy](security.md) - [LICENSE](license.md) ## Modules - [Mead](Mead.md): Public API of the `mead` runtime: isolated, supervised conversation sessions. - [Mead.Deck.Channel](Mead.Deck.Channel.md): The deck's view of one session: one process per session that owns the event sequence, the event log, the prompt queue and the turn that runs. - [Mead.Deck.ChannelSupervisor](Mead.Deck.ChannelSupervisor.md): Starts and stops the `Mead.Deck.Channel` of each session. A channel is `:temporary`: when it stops, a reconnecting deck asks for a new one through `ensure/2`, and the event log it keeps on disk carries the sequence over. - [Mead.Deck.Configuration](Mead.Deck.Configuration.md): Reads and validates `config :mead, :deck`. - [Mead.Deck.EventLog](Mead.Deck.EventLog.md): The append-only log of the sequenced events of one deck session, one file `.events` per session beside the session history, on the same `Mead.Session.Record` framing (length and checksum per record, a torn last record cut on open). - [Mead.Deck.Events](Mead.Deck.Events.md): The wire vocabulary of the deck protocol: building the envelope of a server event and validating a client message. - [Mead.Deck.Interaction](Mead.Deck.Interaction.md): The `Mead.Router.Interaction` of a deck turn: every question and every progress report is a call into the `Mead.Deck.Channel` of the session, which owns the policy, the event log and the clock. - [Mead.Deck.Plug](Mead.Deck.Plug.md): The HTTP side of the deck: the two routes under `/deck`. - [Mead.Deck.Socket](Mead.Deck.Socket.md): One WebSocket connection of the deck: a translator between frames and calls on the session's `Mead.Deck.Channel`, which holds all the state, so a deck that reconnects finds it intact. - [Mead.Deck.Tickets](Mead.Deck.Tickets.md): Single-use tickets that turn an authenticated `POST /deck/ticket` into one WebSocket upgrade. - [Mead.Gateway](Mead.Gateway.md): The single plug behind the shared Bandit listener: it hands a request to the MCP plug or to the deck plug by the first segment of its path. - [Mead.Ledger](Mead.Ledger.md): Ledger of what the router sends to providers, kept in memory and journaled to disk. - [Mead.Ledger.Journal](Mead.Ledger.Journal.md): The pure model of the ledger journal: the counter rows, the ring of the last 100 turns and the dropped count that a sequence of journal events adds up to. - [Mead.Ledger.JournalFile](Mead.Ledger.JournalFile.md): The file side of the ledger journal: `ledger.journal` in the storage directory, a sequence of `Mead.Session.Record` records, each one `Mead.Ledger.Journal` event. - [Mead.MCP.Catalog](Mead.MCP.Catalog.md): The tools the connected MCP servers offer, plus the normalized server configuration, in an ETS table any process can read. - [Mead.MCP.Configuration](Mead.MCP.Configuration.md): Validates and normalizes the MCP servers configured under `config :mead, :mcp, servers: [...]`. - [Mead.MCP.Connection](Mead.MCP.Connection.md): One process per configured MCP server. It owns a transport, performs the MCP handshake, keeps the server's tools published in `Mead.MCP.Catalog`, and carries tool calls. - [Mead.MCP.Hub](Mead.MCP.Hub.md): The client side of MCP for the runtime: a supervisor that keeps one `Mead.MCP.Connection` per configured server, and the two functions the router uses, `tools_for/2` and `call_tool/4`. - [Mead.MCP.Policy](Mead.MCP.Policy.md): Decides which tools the model sees and whether a named call may run. Pure: it reads no process and asks no server. - [Mead.MCP.Protocol](Mead.MCP.Protocol.md): Pure JSON-RPC 2.0 codec for the slice of MCP that `mead` speaks as a client: `initialize`, `notifications/initialized`, `tools/list`, and `tools/call`. - [Mead.MCP.Server](Mead.MCP.Server.md): The server side of MCP: an HTTP listener that lets a client with the configured token drive sessions as tools (see `Mead.MCP.Server.Tools`). The last child of the root supervisor. - [Mead.MCP.Server.Configuration](Mead.MCP.Server.Configuration.md): Reads and validates `config :mead, :mcp_server`. - [Mead.MCP.Server.Dispatcher](Mead.MCP.Server.Dispatcher.md): Turns one decoded JSON-RPC message into the server's answer. Pure apart from the tools it calls: no HTTP, no process of its own, so every protocol rule is testable without a network. - [Mead.MCP.Server.Plug](Mead.MCP.Server.Plug.md): The HTTP side of the MCP server: `POST /mcp`, one JSON-RPC message per request. - [Mead.MCP.Server.Tools](Mead.MCP.Server.Tools.md): The nine tools the MCP server offers: `start_session`, `submit_turn`, `history`, `stop_session`, `resume_session`, `delete_session`, `list_sessions`, `compact_session`, and `usage`. They are the only code of the server that touches the runtime, and they do it only through the public `Mead` API. - [Mead.MCP.Transport](Mead.MCP.Transport.md): Behaviour for the pipe between a `Mead.MCP.Connection` and one MCP server. - [Mead.MCP.Transport.Http](Mead.MCP.Transport.Http.md): The Streamable HTTP transport of MCP: every message is a POST, and the answer is either one JSON body or an event stream that ends with the answer. - [Mead.MCP.Transport.Stdio](Mead.MCP.Transport.Stdio.md): Runs an MCP server as a child process and talks to it over its standard input and output, one JSON message per line. - [Mead.Origin](Mead.Origin.md): The `Origin` rule of every HTTP surface of the runtime: protection against DNS rebinding and cross-site WebSocket hijacking. - [Mead.Provider](Mead.Provider.md): Behaviour for a model backend that completes a conversation. - [Mead.Provider.Anthropic](Mead.Provider.Anthropic.md): `Mead.Provider` backed by the Anthropic Messages API. - [Mead.Provider.Ollama](Mead.Provider.Ollama.md): `Mead.Provider` backed by the Ollama chat API, meant for the `local` slot of `Mead.Router`. - [Mead.Provider.ServerSentEvents](Mead.Provider.ServerSentEvents.md): An incremental parser for `text/event-stream` bodies. - [Mead.Router](Mead.Router.md): Turn handler that sends each turn to a local or a cloud model. - [Mead.Router.AskUser](Mead.Router.AskUser.md): The built-in `ask_user` tool: lets the model put a short multiple-choice question to the person and use the answer. - [Mead.Router.Classifier](Mead.Router.Classifier.md): Decides whether a turn is routine enough for the local model or needs the cloud. - [Mead.Router.Interaction](Mead.Router.Interaction.md): What the router asks of a person (or of a policy standing in for one) around each tool call. - [Mead.Session](Mead.Session.md): Registry helpers shared by the processes that make up one conversation. - [Mead.Session.EchoHandler](Mead.Session.EchoHandler.md): Provisional default handler that answers every turn with its own input. - [Mead.Session.History](Mead.Session.History.md): Keeps the turns of one conversation, and writes them through `Mead.Session.Store` when the session has a storage directory. - [Mead.Session.Pool](Mead.Session.Pool.md): Dynamically starts and stops the per-conversation supervisors. - [Mead.Session.Record](Mead.Session.Record.md): The record framing shared by the session files and the ledger journal, and the few file operations both need. - [Mead.Session.Server](Mead.Session.Server.md): Orchestrates the turns of one conversation. - [Mead.Session.Store](Mead.Session.Store.md): Keeps the turns of each conversation in one append-only file per session. - [Mead.Session.Supervisor](Mead.Session.Supervisor.md): Supervises the two processes of one conversation. - [Mead.Session.Turn](Mead.Session.Turn.md): One exchange in a conversation: the input, the output once known, and how it ended. - [Mead.Session.TurnHandler](Mead.Session.TurnHandler.md): Behaviour for the code that produces the output of a turn. - [Mead.UUID](Mead.UUID.md): Generates random (version 4) UUID strings without any dependency.