Create Agents with AgentCreator
In SnapLogic AgentCreator, an agent is a collection of SnapLogic pipelines. AgentCreator enables the design of simple agents and goal-based agents via pipeline design. The SnapLogic platform provides a platform where you can connect to various data sources, develop prompts, and interact with your LLMs in one UI. 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 concepts
- AgentCreator pipeline design considerations
How Agents work
An Agent component refers to Snaps and common properties in Snaps that enable agentic processes.
The Agent loop
The Agent pipeline pattern is based on the Agent loop. In the Agent Loop, a driver pipeline calls a worker pipeline, which either is the tool pipeline or becomes a subagent that calls tool pipelines or other subagents. 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. The Agent Driver pipeline pattern always includes the PipeLoop Snap downstream of Prompt Generator Snap.
The second layer is comprised of worker pipelines. In worker pipelines, different purposes inform different pipeline designs. Worker pipelines perform different tasks including calling multiple tool pipelines. Therefore, worker pipelines do not have a set pattern since they can perform a range of tasks that necessitate their own design considerations.
A driver pipeline can call multiple worker pipelines, and a worker pipeline can call another pipeline, which calls another.
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.
- Tool pipeline: A pipeline that performs a specific task with limited scope via predefined parameters. It can be a function and call tools.
Drivers are loops, and the workers are the iterations. Worker pipelines are configured to call function pipelines to collect data. The prompt input is defined in the Agent pipeline, then sent to the Agent Worker pipeline, which is a function calling pipeline. Learn more.
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.
The following diagram shows the flow of tool pipeline:
This 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.