docs/content/Agents/nodes.mdx
DocsGPT workflows are composed of Nodes that are connected to form a processing graph. These nodes interact with a Shared State—a global dictionary of variables that persists throughout the execution of the workflow.
Every workflow run maintains a state object (a JSON-like dictionary).
{{query}}) and chat history ({{chat_history}}).{{variable_name}}.The AI Agent Node is the core processing unit. It uses a Large Language Model (LLM) to generate text, answer questions, or perform tasks using tools.
The primary input is the Prompt Template. This field supports variable substitution.
"Summarize the following text: {{user_input_text}}"{{query}}).When the agent completes its task, it stores the result in the shared state.
node_{node_id}_output.summary or translated_text.The Set State Node allows you to manipulate variables within the shared state directly without calling an LLM. This is useful for initialization, formatting, or control flow logic.
You can define multiple operations in a single node. Each operation targets a specific Key (variable name).
Set: Assigns a specific value to a variable.
current_step to 1.formatted_response to Analysis: {{analysis_result}}.Increment: Increases the value of a numeric variable.
retry_count by 1.Append: Adds a value to a list variable.
{{last_result}} to history_list.i = 0) before a loop, and another to increment it inside the loop.context to {{search_results}}) so subsequent nodes can use a standard variable name.