Nodes/ComfyUI-ZMongo/10 Text Agent Session
ComfyUI Node

10 Text Agent Session

The config card every ZMongo LLM node needs

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
10 Text Agent Session
  • session
  • text_agent_config
  • project_name
  • json
project_namedefault
modelgemini-3.5-flash
max_output_tokens2048
temperature0.40
memory_collectiontext_agent_memory
ledger_collectiontext_agent_ledger
capsule_collectiontext_agent_capsules
context_collectiontext_agent_context_packs
system_instructionYou are a precise ComfyUI prompt and workflow text agent. Return compact, useful output.
gemini_prefix/gemini
zmongo_prefix/comfy-zmongo
refresh_token

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/chat endpoint 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 (default gemini-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 - the ZMONGO_API_SESSION from an auth node. Required.
  • model - which Gemini model the agents use. Default gemini-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_session raises. 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 its refresh_token input 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_text fallback in the JSON output and a 0 score, not a crash - check the json output for the raw payload.
CategoryZMongo/07 Text Agents

Inputs (13)

NameTypeDefaultDescription
sessionZMONGO_API_SESSION
project_nameSTRINGdefault
modelSTRINGgemini-3.5-flash
max_output_tokensINT20481–65536
temperatureFLOAT0.400–2
memory_collectionoptSTRINGtext_agent_memory
ledger_collectionoptSTRINGtext_agent_ledger
capsule_collectionoptSTRINGtext_agent_capsules
context_collectionoptSTRINGtext_agent_context_packs
system_instructionoptSTRINGYou are a precise ComfyUI prompt and workflow text agent. Return compact, useful output.
gemini_prefixoptSTRING/gemini
zmongo_prefixoptSTRING/comfy-zmongo
refresh_tokenoptSTRING

Outputs (3)

NameTypeDescription
text_agent_configZMONGO_TEXT_AGENT_CONFIG
project_nameSTRING
jsonSTRING