10 Save Prompt Memory
Your prompt ideas, tagged and searchable
- text_agent_config
- json
- document_id
- success
- refresh
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 (defaultnew_memory- rename it).text- the actual prompt/content to remember.memory_type- freeform string, defaultprompt.tags_csv- comma-separated tags, defaultprompt,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.
successis false but no error shows - check thejsonoutput. 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_nameand project must match exactly between save and load. Theproject_namecomes from your text agent config, so if you changed projects in between, you're querying a different partition.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| text_agent_config | ZMONGO_TEXT_AGENT_CONFIG | — | |
| memory_name | STRING | new_memory | — |
| text | STRING | — | |
| memory_type | STRING | prompt | — |
| tags_csvopt | STRING | prompt,comfyui | — |
| notesopt | STRING | — | |
| collection_overrideopt | STRING | — | |
| extra_jsonopt | STRING | {} | — |
| refresh_tokenopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| json | STRING | — |
| document_id | STRING | — |
| success | BOOLEAN | — |
| refresh | STRING | — |