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

Simple LLM: Add Memory

The one slider that decides what your agent actually remembers

By NakamuraShippo·Created about a year ago·Updated 4 months ago· 5
Simple LLM: Add Memory
  • memory_bank
  • MEMORY_BANK
memory_content
importance0.5

If you've built an LLM workflow in ComfyUI for five minutes, you've hit the wall: the model has no memory. Each prompt starts from zero, and your agent forgets the character detail you told it three prompts ago. Simple LLM: Add Memory is this pack's answer to that - a node that stuffs a fact into a memory bank, attached with a score.

It's part of the SimpleLLM family inside ComfyUI-NS-Util, a small utility collection by NakamuraShippo. This is the newest corner of the pack; the README literally labels the LLM section "Implementing the tests now," so treat it as experimental scaffolding rather than a hardened system. That said, the memory mechanism is genuinely neat for what it is.

How it works

The node takes a memory_bank (created by Simple LLM: Memory Bank), wraps your memory_content in a little record, and appends it to the bank's internal list. Each record carries the content plus an importance score. The clever part is eviction: when the bank is over its capacity, Add Memory sorts everything by importance - highest first - and keeps only the top N. Low-value memories are the first to go, and your important facts survive.

That's it. No vector math, no embeddings. This is a deliberately simple episodic-memory slot that later agent runs could pull from. As of the shipped code, nothing in the pack actually reads the bank back into a prompt yet, so you're storing for the future - or for a workflow you wire yourself.

The inputs that matter

Only three, and only one deserves your attention:

  • memory_bank - the MEMORY_BANK object from Simple LLM: Memory Bank. The obvious upstream.
  • memory_content - the fact you're storing, as multiline text. Keep it self-contained: "The protagonist's name is Mara and she hates the rain," not "Mara."
  • importance - a float from 0 to 1, default 0.5. This is the knob that matters. Set it to 0.9 for the detail that defines your whole scene, 0.2 for trivia. When the bank fills up, low scores get evicted first.

The output is the updated MEMORY_BANK, which you chain into further Add Memory nodes or keep as the bank's new state.

Installing the pack

# via ComfyUI Manager: Main Menu → Manager → Install via Git URL
https://github.com/NakamuraShippo/ComfyUI-NS-Util

# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/NakamuraShippo/ComfyUI-NS-Util
pip install pyyaml watchdog

Restart ComfyUI after. No model files to download - the LLM nodes are thin HTTP clients, and the memory nodes don't even do that. ComfyUI 0.3 or later is recommended; older versions are untested by the author.

Common issues

The usual suspects apply: if you see SimpleLLMAddMemory missing after install, restart ComfyUI so the node registry picks up the pack. If the bank behaves oddly, remember the eviction rule - memory that vanishes isn't a bug, it's the importance slider doing its job. Raise the score.

The honest caveat is the same one for the whole LLM family: this is actively being developed, so expect rough edges and occasional API changes between updates. It's a fun way to experiment with agent memory inside the graph, not yet something to bet a production pipeline on.

CategoryNS/LLM/Memory

Inputs (3)

NameTypeDefaultDescription
memory_bankMEMORY_BANK
memory_contentSTRING
importanceFLOAT0.50–1

Outputs (1)

NameTypeDescription
MEMORY_BANKMEMORY_BANK