10 Text Agent Session
The config card every ZMongo LLM node needs
- session
- text_agent_config
- project_name
- json
Every "10" node in ComfyUI-ZMongo's Text Agents family - Prompt Critic, Prompt Evolver, Save Prompt Memory, and the rest - has a text_agent_config input, and nothing else in the pack produces that socket. Text Agent Session is the config card that feeds them all. You wire a ZMongo session into it, pick a model and temperature, and it outputs a single ZMONGO_TEXT_AGENT_CONFIG bundle that carries the model, token budget, collection names, and system prompt downstream.
Think of it as the pack's answer to a shared "LLM node setup" - one place to define which Gemini model your prompt agents use, how creative they're allowed to be, and where their memory/ledger records land. Change the model here and every agent fed by this config follows.
How it works
The node builds a config dict from your session and settings, then passes it along with a project_name and a JSON status payload. The project_name matters more than it looks: it's the partitioning key. Memory, ledger, capsule, and context records are all tagged with it, so different projects keep their prompt history separate in the same collections.
Two things to internalize before you build a workflow around this:
- It needs a real hosted session. The config embeds the session, and the agent nodes call the ZMongo backend's
/api/chatendpoint to reach Gemini. The Local File Store session will not serve that route. You need the API Key Session (account + key) for the Text Agents family - this is the "why an API account is needed" bit the Workflow Documentation Agent's own prompt tells you to explain. - Model calls go through ZMongo, not straight to Google. You set
model(defaultgemini-3.5-flash) and the backend proxies the request. So "local LLM" this is not - you're renting their pipeline.
Inputs and outputs that matter
session- theZMONGO_API_SESSIONfrom an auth node. Required.model- which Gemini model the agents use. Defaultgemini-3.5-flash.temperature- 0 to 2, default 0.4. The critic node overrides its own to 0.2; the evolver uses at least 0.2.max_output_tokens- default 2048, up to 65536.system_instruction- the agent's system prompt, with a sensible ComfyUI-focused default.
The four collection fields (memory_collection, ledger_collection, capsule_collection, context_collection) default to text_agent_memory, text_agent_ledger, text_agent_capsules, and text_agent_context_packs - you can rename them if you want per-project storage, but the defaults are fine.
Outputs: text_agent_config (wire this into the 10-series nodes), project_name, and json (a status payload describing the config).
Installing it
Pack-level install, same as all ZMongo nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo
Restart ComfyUI, or install via ComfyUI Manager ("ComfyUI-ZMongo"). Heavy requirements.txt warning applies - pymongo, langchain, sentence-transformers, transformers, FlagEmbedding all install regardless of which nodes you actually use.
Common issues
- "Missing ZMongo API session. Connect a ZMongo API Key Session node." - that's the literal error
_require_sessionraises. You wired a local file store session, or no session at all. The Text Agents family needs the hosted API key session. - The 10 nodes won't re-run - the agent nodes are marked
AlwaysDirty, so they should re-execute each queue even with unchanged inputs. If one is stuck, bump itsrefresh_tokeninput to force a fresh run. - Unexpected output - the agents ask Gemini for JSON with a schema, and parse it best-effort. If the model returns prose instead, you get a
raw_textfallback in the JSON output and a 0 score, not a crash - check thejsonoutput for the raw payload.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| session | ZMONGO_API_SESSION | — | |
| project_name | STRING | default | — |
| model | STRING | gemini-3.5-flash | — |
| max_output_tokens | INT | 20481–65536 | — |
| temperature | FLOAT | 0.400–2 | — |
| memory_collectionopt | STRING | text_agent_memory | — |
| ledger_collectionopt | STRING | text_agent_ledger | — |
| capsule_collectionopt | STRING | text_agent_capsules | — |
| context_collectionopt | STRING | text_agent_context_packs | — |
| system_instructionopt | STRING | You are a precise ComfyUI prompt and workflow text agent. Return compact, useful output. | — |
| gemini_prefixopt | STRING | /gemini | — |
| zmongo_prefixopt | STRING | /comfy-zmongo | — |
| refresh_tokenopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text_agent_config | ZMONGO_TEXT_AGENT_CONFIG | — |
| project_name | STRING | — |
| json | STRING | — |