Nodes/ComfyUI-ZMongo/10 Save Prompt Memory
ComfyUI Node

10 Save Prompt Memory

Your prompt ideas, tagged and searchable

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
10 Save Prompt Memory
  • text_agent_config
  • json
  • document_id
  • success
  • refresh
memory_namenew_memory
text
memory_typeprompt
tags_csvprompt,comfyui
notes
collection_override
extra_json{}
refresh_token

Save Prompt Memory is the "don't lose the good prompt" node in ComfyUI-ZMongo's Text Agents family. You feed it a prompt (or any chunk of text worth keeping), give it a name and some tags, and it stores the whole thing - text, tags, notes, and extra JSON - as a document in your memory collection, tagged with the project from your text agent config.

It's not an LLM node. There's no model call anywhere in it. It's a structured write to the database, which makes it one of the more forgiving Text Agents nodes: if you only have a hosted session so far, this is a safe way to prove the plumbing works before you start spending Gemini tokens.

Why you'd reach for it: you have a prompt that finally worked, or a style recipe you want to reuse across sessions, or you're building the loop where Prompt Critic refines a prompt and you park the winner somewhere it won't be lost. Combined with the companion Load Memory Capsule node, this gives you a persistent, project-scoped prompt library that lives in ZMongo instead of in a text file you'll forget to back up.

How it works

The node builds a document with your memory_name, memory_type, tags (parsed from the CSV), the text, notes, and an optional extra_json blob, plus created_at/updated_at timestamps and a source marker. It writes that into collection_override if set, otherwise into the memory_collection configured on your Text Agent Session node (default text_agent_memory), then returns the document ID.

The document comes back with a document_id output - that's your handle. Feed it to other ZMongo document nodes later, or reference it from a capsule or ledger entry.

Inputs and outputs that matter

  • text_agent_config - from a Text Agent Session node. Required.
  • memory_name - the identifier to save under (default new_memory - rename it).
  • text - the actual prompt/content to remember.
  • memory_type - freeform string, default prompt.
  • tags_csv - comma-separated tags, default prompt,comfyui.
  • notes - optional annotation.
  • extra_json - any structured JSON you want to attach.

Outputs: json (full save payload), document_id, success (BOOLEAN), and refresh (a dirty-token string - change it to force a re-save).

Installing it

Same as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo

Restart ComfyUI or use ComfyUI Manager ("ComfyUI-ZMongo"). Expect a chunky requirements.txt install (pymongo, langchain, sentence-transformers, transformers...).

Common issues

  • "Missing ZMongo API session" - the Text Agents family needs a hosted API key session; the Local File Store session alone won't do. Wire the API Key Session node into your Text Agent Session.
  • success is false but no error shows - check the json output. The node returns the full backend payload, and the error message lives there (often a collection-permissions or auth issue on the hosted side).
  • Memory never appears when you load it - memory_name and project must match exactly between save and load. The project_name comes from your text agent config, so if you changed projects in between, you're querying a different partition.
CategoryZMongo/07 Text Agents/Memory

Inputs (9)

NameTypeDefaultDescription
text_agent_configZMONGO_TEXT_AGENT_CONFIG
memory_nameSTRINGnew_memory
textSTRING
memory_typeSTRINGprompt
tags_csvoptSTRINGprompt,comfyui
notesoptSTRING
collection_overrideoptSTRING
extra_jsonoptSTRING{}
refresh_tokenoptSTRING

Outputs (4)

NameTypeDescription
jsonSTRING
document_idSTRING
successBOOLEAN
refreshSTRING