Tutorial | Agent Hub#

Get started#

Imagine you work on the customer success team for a software company. You’ve used some customer data to build a traditional machine learning model that predicts customer churn.

However, not everyone on the team can easily access this data or has the technical knowledge needed to use prediction models.

As the company’s AI champion, you’ve been tasked with helping the team quickly find customer analytics, make ad-hoc predictions about their current customers using the model, and draft outreach materials for clients in danger of churning.

The solution: Agent Hub in Dataiku!

Agent Hub allows teams to interact with multiple AI agents, create new agents to help with productivity, and distribute agents to end users.

Let’s get started building a hub!

Objectives#

In this tutorial, you will:

  • Create an Agent Hub.

  • Interact with enterprise-grade agents.

  • Create a productivity-focused My Agent within the hub.

  • Orchestrate chats with multiple agents.

  • Track agent activities to ensure valid responses.

Prerequisites#

To complete this tutorial, you will need:

  • Dataiku 14.2 or later.

  • An Advanced Analytics Designer or Full Designer user profile, with rights to create projects. (Note: Those with an AI Consumer or AI Access profile can complete portions of this tutorial, as noted in relevant sections.)

  • If you have an AI consumer or AI Access profile, your administrator needs to grant you access to an Agent Hub instance.

  • A connection to at least one Generative AI model that supports tool calling and one that supports embedding. See supported models for tool calling and embedding (note that some models support both). Your administrator must configure the connection(s) in the Administration panel > Connections > New connection > LLM Mesh.

  • An internal code environment for retrieval augmented generation and agents. Your administrator must set this up in the Administration panel > Code Envs > Internal envs setup > Retrieval augmented generation code environment.

  • The Agent Hub plugin, which must be installed by your administrator.

Create the project#

  1. From the Dataiku Design homepage, click + New Project.

  2. Select Learning projects.

  3. Search for and select Agent Hub.

  4. If needed, change the folder into which the project will be installed, and click Create.

  5. From the project homepage, click Go to Flow (or type g + f).

Note

You can also download the starter project from this website and import it as a zip file.

Explore the enterprise agents#

Important

You must have an Advanced Analytics Designer or Full Designer profile to complete most of this tutorial. If you have an AI Consumer or AI Access profile, you can complete the steps starting with the Chat with the agents section, if another user has built the hub and shared it with you.

The project contains two agents built with Dataiku’s visual workflow.

  • Customer data agent: Searches two datasets of customer usage data to find customers that fit the user’s search criteria.

  • Churn prediction agent: Uses a traditional ML model built in Dataiku to make predictions based on a user’s input of customer data.

In this section, we’ll connect these agents to an LLM and learn how they work.

Build the Flow#

First, build the Flow to create the items so the agents can access the datasets and model.

  1. From the Flow, open the Flow Actions menu.

  2. Click Build all.

  3. Click Build to run the recipes necessary to create the items furthest downstream.

Screenshot showing how to connect agents to an LLM.

Connect to an LLM#

You must provide an LLM connection for the agents to complete their tasks.

  1. From the Flow, double-click on the Churn prediction agent to open it. (You can also go to the GenAI (GenAI icon.) menu > Agents & GenAI Models.)

  2. Click on v1.

  3. In the Config window, use the LLM dropdown menu to choose from your available LLM connections.

  4. Do the same for the Customer data agent. The LLM connection does not have to be the same for both agents.

Screenshot showing how to connect agents to an LLM.

Test the agents#

Let’s run some tests to ensure the connections are working and to familiarize ourselves with the agents’ tasks.

Customer data agent#

The Customer data agent is built with two tools that search datasets of customer usage data. The data includes columns such as the customer’s industry, the number of logins their users made in the last year, the average number of features their users accessed, and more.

A user can search both datasets using one or more criteria. The agent tools are instructed to return up to 10 results.

  1. In the Customer data agent, read the system message and tool descriptions in the Config section.

  2. In the Quick test window to the right, replace the text Put your query here with the following text:

Which customers in the Software & Technology industry have annual revenue over 40000?
  1. Click Run test.

Screenshot showing how to test the customer data agent.

Churn prediction agent#

The Churn prediction agent is built with one tool that uses a machine learning model to predict whether a customer will churn. The user can input one or more known factors about a customer, and the agent will respond with its best prediction of whether the customer will churn.

This time, let’s test this agent using a chat interface.

  1. In the Churn prediction agent, read the system message in the Config section.

  2. Navigate to the Chat tab to the right.

  3. Copy and paste this text into the chat:

My customer is in the education & nonprofit sector, has an annual revenue of about 10000 and an average satisfaction score of 6.7. Are they likely to churn?
  1. Send the chat.

Screenshot showing how to test the churn prediction agent.

As instructed, this agent returns the reasoning behind its prediction, which could be useful for the customer success team. It also returns some caveats, saying that the model’s confidence would be improved if it had more information about the customer.

Note

The responses from your agents throughout this tutorial might look different depending on the models used and can differ from run to run.

Set up Agent Hub#

Now that you have two working agents, let’s combine them in an Agent Hub and distribute them to the team.

Tip

For this tutorial, you are building Agent Hub in the same project as your agents. In a real-world scenario, it is good practice to create Agent Hub in a Dataiku project that is separate from your data pipeline and agents. This simplifies access and oversight of the Agent Hub.

Create the webapp#

To create an Agent Hub, start with the webapp template.

  1. Go to the Code (Code icon.) menu > Webapps.

  2. Click + New Webapp.

  3. Choose Visual webapp.

  4. In the New Visual Webapp menu, select Agent Hub.

  5. Give the hub a name, such as Customer success hub.

  6. Click Create.

Screenshot showing how to create an Agent Hub webapp.

Configure settings#

Next, add your LLM connections, agent projects, and other settings on the Agent Hub Edit page.

The hub requires you to configure at least three LLM connections of two different types — text completion and embedding models.

  1. In the LLMs section, click Add Text Completion Models and choose at least one model from your available options.

  2. Click on the dropdown under Embedding Model and choose at least one embedding model from your available options.

  3. Under Agent Hub LLM, choose a Text Completion Model. This does not have to be the same model as above.

  4. Ensure the Enable agents as tools option is activated. This will allow the Agent Hub LLM to use agents as if they were tools when multiple agents are active in a conversation.

Screenshot showing how to set up LLM connections in Agent Hub.

Configure Enterprise Agents#

Now, move to the Enterprise Agents section, where you can connect the agents from your project. Enterprise agents are typically created by cross-functional teams and pre-approved for distribution to end users.

In Agent Hub, you first select the project(s) to pull from, then the agents to include in the hub. You can also write descriptions that help the rest of the team understand and use the available agents.

  1. Click on the Enterprise Agents section on the left.

  2. Under Projects, search for and select this project ([TUT_AGENT_HUB] Agent Hub).

  3. In the Agents and Augmented LLMs dropdown, choose both available agents. They will appear below with more settings.

  4. Under the Customer data agent, enter the following:
    • Name: Search customer data

    • Description: Search data for current or former customers. You may search by customer name, industry, usage data, or average satisfaction score.

    • Queries examples: List the usage data for client Ferguson, Allen and Day. and What are some Energy and Utilities clients with annual revenue above 25000?

  5. Under the Churn prediction agent, enter the following:
    • Name: Predict customer churn

    • Description: Enter as much customer data as you know, such as industry, usage data, or average satisfaction score. The agent will use a model to predict whether the customer is likely to churn. The agent should also provide its reasoning to help you take action.

    • Queries examples: My customer is in the small tier, with annual logins of 1100, revenue of 15000, average features used of 5.2, and satisfaction score of 6.5.

Screenshot showing how to set up enterprise agent connections in Agent Hub.

Configure My Agents#

The next section, My Agents, is where you’ll configure settings for users to create their own agents within the hub. My Agents are typically productivity-focused agents to help individual team members with their tasks.

My Agents automatically embed documents, which helps the LLM develop specific knowledge and provide better responses. You’ll need to provide a folder where the documents can be stored and an embedding model to embed the documents.

  1. Click on the My Agents section on the left.

  2. Ensure the Enable My Agents option is enabled.

  3. Optionally, choose a Folder where User Agents will be created.

  4. Under File System Connection, choose a location for documents to be stored. This connection must allow managed folders.

Screenshot showing how to set up my agent settings in Agent Hub.

Configure the Backend#

Finally, you can also configure some Backend settings that dictate how the hub runs.

  1. Scroll down to the Backend section.

  2. Click the Auto-start backend box.

  3. For Container, choose None - Use backend to execute.

  4. Click Save and View Webapp.

Screenshot showing how to set up backend settings in Agent Hub.

Explore the hub#

You can now explore the interface of your Customer success hub!

In the center, you can start a conversation with your agents. In the left panel, you can navigate among available agents and chats.

  1. Click through each element in the left panel to explore the interface.

  2. In the Agents Library, note the two available Enterprise Agents from your project.

  3. Click on the Star on the Search customer data agent. This makes the agent a favorite and adds a new section of Favorite Agents to the library.

Screenshot showing the Agents Library.
Optional: Share with other users

As the AI champion, part of your responsibility is sharing access to Agent Hub with other users on the team.

To share the hub, first make sure the end users have at least read access to the Dataiku project(s) that include the enterprise agents. If a user doesn’t have access to the agent project, they won’t see those enterprise agents in their hub.

  1. In the top navigation bar, go to the More options (Horizontal dots icon.) menu > Security.

  2. In the User permissions section, grant at least Read project content permissions to users or user groups as you’d like.

Screenshot showing the security settings to share a project.

Now you can share the hub with users in those groups.

  1. Navigate back to the hub from the Navigation bar > Code menu (Code icon.) > Customer success hub.

  2. In the right panel, click on the Details (Details icon.) tab.

  3. Under URL, copy and paste the available URL.

  4. Share the link with end users.

Screenshot showing how to share the URL of an agent hub.

Chat with the agents#

Important

If you have an AI Consumer or AI Access profile, you can follow the tutorial steps starting with this section, provided that another user has completed the steps above and shared access to the hub with you.

A powerful feature of Agent Hub is providing users access to multiple agents — and orchestrating conversations with all of them.

With the Agent Hub setup complete, you can now chat with the enterprise agents to quickly access customer data.

Chat with one agent#

Let’s start with a simple conversation with one agent — a search of customer data that representatives on your team could use to quickly find relevant information for their accounts.

  1. Go to Start a new conversation.

  2. In the chat window, click on the Agents button and select the Search customer data agent.

  3. Copy and paste this question into the chat window, then send it:

How many logins did the Bennett Group have?
Screenshot showing a chat with the Search customer data agent.

The agent should respond with the answer from the customer dataset. You can check the agent’s sources to be sure it’s correct.

  1. Click on See details below the agent’s response in the chat window.

  2. Review the Sources on the right to see which dataset the agent searched and the relevant record it pulled.

Screenshot showing how to review an agent's response.

You can also chat directly with the churn prediction agent, which helps the customer success team identify accounts that might churn. This time, start the conversation a different way by going directly to the agent.

  1. In the left panel under Enterprise Agents, click on the Predict customer churn agent.

  2. Switch on the Show examples toggle. This brings up the example you added when setting up the hub. This is useful to show end users how the agent can be used.

  3. Copy and paste this question into the chat window, then send it:

My customer is in the Retail & CPG industry, has annual logins of 1500, revenue of 20000, and average features used of 7.8.
Screenshot showing chat with the churn prediction agent.

The agent responds with a prediction and reasoning, as its prompt instructs it to. In cases like this, where you provide limited details about the customer, it also asks for more information so it can provide a better prediction. It might also suggest next steps or offer to run the prediction again.

Screenshot showing a response from the churn prediction agent.

Chat with multiple agents#

You can also bring multiple enterprise agents into a single conversation to help increase efficiency and usefulness of responses.

When multiple agents are in use, the hub uses the Agent Hub LLM connection you specified to orchestrate the agents’ tasks. Think of it as a conductor that calls upon different agents at different times as needed, depending on the users’ input.

  1. Go to Start a new conversation.

  2. Copy and paste this question into the chat window, then send it:

Which customers have more than .8 probability of churning?
Screenshot showing a chat with both agents.

This time, because you did not choose an agent, the hub shows that you are chatting with both available enterprise agents.

The hub LLM decided which agent was most suited to answer the question — in this case, the Search customer data agent. The agent, in turn, found the answer in the customers_scored dataset that includes model predictions.

Screenshot showing results of a chat with both agents.

Note

To keep responses short, the agent instructions limited responses to 10 records from dataset searches.

Manage conversations#

Each time you start a new conversation, Agent Hub will give it a relevant title and add it under the Conversations section in the left navigation panel.

The hub should show three conversations so far, each named using specifics from the chats. You can rename or delete conversations to stay organized.

  1. Navigate to the Conversations section of the left panel.

  2. On the name of the current chat (with both agents), click on the More options (Horizontal dots icon.) menu.

  3. Select Edit Title.

  4. Rename the conversation Enterprise agents.

  5. Follow the same steps to rename the other chats Churn prediction and Data lookup respectively.

Screenshot showing results of a chat with both agents.

Now, you can easily navigate back to conversations with either or both agents!

Build a My Agent#

Agent Hub provides an interface to create agents called My Agents. These allow individual hub users to tailor agents that help with their individual tasks. Users can also share My Agents that might be useful for other team members.

Create a new agent#

For this customer success team, a useful My Agent could use internal company documents to draft customer outreach emails. You can upload documents directly in Agent Hub to build the agent’s knowledge.

  1. Go to Create new agent.

  2. Click on the pencil icon to rename the agent Draft value proposition emails.

  3. In the Agent instructions window, copy and paste the following instructions:

### 1. Persona
You are an expert Customer Success Representative. Your specialty is crafting persuasive and engaging emails that convince current customers to remain with the company. Your tone is strategic and focused on helping customers understand value to their company.

### 2. Core Objective
Your core objective is to draft outreach emails, tailored to a customer based on their industry, using the provided value propositions for specific industries.

### 3. Capabilities & Tools
You can work in coordination with other agents that predict customers that are vulnerable to churn. Your output email must be generated based on the provided value propositions and customer data.

### 4. Input Definition
Input will be customer names and industries. This input could come from other agents as the result of a user query, or it could come directly from a user query.

### 5. Process & Logic
1.  **Deconstruct the Inputs:** Begin by thoroughly analyzing the customer and value proposition. Identify the single most compelling benefit of the product that directly solves a primary pain point of the customer.
2.  **Develop the Core Message:** Formulate a central theme or "hook" for the email.
3.  **Strategize the Subject Line:** Brainstorm 2-3 distinct subject lines. They should be attention-grabbing, relevant, and create curiosity or urgency. Consider different angles (e.g., benefit-driven, question-based, direct offer).
4.  **Structure the Email Body:** Draft the email content following a logical flow.

### 6. Constraints & Guardrails
* You **must not** invent any product features, benefits, or pricing information that wasn't provided in the input.
* If crucial information (like a price or a specific link) is missing, use a clear placeholder, such as `[Insert Price Here]` or `[Your Website Link]`.
* Do not make unrealistic claims or guarantees about the value proposition. Ground all statements in the provided description.
* The final email must be focused entirely on the single core objective of reaching out to a customer that is in danger of churning..

### 7. Output Specification
Your response must be delivered in Markdown and structured in the following two parts:

**A. Email Strategy Rationale:**
A short paragraph explaining the strategic choices made for the email, including the selected angle, the reasoning behind the tone, and why the proposed subject lines are a good fit for the persona.

**B. Draft Email:**
The complete promotional email, ready to be copied and pasted. It must be clearly formatted with the following elements:
* **Subject Line Options:**
 * `Option 1: [Your first subject line]`
 * `Option 2: [Your second subject line]`
* **Email Body:**
 `Hi [Company name],`

 `[Email Body Content]`

 `[Call to Action Button/Link Text]`

 `Best,`
 `The [Company Name] Team`

Tip

You can also use instruction templates from the Prompt library, which includes ready-made prompts for industry-specific use cases, such as a copy writer assistant or research summarizer. Click on Access ready-made prompts to browse the options.

Add documents#

After creating instructions for the agent, you can add documents to enrich the agent’s knowledge or enable tools for it to perform specific tasks. Let’s upload some documents that the agent can use to communicate the company’s value proposition to customers.

  1. Download the pdf from this link and note where it’s saved on your computer.

  2. Under Agent Capabilities > Documents, click on Select documents.

  3. Upload the Value proposition PDF from your computer.

  4. Click Process document(s). This will embed the documents so the LLM can semantically understand them and provide specialized responses.

  5. In the Documents description window, copy and paste the following description:

These documents outline the value proposition of the product. They include:
   - An overview of the software company
   - Overall value proposition of the software product
   - Industry-specific value propositions of the product
These documents are used by the customer success team to communicate the value of the product to potential and current customers.
Screenshot showing steps to add documents to a My Agent.

Add Agent Overview#

The final step is to add an Agent Overview, which helps the hub LLM understand what the agent does and coordinate its role with other agents in the hub.

  1. Scroll down to the Agent Overview.

  2. Click the Auto-fill button. The hub LLM will generate an overview of the agent.

  3. After it’s done, review the results.

  4. If you’re not happy with the overview, you can copy and paste this text:

This agent takes input either from the user or other agents and drafts outreach emails to customers that are likely to churn. The emails incorporate value propositions from the provided documents.
Screenshot showing how to add the agent overview.

Test the agent#

Before publishing, you can chat with the draft agent to test its performance.

In the Test your agent chat window, copy and paste this query:

Draft an outreach email to a potentially churning customer in the Retail & CPG industry.
Screenshot showing how to test the My Agent.

After you’re happy with the performance of the agent, you can publish it to make it available in Agent Hub.

  1. Click on Publish in the top right.

  2. Click Publish again in the Publish Agent? window.

  3. After the job has finished, go to the Agents Library > My Agents to verify that the new agent is available.

Screenshot showing how to publish the My Agent.

Tip

After publishing your My Agent, it is available only in your hub. You can share it with other users or user groups by selecting the agent in the left panel and clicking on the More Options (Horizontal dots icon.) button, then Share.

Orchestrate multiple agents#

The hub now has three agents — two enterprise agents that were previously created by the organization and one My Agent that helps you in your specific tasks.

Putting them all together, you can use the enterprise agents to identify customers that might be in danger of churning, then use the My Agent to draft outreach emails.

Chat with all three agents#

To chat with all the agents, start a new chat without selecting any agents. The hub will automatically call the relevant agent(s) from all available agents.

  1. Go to Start a new conversation.

  2. Copy and paste the following question into the chat box.

My client is a construction firm with the following usage numbers:

Annual logins: 1200
Annual revenue: 25000
Average features used: 7.8
Average satisfaction score :6.2

What is their probability of churning? If it is higher than .6, draft an outreach email to them.
  1. Send the chat.

  2. As the response is processing, watch the area above the chatbox to see the different agents at work.

Screenshot showing a chat with all 3 agents.

In this case, the agent has predicted a .72 chance of churning and drafted an outreach email that suggests a ROI/business review meeting to help keep this account on track as a customer.

Screenshot showing the response from a chat with all 3 agents.

Understanding responses#

Though the agents seem to be providing useful responses, it is important to understand how it reached its decision and which agents and underlying information were used.

  1. Click on See details under the response.

  2. In the details window on the right, view the Sources, Activities, and Downloads.

Screenshot showing the details behind the response.

Because the agent didn’t call a dataset from the Flow, there are no sources available. The Activities tab shows that the hub used the Predict churn tool to answer the query.

Let’s try another query that will call a different agent.

  1. Copy and paste this query into the chat, then send it:

What are the usage statistics for Lewis LLC?
  1. After the agents respond, click on See details.

Screenshot showing the references behind the response.

This time, because the customer exists in a dataset searched by the Search customer data agent, the hub provides references to the dataset.

Next steps#

Congratulations on building your first Agent Hub and using multiple agents in a single workflow.

You can continue to chat with the agents in this hub or start building your own!