Nodes/ComfyUI-NS-Util/Simple LLM: Memory Bank
ComfyUI Node

Simple LLM: Memory Bank

A named box with a capacity — the container that makes Add Memory make sense

By NakamuraShippo·Created about a year ago·Updated 4 months ago· 5
Simple LLM: Memory Bank
    • MEMORY_BANK
    namemain_memory
    capacity10

    On its own, Simple LLM: Memory Bank does nothing. That's the honest opening: it just creates an empty, named container with a capacity - the MEMORY_BANK object that Simple LLM: Add Memory stuffs facts into. But it's the foundation of this pack's attempt at giving your LLM agent a memory, so it's worth understanding what the container promises and what it doesn't.

    It's part of the SimpleLLM family in ComfyUI-NS-Util (NakamuraShippo's utility pack; the README flags the LLM section as "Implementing the tests now" - early days). Think of the bank as a box with two properties: a name so you can keep several boxes straight, and a capacity that caps how many memories it holds. The interesting behavior - keeping important memories and evicting trivia - only happens in Add Memory, when the bank fills up.

    How it works

    The node builds a MEMORY_BANK dict holding your name, your capacity, an empty memories list, and a current_size counter. Nothing else. The design intent: you create a bank, run it through one or more Simple LLM: Add Memory nodes to fill it, and each Add Memory returns the updated bank - so the bank's state travels forward through the graph as memories pile on. When additions exceed capacity, Add Memory sorts by importance and trims, which is where the box earns its keep: capacity isn't just a limit, it's an eviction policy.

    The inputs that matter

    • name - a string, default main_memory. Useful for labeling; if you keep multiple banks (per-character, per-scene), distinct names keep them straight.
    • capacity - an integer from 1 to 100, default 10. How many memories the bank holds before eviction kicks in. Start at 10; raise it if your important facts keep getting trimmed.

    Output: a MEMORY_BANK - an empty container until you run it through Add Memory.

    Installing the pack

    # ComfyUI Manager → Install via Git URL:
    https://github.com/NakamuraShippo/ComfyUI-NS-Util
    
    # or:
    cd ComfyUI/custom_nodes
    git clone https://github.com/NakamuraShippo/ComfyUI-NS-Util
    pip install pyyaml watchdog
    

    Restart ComfyUI. No model downloads, no network calls, no dependencies beyond the pack.

    Common issues

    The biggest source of confusion is running this node alone and getting "nothing" - that's correct, it's a container. If you're seeing "nothing" after adding memories too, remember the whole memory pipeline (bank → add → read back into a prompt) isn't fully wired in the shipped code yet: you can store, but nothing in the pack currently injects the bank back into a run. Treat it as scaffolding for agent memory rather than a finished feature, and set expectations accordingly - this corner of the pack is young.

    CategoryNS/LLM/Memory

    Inputs (2)

    NameTypeDefaultDescription
    nameSTRINGmain_memory
    capacityINT101–100

    Outputs (1)

    NameTypeDescription
    MEMORY_BANKMEMORY_BANK