How can I retrieve RAG references/citations via the Azure AI Projects (Foundry) agent API?

AQ 20 Reputation points
2025-12-02T16:55:25.23+00:00

I’m following the official sample: https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/knowledge-retrieval?view=foundry&tabs=foundry%2Cpython#create-an-agent-with-the-mcp-tool

Setup:

  • Agent via PromptAgentDefinition (model gpt-4.1)
  • MCP tool: knowledge_base_retrieve pointing to an Azure AI Search knowledge base (.../knowledgebases/
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Aryan Parashar 3,380 Reputation points Microsoft External Staff Moderator
    2025-12-03T09:35:20.8866667+00:00

    Hi AQ,

    I understand this process can be a bit involved, so I want to outline the steps clearly.

    First, you need to add your files for RAG in a Blob Storage.

    Then, add your blob as a data source in the Azure AI Search resource as shown below:
    User's image

    After that, you have to add your blob as a knowledge source as shown below:
    User's image Then you have to create a knowledge base using a model deployed in your Azure OpenAI resource and test it as shown below:
    User's image

    As I verified on my end that the knowledge base successfully retrieves RAG references/citations from the blob, you should be able to obtain the same results by following these steps and using the knowledge base as an MCP tool via the Azure AI Projects (Foundry) Agent API, together with the documentation link you are already using.

    Please accept this as an answer.
    User's image

    Thank you for reaching out to The Microsoft Q&A Portal.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.