Architecture

The Web UI uses the REST API. The CLI and MCP server also use shared analysis services. Each interface exposes the operations that its users need.

The allocator layer parses heap chunks and free lists and classifies bytes by role. The engine uses those roles when it builds consensus and reports candidates. See heap/.

        flowchart TB
    subgraph UX
        Web[React workspace]
        CLI[memdiver CLI]
        MCP[MCP server]
        Marimo[Marimo sandbox]
    end
    subgraph API[FastAPI]
        Routers[dataset · analysis · inspect ·<br/>sessions · tasks · dumps · path ·<br/>structures · architect · consensus ·<br/>oracles · pipeline · heap]
    end
    subgraph Engine[Engine &amp; Algorithms]
        Pipeline[pipeline · pipeline_runner]
        Consensus[ConsensusVector<br/>Welford · MSL-aware]
        Oracle[BYO oracle<br/>sha256 audit]
        Algos[Registered algorithms]
        Architect[Pattern Architect<br/>YARA · JSON · Vol3]
        Heap[heap<br/>allocator detect · chunk walk · byte roles]
    end
    subgraph Storage[Storage &amp; IO]
        Harvester[harvester<br/>ingestor · sidecar · metadata]
        MSL[msl<br/>reader · writer · importer]
        ProjectDB[DuckDB ProjectDB]
        Sessions[.memdiver SessionStore]
    end
    Web --> API
    CLI --> Engine
    MCP --> Engine
    Marimo --> Engine
    API --> Engine
    Engine --> Algos
    Engine --> Oracle
    Engine --> Architect
    Engine --> Heap
    Engine --> Harvester
    Harvester --> MSL
    Engine --> ProjectDB
    Engine --> Sessions