AgentCreator Architecture and Design
The SnapLogic platform enables you to connect to various data sources, develop prompts, and interact with your LLMs in one UI. In SnapLogic AgentCreator, an agent is a collection of SnapLogic pipelines. AgentCreator enables the design of simple agents and goal-based agents. You can create hierarchical agents that have subagents (also known as multilayered agents), to perform more complex operations.
This article focuses on the following topics:
- AgentCreator pipeline architecture
- AgentCreator pipeline design considerations
AgentCreator pipelines orchestrate Agent operations. AgentCreator pipelines can connect to any data source supported by SnapLogic Snaps. You provide the user interface to expose these agents, by implementing it according to your organization's infrastructure or using a tool such as Streamlit.
Architectural Components
The Agent loop
The Agent pipeline pattern is based on the Agent loop. In the Agent loop, Drivers are loops, and the workers are the iterations. A driver pipeline can call multiple worker pipelines, and a worker pipeline can call another pipelines.
Agentic workflows require the iterative execution of tool-requests. For an Agent to succeed, the continuous need for autonomous decision-making is necessary, and to achieve this, the PipeLoop Snap can call other pipelines continuously until a stop condition is met. For this reason, the Agent Driver pipeline pattern always includes the PipeLoop Snap downstream of Prompt Generator Snap.
The second layer is comprised of worker pipelines. A worker is a function-calling pipeline. Worker pipelines perform different tasks including calling multiple tool pipelines. In worker pipelines, different purposes inform different pipeline designs. Therefore, worker pipelines do not have a set pattern since they can perform a range of tasks that necessitate their own design considerations.
The AgentCreator pipeline pattern
- Agent Driver pipeline: The primary pipeline sends prompt input to the LLM that initiates iterative executions of the worker pipelines.
- Agent Worker pipeline: A secondary pipeline that the Driver Agent parent pipeline calls to perform a task with an objective based on prompt input. Worker pipelines are configured to call function pipelines to collect data. They are child pipelines to the Driver.
- Tool pipeline: A pipeline that performs a specific task with limited scope via predefined parameters. It can be a function and call tools.
Tool Pipelines
Tools are created with tool pipelines. The are children to the parent worker pipeline. Importantly, Tool Pipelines do not call tools, but are the tools that the worker pipeline and, by extension, driver pipeline, call.
For example, an Agent assisting with near-term travel planning might retrieve the temperature using a tool from a weather website. As the Agent end user, you would enter a prompt into an input field in an app interface. Operationally, that prompt input is sent as a request to the driver pipeline, and the driver sends the request to worker pipeline which carries out iterations, interacting with the tools. The response is then passed back though the loop, in case, more iteration on the request is required. Learn more about the AgentCreator loop processing.
The following diagram illustrates the request flow in tool pipelines:
The processing is accomplished through four types of Snaps found in each LLM Snap Pack:
- Function Generator Snap: facilitates the creation of a Tool definition, enabling the model to understand and utilize the available tools.
- Tool Calling Snap: forwards user input and tool specifications to the model's API, receiving the model's generated output in return.
- Function Result Snap: formats the results generated by user-invoked functions into a custom data output structure defined within SnapLogic.
- Message Appender Snap: adds the results of tool runs to the message list, serving as input for subsequent tool calls.
You can also call multiple functions from the MultiFunction Generator Snap. Learn more about how to streamline the designs of your Agent pipelines through efficient tool calling.
Message transmission
The Message Appender Snap is a necessary part of the Agent Loop. It enables you to combine output streams and persists the conversation history through the pipeline. This is necessary to give the proper information to your worker pipelines.
Design considerations
LLM Vendors and Models
Agent pipeline design and configuration depends on the LLM vendor and model you plan to use. Snap Packs support multiple operations in LLMs and various types of accounts. In each LLM Snap Pack, similar capabilities are supported with the same patterns for consistency across the different LLM vendor Snap Packs.
Two types of Snaps perform LLM-calling. Although both have the same underlying endpoint, their functions differ:
- Chat completions: takes the prompt input and returns the LLM response.
- Tool calling: takes the prompt input and evaluates against the function definition to specify which tool to use.
System prompt
Defining a role for Agents and Subagents is an important part of returning output in a format that suits your usecase. You can define the role of the Agent by selecting system prompt in the appropriate Snap for the LLM vendor/model.
The system prompt is for the model to understand the persona it should adopt (displayed in the UI as role). While not required, creating a system prompt makes things easier because it creates a set of instructions for the LLM - not a request.
You can leverage the system prompt for the underlying system receiving the prompt input. This enables you to create layers of agents.
JSON mode
JSON mode is for the model to output in JSON format. JSON format can be leveraged relaying output data from the LLM to other systems.
For Agents that rely on LLM thinking and reasoning models, structured outputs can be leveraged for specific formatting input and output requirements.
Refer to Get started with AgentCreator for a workflow and the Briefing Agent use case article.
Learn more about designing Agents and GenAI apps.