AgentCreator Architecture and Design
The SnapLogic 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 pipeline, which calls another.
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 Pipe Loop 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 pipelines 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: Primary pipeline with prompt input for the LLM and initiates iterative executions of the worker pipelines.
- Agent Worker pipeline: A secondary child 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.
- 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
Worker pipelines can serve as tool pipelines or call other tool pipelines. Tool pipelines do not call tools, but are the tools that the worker pipeline and driver pipeline uses. The user of the Agent sends the request to driver, and driver sends the request to worker pipelines who carries out iterations, interacting with the tool. The response is passed back. Learn more.
The following diagram shows the flow of tool pipeline:
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.
Messages 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.
>System prompt is for the model to understand the persona it's supposed to adopt (displayed in the UI as role). System prompt is not necessary, but makes things easier because it creates a set of instructions - not a request - for the LLM.
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.