Skip to content

Agent registry

Use Agent

{{ maistro | template : "agentName" }}
Imports the contents of agentName into the current environment.

Example Usage 1

Given an example agent, neuralseek_updates:

Based on the changelogs found here:
{{ web|url:"https://documentation.neuralseek.com/changelog/" }}
list the items for the latest month.
{{ LLM }}

Simply using {{ maistro | template: "neuralseek_updates" }} will produce the sample result.

Example Usage 2

To pass parameters to mAIstro agents, you simply define the variables in your current environment.

Given an example agent, neuralseek_updates:

Based on the changelogs found here:
{{ web|url:"<< name:'url' >>" }}
list the items for the latest month.
{{ LLM }}

To pass the url variable to the agent:

{{ variable  | name: "url" | value: "https://documentation.neuralseek.com/changelog/" }}

{{ maistro | template : "neuralseek_updates" }}

This allows agents to be brought into current context, effectively "splicing" the contents into the desired context.


Use Agent (Sandbox)

{{ maistroSandbox  | template: "agentName" | params: "jsonParams" }}

Executes the specified agentName in the current environment, returning only the agent's final output.

Example Usage 1

Given an example agent, video_loop:

Based on this description, extract a list of objects from the video:
{{ maistroSandbox  | template: "video_loop" | params: "" }}
{{ LLM  | prompt: "" | cache: "true" }}

Simply using {{ maistroSandbox | template: "video_loop" }} will only use the result within the sandboxed agent with something like:

Based on the description provided, the list of objects present in the video is:
Hands
Knitting needles/Crochet hooks
Textured fabric/Textile project
Mug/Cup
Coaster/Small mat
Crocheted/Knitted items
Couch/Chair
Blanket/Sheet
Example Usage 2

Let's consider an example agent called generate_user_card that creates a simple user presentation card:

{{ LLM | prompt: "Create a simple user info JSON to render in a presentation card" | cache: "true" }} => {{ extractCode }} => {{ variable | name: "userInfoJson" | mode: "" | value: "" }}
{{ maistroSandbox | template: "generate_user_card" | params: "{\"userInfo\": \"<< name: userInfoJson, prompt: false >>\"}" }}

In this example, the generate_user_card agent takes the userInfoJson parameter and processes it in a sandboxed environment. You can achieve the same result by using:

{{ maistroSandbox | template: "generate_user_card" | params: "{\"userInfo\": \"<< name: userInfoJson, prompt: false >>\"}" }}

This will pass the userInfo parameter to the sandboxed agent, resulting in the creation of a presentation card similar to the one shown below:

Card Example


Select Agent

{{ selectAgent | registry: "registryName" | query: "specifyQuery"  }}

Allows you to choose an agent from a specified registry based on a given query. This functionality is essential for automating task delegation by dynamically selecting the most appropriate agent for a task.

Parameters

  • Registry: The Agent Registry to select from
  • Query: The query used to identify the correct agent

Returns

  • The selected agent name

Before using the 'Select Agent' node, ensure you have completed the following setup steps:

  1. Create a Registry: Establish an Agent Registry that will house your agents.

    Agents Registry

  2. Attach Agents to the Registry: Ensure that all relevant agents are properly attached to the registry.

    Agents Attached

After the registry and agents have been set up, you can use the 'Select Agent' node to specify a registry and query:

Example Usage 1

Suppose you have an agents registry named digital_tasks with agents assigned to various tasks. You need to find an agent to handle the query "Send approved pull request email".

{{ selectAgent  | registry: "digital_tasks" | query: "Send approved pull request email" }}

The node identifies send_email as the most suitable agent for the task:

send_email

Once the agent is selected, you can store its name in a variable and use it in subsequent nodes like 'Use Agent':

{{ selectAgent  | registry: "digital_tasks" | query: "Send approved pull request email" }}=>{{ variable  | name: "selectedAgent" }}
{{ maistro  | template: "<< name: selectedAgent, prompt: false >>" }}

This process enables seamless task execution by dynamically selecting and utilizing agents based on your workflow requirements.


Select Agent Plan

{{ selectAgentPlan | registry: "registryName" | query: "specifyQuery"  }}
Allows to retrieve an ordered list of agents from a specified registry based on a provided query. This node functions similarly to the 'Select Agent' node and accepts the same parameters.

Parameters

  • Registry: The Agent Registry to select from
  • Query: The query used to identify the correct agent

Returns

  • An ordered list of selected agent names
Example Usage 1

Suppose you have an agent registry named digital_tasks. You want to retrieve agents capable of performing the following tasks in sequence:

  • Send an approved pull request email
  • Fetch posts data
  • Extract objects from a video
{{ selectAgentPlan  | registry: "digital_tasks" | query: "Send approved pull request email, fetch posts data and extract objects present in video" }}

The output will be an ordered string array of agent names:

["send_email","fetch_posts_data","subrun_video_extraction"]

Once the agents are selected, you can store them in a variable and use them in subsequent nodes, such as the 'Use Agent' node, to execute each task in a loop:

{{ selectAgentPlan  | registry: "digital_tasks" | query: "Send approved pull request email, fetch posts data and extract objects present in video" }}=>{{ variable  | name: "selectedAgents" }}
{
"agentsList": << name: selectedAgents, prompt: false >>
}=>{{ jsonToVars  }}
{{ variableLoop  | variable: "agentsList" | loopType: "" }}
{{ maistro  | template: "<< name: loopValue, prompt: false >>" }}
{{ endLoop  | sleep: "0" }}