Architecture Overview
The reference server is three layers; the protocol itself is layer-agnostic (it specifies semantics, not transport).
| Layer | Responsibility |
|---|---|
| 1 · Network / MCP Gateway | FastAPI app: routing, Bearer-token auth, tenant extraction, MCP (stdio + SSE) tool surface. |
| 2 · Ingestion Queue | Async batch worker with backpressure; writes are enqueued and flushed in batches. |
| 3 · Storage | SQLiteGMPBackend — sentinel-encoded schema, composite B-tree indexes, WAL mode for concurrent reads. |
Each layer maps to a module: src/aml/server/app.py, src/aml/server/ingestion.py, and the backends under src/aml/backends/.
A backend does not need the server: any object implementing the MemoryBackend protocol is directly conformance-testable in-process.