Learning by Patrik

Build knowledge-enhanced AI agents with Foundry IQ | AI-103 | Episode 10

An LLM cannot inherently access your private or newly created data. RAG (Retrieval-Augmented Generation) solves this by retrieving relevant information at runtime and supplying it as context for a grounded, citation-backed response.

Foundry IQ = managed knowledge for agents

Foundry IQ provides reusable knowledge bases backed by Azure AI Search. Multiple agents can use the same knowledge base, while agentic retrieval can select sources, execute searches, rank results, and return relevant content with citations.

Know the three source patterns:

Type How it works Think
Indexed Data is ingested, chunked, vectorized and indexed before queries Azure AI Search, Blob, OneLake
Direct Agent accesses an external source without first copying it into the search index External/remote source
Real-time Source is queried at runtime for current information Web, remote SharePoint

Key trade-off: indexed data gives fast, optimized retrieval; direct/real-time access favors freshness and avoids maintaining another indexed copy.

Instructions control retrieval

Connecting knowledge isn't enough. Effective agent instructions define three critical behaviors:

  1. When to retrieve → e.g. always consult the knowledge base for product questions.

  2. How to cite → require attribution to retrieved sources.

  3. What to do when retrieval fails → say the information wasn't found rather than inventing an answer.

# Mental model — not full SDK code

agent.instructions = """
For product questions:
1. Search the knowledge base.
2. Cite retrieved sources.
3. If nothing relevant is found, say so.
"""

response = agent.run("Which tents are weatherproof?")
# Agent → Foundry IQ → source → grounded answer + citations

Remember: LLM = reasoning/generation; Foundry IQ = managed knowledge layer; knowledge base = reusable collection of sources; instructions = rules governing when and how that knowledge is used.

FoundryIQ
RAG
Grounding
Agents
Retrieval

Comments