Lab 2: Deploy and test your agent
Overview
Now that we have tested our agent within Studio, is time to deploy it to Anypoint Cloudhub so we can plug it into our agent UI.
Step 1 - Deploy the agent
- Right click on your AI application in Package Explorer and then select Anypoint Platform -> Deploy to Cloudhub  
- Select - Microin Replica Size and click on Deploy Application- If your deployment fails with the error - The asset is invalid, Error while trying to set type: app. Expected type is: rest-api.open the- pom.xmlfile and change the value of- artifactIdby, for example, adding- -v1.0to the existing value.
- Once the deployment is completed, click on Open in Browser in the Deployment popup:  - You should already be logged in… 
- If prompted choose the Sandbox environment and select your application 
- Make sure to click on your application name and copy your application’s endpoint:  
Step 2 - Put your agent to work for you
- Now open the Agent UI application 
- Paste your public endpoint in the Agent URL text box that you will find at the top of the page  - Ensure that the URL includes the - /api/chatpath. For example:- https://nb-ai-agent-api-1s3mvo.5sc6y6-4.usa-e2.cloudhub.io/api/chat
- Test your agent by asking “What are my orders? My customer ID is 23232”  - You might get a slightly different output but that’s to be expected given the non-deterministic nature of Generative AI. The most important thing to note is that the response should provide a list of orders! 
Congratulations!
You just built your first AI agent grounded in your business data!
Conclusions
In this module you have learned how easy it is to create AI agent that don’t just provide generic answers but are capable of answering questions grounded in your business data. The agent you built in this module only scratched the surface of what can be achieved by leveraging the MuleSoft AI Chain together with all other MuleChain open source connectors that can be found at https://mac-project.ai/