Challenge 03 - Rise of Agent Optimus

< Previous Challenge - Home

Pre-requisites

Introduction

In Challenge 01, you observed how Agent Mole had to dig around blindly in your data on almost EVERY query to discover your data before it could answer. In this challenge, we’re going to create a new agent named “Agent Optimus” that will not be running blind!

The AI Index you created in Challenge 02 exposes several new MCP tools, all prefixed with platform.context_engine.*:

These new tools will give Agent Optimus the vision it needs to understand your data before retrieving it! The Knowledge Indicators in the AI Index provide a rich natural language description of your data and how to query it. In theory, this should reduce the work it takes for Agent Optimus to build context and figure things out on its own.

Description

You have already built Agent Mole in Microsoft Foundry. This challenge repeats most of those steps to create Agent Optimus, but with a slightly different tool configuration and System Prompt. Then you will measure whether the context-first approach changes how the new Agent Optimus behaves.

Create Agent “Optimus”

You are a customer-success analyst for Precision Labs. 
Answer questions about accounts, support tickets, and knowledge-base articles using the data available to you. 
Show your reasoning. 
Before querying data, retrieve relevant Knowledge Indicators to learn which index to use and what fields mean. 
Your Knowledge Indicators are in AI Index precision-corpus (ES|QL target: ai-index-idx-precision-corpus). 
KI fields: type (index_metadata or playbook), title, content. 
Go directly to query_ai_indices — skip list_ai_indices, describe_ai_index, list_indices, and get_index_mapping. 
The KIs already tell you the index names and schemas.

Note that this system prompt guides Agent Optimus to use the new AI Index and Knowledge Indicators. We’ll come back to this fact after the next step.

Connect Agent “Optimus” to Elastic

Since you connected Agent Mole to Elasticsearch using the same project in Foundry during Challenge 01, the same connection should be available in Foundry under Tools.

Foundry connects the Web search tool by default when creating a new agent. We want to restrict the agent to only data from Elasticsearch, therefore, you should remove it.

NOTE: If you do not see your Elasticsearch connection under “Recently Used”, review the instructions in Challenge 01 for connecting to the Elastic MCP server.

When connecting an agent to Elasticsearch via MCP, by default ALL of the tools available in your Elasticsearch instance are available to the agent.

In the agent’s Instructions, we used the system prompt to guide Agent Optimus to use the AI Index and Knowledge Indicators. If we do not guide the agent, its LLM could decide to call the platform.core.* tools for discovery instead of the new AI Index tools.

NOTE: This applies for Agent Mole too! There’s nothing preventing Agent Mole from seeing and accessing the new platform.context_engine.* tools you created in Challenge 2. If you go back and re-read/inspect Agent Mole’s system prompt, you’ll see that we gave it instructions to NOT use the AI Index tools (which didn’t exist when you implemented Agent Mole, but we knew not to let Agent Mole try anything funny like that!)

Microsoft Foundry allows you to configure the MCP connection to allow the agent access to only specific tools. This is a stricter way of controlling tool access than with only a system prompt.

platform_context_engine_list_ai_indices, 
platform_context_engine_describe_ai_index, 
platform_context_engine_query_ai_indices, 
platform_core_execute_esql, 
platform_core_generate_esql

WARNING: The Foundry tool configuration only accepts tool names with letters, numbers, hyphens, and underscores. The Elasticsearch tool names in Kibana contain periods (i.e.platform.context_engine.list_ai_indices). The periods are converted to underscores via MCP. We have already done the conversion so you can copy/paste the list above without any headaches.

NOTE: The “allowed tool list” configuration only applies to the current agent (Agent Optimus). If you want to restrict Agent Mole from calling the new context engine tools, you will need to open Agent Mole and give it a different list of tools to allow.

Test Agent “Optimus”

Prioritize At-Risk Customers

Which Enterprise accounts have the highest churn risk, and what are they mostly calling us about?

Support Tickets: Unresolved Integration Issues

Which Enterprise accounts renewing in the next 60 days have open critical tickets, and which knowledge base articles cover their issues?

Financial Impact of at risk customers

What is the total ARR of the five accounts you just listed?

Observe Agent “Optimus”

Success Criteria

Learning Resources

Tips

Advanced Challenges