Sub-agents

In short

You can now create expert sub-agents. A main agent receives the user’s request and automatically routes it to the expert sub-agent for the relevant domain. Each expert sub-agent answers only based on its own instructions and the tools available to it. Your users ask their questions from their Studio or from a chatbot.

What’s new

  • Expert sub-agents: the main agent acts as a dispatcher. It analyzes each question and passes it on to the right expert sub-agent.
  • New Sub-agent tool type: in the “Tools” tab, the Sub-agent type lets one agent call another.
  • As many tools as you need per expert: each expert sub-agent can use different types of tools: Knowledge, API call, LLM, classifier, email, sub-agent. For example, an expert sub-agent can query its own document collection through a Knowledge tool, so its answers rely exclusively on the documents you’ve selected.
  • Access from the Studio or a chatbot: the whole setup is exposed through the API Connectors tab, which you select as the scope in the Studio or for your external chatbot.

Use case: an internal HR and legal assistant

Let’s take an organization that wants to give its Support team members a single entry point for their HR and legal questions.

ElementExample nameRole
Main agentSupport Team AssistantReceives the question and passes it to the right expert sub-agent
Expert sub-agentHR ExpertAnswers HR questions, following specific instructions
Expert sub-agentLegal ExpertAnswers legal questions, following specific instructions
Sub-agent toolCall HR ExpertLets the main agent call the HR Expert
Sub-agent toolCall Legal ExpertLets the main agent call the Legal Expert
Content collectionHR BaseContains the HR documents
Content collectionLegal BaseContains the legal documents
API connectorSupport Team Assistant ConnectorMakes the Support Team Assistant available in a Chatbot
API connectorSupport Team Assistant ConnectorMakes the Support Team Assistant available in the Studio

Step 1: Create the agents

In the “Agent” tab, create the following 3 agents and fill in their instructions.

AgentInstructions
Support Team AssistantYou are an assistant who forwards the user’s question to the appropriate expert, either HR or Legal.
– For all legal questions, call the ask_legal_expert tool with the user query.
– For all HR questions, call the ask_hr_expert tool with the user query.
HR ExpertYou are a senior human resources representative at Deeplink. Base your responses solely on the employee handbook and internal guidelines, cite the relevant section, and refer employees to HR for any personal matters.
Legal ExpertYou are a legal expert at Deeplink. You rely exclusively on the Terms of Service, contract templates, and the privacy policy. You must use the information from the knowledge base

At this stage, the agents don’t use any tools yet. You’ll add them in steps 4 and 5.


Step 2: Create the sub-agent call tools

On the “Tools” tab, click “+ Create” to create the following two tools, entering a name and description for each one.

FieldFirst toolSecond tool
NameAsk HR expertAsk Legal expert
DescriptionDelegate a question to the HR expertDelegate a question to the legal expert
TypeSub-agentSub-agent
AgentHR ExpertLegal Expert

Choose the “Sub-agent” type from the “Type” dropdown list. Then choose the agent from a second list, which shows the agents created in step 1.

The “Function Name” for internal tools is displayed automatically when the name is created. In this case: “ask_hr_expert”

For each tool, select the response mode in the “Terminal” column: check the box to have the expert’s response sent directly to the user, or leave it unchecked so that it appears

The tool’s description is what helps the main agent (Support Team Assistant) choose the right expert to answer the request.


Step 3: Create the knowledge tools

Go back to the “Tools” tab, click “+ Create” and create 2 new tools:

FieldFirst toolSecond tool
NameSearch HR knowledge baseSearch Legal knowledge base
DescriptionRetrieves information from the HR knowledge BaseRetrieves information from the Legal Database
TypeKnowledgeKnowledge
CollectionHR BaseLegal Base

Choose the “Knowledge” type from the dropdown list. Then choose the collection from a second list, which shows the collections you created beforehand (in the “Content” tab).


Step 4: Give each expert access to its own base

  1. In the “Agent” tab, click “HR Expert”.
  2. Scroll down and click “Add tool”.
  3. Add the “Search HR knowledge base“ tool.
  4. Repeat for “Legal Expert” with the “Search Legal knowledge base“ tool.

Each expert only has access to its own collection: the HR Expert can’t see the legal documents, and vice versa.


Step 5: Connect the main agent to its experts

  1. In the “Agent” tab, click “Support Team Assistant”.
  2. Scroll down and click “Add tool”.
  3. Add the “Ask HR expert“ tool.
  4. Add the “Ask Legal expert“ tool.

Step 6: Create the API connector

  1. In the “API Connectors” tab, create a connector and give it a name.
  2. Click the connector you just created.
  3. In the “Agent” dropdown list, choose “Support Team Assistant”.

Make sure you select the main agent, not one of the sub-agents: it’s the main agent that distributes the questions among the experts.


Step 7: Ask your questions in a Chatbot or in Studio

In Studio

  1. Open the “Studio”.
  2. In the prompt input settings, choose the scope.
  3. Select the “Support Team Assistant Connector”.
  4. Ask your question.

In a Chatbot :