← Back to Tutorials

7. Foundry IQ

Introduction to Foundry IQ

Foundry IQ combines agentic retrieval with intelligent ranking. Instead of simple keyword search, agents autonomously decide which knowledge sources to query and how to rank results.

Agentic Retrieval

Unlike static RAG, agentic retrieval lets the agent:

Ranking Techniques

TechniqueDescription
Semantic RankingRe-rank results by semantic similarity to the query
Hybrid RankingCombine vector similarity + keyword BM25 scores
LLM Re-rankingUse an LLM to judge relevance of each result
Reciprocal Rank FusionMerge ranked lists from multiple retrieval sources

Knowledge Base Setup

from azure.ai.projects import AIProjectClient

# Create a knowledge base connection
kb = client.knowledge_bases.create(
    name="company-docs",
    description="Internal company documentation",
    storage_connection_string=conn_str,
    search_endpoint=search_endpoint,
    chunk_size=512,
    overlap=64
)

# Attach to agent
agent = client.agents.create_agent(
    model="gpt-4o",
    name="IQAgent",
    knowledge_bases=[kb.id]
)

Creating Agents via Portal & Python

You can create IQ agents either through the Foundry portal (no-code) or programmatically via the SDK (as shown above).

✏️ Exercise: Create a knowledge base from a set of internal documents. Build an agent with Foundry IQ that can answer questions across multiple knowledge bases. Test queries that require combining information from two different sources.