Task 1 — Create and ground an agent

Part of the Build and extend AI agents lab. New here? Start with Getting started.

What you need: a Microsoft Foundry project with a deployed model. Don’t have one yet? Complete Getting started first (Option A creates it in the portal). This task is completed entirely in the portal — no local code or .env file is required, so there’s nothing to carry over from other tasks.


Grounding gives your agent trusted source material so it answers accurately instead of guessing.

What is grounding?

The single most important capability for the Caldova agent is grounding. Grounding attaches trusted source material — such as the supply chain policy document — so the agent answers from that data instead of inventing a response.

You could copy policy details into the agent instructions, but that becomes difficult to maintain as the policy changes. File search keeps the instructions focused on the agent’s role while the policy remains a separate source that you can replace or update.

Learn more →

  1. In the agent playground, set the Instructions to:

     You are the Caldova supply chain assistant.
     You help planning and materials teams with questions about capacity, contract manufacturers, and materials.
    
     Guidelines:
     - Always be friendly and helpful
     - Use the supply chain policy documentation to answer questions accurately
     - If you don't know the answer, admit it and suggest contacting the support team directly
    
  2. Download the sample supply chain policy document. Open a new browser tab and navigate to:

     https://raw.githubusercontent.com/MicrosoftLearning/mslearn-ai-agents/main/Labfiles/A-build-and-extend-ai-agents/Python/Supply_Chain_Policy.txt
    

    Save the file to your local machine.

  3. Back in the playground, in the Tools section, select Add, and add File search.

  4. To the right of Add, select Upload files, browse to the Supply_Chain_Policy.txt file you downloaded, and select Attach. Wait for the file to be indexed.

  5. Save the agent.

Test your grounded agent

  1. In the chat pane, enter:

     How long does review take for a standard capacity request?
    

    The agent should reference the supply chain policy document in its answer.

  2. Try a second question to confirm it’s using the grounding data:

     How much is five weeks of premium contract capacity at expedited priority?
    

✅ Checkpoint: Your agent answers supply chain questions using the uploaded policy document. You’ve created and grounded an agent entirely in the portal.


Next: Task 2 — Connect a remote MCP server