Retrieval, Indexing and Agent Memory Choices
30-second answer
Put curated company content in a Foundry IQ knowledge base on Azure AI Search, which can use keyword, vector, hybrid (best default) and semantic ranking, and agentic retrieval to plan sub-queries. Use file search for files a user uploads in a conversation. Use memory for what the agent learns about a person across sessions: user profile memory and chat summary memory, scoped per user. Plan indexing with indexers (pull) or the push API, chunking and integrated vectorization. Connect other tools with MCP, OpenAPI or functions. Knowledge answers "what's true here", memory answers "what do we know about this person".
Simulate it » No Azure account neededExam objective: 1.1.3 Choose an appropriate method for retrieval and indexing. 1.1.4 Choose appropriate memory, tool and knowledge integration services for agent solutions. (Skills measured as of April 16, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Open <strong>Build ➜ Knowledge</strong> and create a knowledge base for the company policies.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Open Build ➜ Knowledge and create a knowledge base for the company policies.
- Pick the knowledge sources (an existing search index, blob storage, SharePoint or the web) and the search service. Reasoning effort trades speed for better query planning.
- On the agent: attach kb-policies for curated company content, turn on file search for files users bring, and turn on memory for what it should remember about each user.
- Memory is long-term: it extracts facts, consolidates them and recalls them in later sessions. Scope it per user and set a retention so it forgets on schedule.
- Test it. The second week, the agent still knows the user is vegetarian, and it cites the policy for the refund answer.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Where an agent gets its facts
Curated company content lives in a Foundry IQ knowledge base on Azure AI Search. Files a user drops into the chat go to file search. What the agent learns about the user across sessions goes to memory (user profile, chat summary).
🤔 What happens if…
Read this tour as text
- Pick the right model or tool. A router in your app sends each job to the cheapest thing that does it well: a reasoning model for multistep problems, a small language model for high-volume labelling, a multimodal model for photos, and a Foundry Tool such as Content Understanding for invoices.
- Where an agent gets its facts. Curated company content lives in a Foundry IQ knowledge base on Azure AI Search. Files a user drops into the chat go to file search. What the agent learns about the user across sessions goes to memory (user profile, chat summary).
- Resource, projects and deployment types. One Foundry resource holds deployments, networking and keys. Projects inside it isolate teams. Global deployments may process anywhere, Data Zone stays in the EU or US zone, Standard stays in one region. The standard agent setup keeps threads, files and vectors in your own Cosmos DB, Storage and AI Search.
- Configure deployments and agent versions. A deployment pins a model, a model version, a deployment type, capacity (TPM) and a guardrail. An agent gets a new version every time you change it; the endpoint serves the version you choose, so you can roll back.
- CI/CD with an evaluation gate. The agent definition, prompts and Bicep live in Git. The pipeline signs in with workload identity federation (no secret), runs an evaluation on a test set, and only then promotes from dev to test to prod projects.
- Quotas, 429s, spillover and budgets. Quota is tokens per minute per model, per region, per deployment type. Each deployment gets a slice; RPM comes with it. Go over and you get HTTP 429 with a retry-after header. Provisioned throughput can spill over to a standard deployment, and a cost control can stop a project at its token budget.
- Monitor models, agents and search. Azure Monitor metrics show requests, tokens, latency and errors. Application Insights holds traces, and continuous evaluation scores a sample of live answers for groundedness and safety. For Azure AI Search, watch indexer runs, document counts, search latency and throttled queries.
- Keyless and private. The app uses a managed identity and Microsoft Entra ID tokens, with the Foundry User role on the resource. Local (key) auth is turned off. Public network access is disabled and a private endpoint in your VNet is the only way in.
- Guardrails at four intervention points. A guardrail is a set of controls: a risk (hate, violence, prompt attacks, indirect attacks, protected material, PII), the intervention point (user input, tool call, tool response, output) and the action (annotate, or annotate and block).
- Evaluate, red team and trace. Evaluators score answers: groundedness, relevance, coherence, safety, and agent ones like tool call accuracy and task adherence. The AI red teaming agent attacks before launch. Traces in Application Insights record every model call, tool call and approval for audit.
- Govern what the agent may do. Give the agent only the tools it needs (allowed tools), make risky tools require approval from a human, let the tool call guardrail check what it sends, and limit where a hosted agent can connect with network egress controls.
Contoso's support agent has four jobs and a memory problem. Pick the right model or Foundry Tool for each job, build a knowledge base for policy answers, and fix an agent that forgets its customers.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
The agent forgets customers between chats and makes up policy details.
😊 THE SOLUTION
Ground it on a knowledge base, let it search uploaded files, and give it long-term memory.
- Invented policy answers✓ A Foundry IQ knowledge base on Azure AI Search
- A user’s own contract✓ File search over that upload
- “I told you last week”✓ User profile memory
Start with a question
Should the shop assistant remember your name, or read the refund rules from the wall?
A good assistant does both, and keeps them apart. The refund rules are on the wall for everyone. Your name and your dislike of coriander are in the assistant’s head, for you alone.
An AI agent needs the same split. The wall is a knowledge base that anyone can read and the company controls. The assistant’s head is memory, filled in as it talks to each person. Mix them up and you get an agent that invents policy or forgets the customer.
Explain it like I’m 10
The technical explanation
Retrieval methods on Azure AI Search
| Method | What it matches | Use it for |
|---|---|---|
| Keyword (full text) | Exact words with BM25 ranking | Codes, names, part numbers |
| Vector | Meaning, using embeddings | Questions worded differently from the document |
| Hybrid | Keyword and vector, merged | The usual default for RAG |
| Semantic ranker | Re-orders the top results by meaning | Better order, captions, answers |
| Agentic retrieval | A model plans sub-queries and runs them in parallel | Multi-part questions over several sources |
A Foundry IQ knowledge base wraps agentic retrieval. You add knowledge sources (an existing search index, Blob Storage, SharePoint or the web), choose how much reasoning effort the query planner uses, and agents call the knowledge base as a tool. The agent gets grounded passages with citations.
Plan the indexing
- Source: Blob Storage, Azure SQL, Cosmos DB, SharePoint, or your own app.
- Ingest: an indexer pulls on a schedule and tracks changes, or you push documents through the API.
- Chunk the text so a piece is small enough to retrieve and to fit in the prompt. Overlap chunks a little so sentences aren’t cut off.
- Vectorize with an embedding model. Integrated vectorization does chunking and embedding for you during indexing and at query time.
- Enrich with metadata (department, effective date, language) so you can filter, and so retrieval can skip retired content.
- Refresh on a schedule, and deal with deletions, or the agent quotes yesterday’s policy.
Other ways an agent gets information
- File search: a vector store built from files a user uploads in a conversation (or you attach to the agent). Good for one person’s contract, not for company-wide content.
- Azure AI Search tool: point the agent straight at an index you already built.
- Web search (grounding with Bing): fresh public information.
- MCP servers, OpenAPI tools and functions: live data and actions from other systems.
Memory
| Memory type | Holds | Example |
|---|---|---|
| User profile | Stable facts and preferences | “Vegetarian”, “prefers email” |
| Chat summary | A summary of each past conversation | “Asked about a refund on order 48213” |
Scope memory to a user (for example {user_id}), set a retention time, and let the user see and delete it. Memory is in preview in Foundry as of 25 November 2026, so check Microsoft Learn before you rely on the details.
Architect level Why pure vector search isn't enough
Embeddings capture meaning, so “can I get my money back” finds the refund page. They’re weak at exact strings. Search for “PCI-07” and a vector index may return other compliance pages that feel similar. Keyword search nails the exact code. Running both and merging is cheap insurance, and the semantic ranker then puts the best passage first.
Real-world business scenario
Fabrikam Foods (fictional)
- The problem
- The support agent quoted a refund policy that ended last quarter and asked returning customers about dietary needs they'd already given.
- What they used
- A Foundry IQ knowledge base over the policy library in Blob Storage with a nightly indexer and an effective-date filter, file search for order receipts, and user profile memory scoped to each signed-in customer.
- Why that choice
- The indexer removed retired policies and kept the library current. Memory carried preferences across sessions, and the two stores stayed separate, so policy never ended up in a customer's profile.
- The result
- Wrong-policy complaints fell sharply, and customers stopped repeating their dietary needs in every chat.
When to use it and when not to
✓ Use it when…
- Answers must come from company documents, with citations.
- Users ask a mix of exact-term and plain-language questions (hybrid).
- The agent serves returning users whose preferences matter.
✕ Think twice when…
- You store personal preferences in the shared knowledge base.
- You index once and never refresh or delete.
- You turn on memory without a user scope, retention time or a way to delete.
↔ Alternatives to consider
- File search when the content belongs to one conversation.
- Web search grounding for public, fresh facts.
- A database tool or MCP server when the answer is a live record, not a document.
Test yourself with exercises
5 original practice questions in the AI-103 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the difference between knowledge and memory for an agent?
Model answer
Knowledge is what's true for everyone, like the refund policy, and it comes from a knowledge base or search index. Memory is what the agent learned about one person, like "she's vegetarian". Knowledge is curated by the company. Memory is built from conversations and scoped to the user.
Intermediate Why hybrid search for a policy assistant?
Model answer
Keyword search is great for exact terms like "PCI-07" or a part number, and vector search is great when the user words it differently from the document. Hybrid runs both and merges the lists, so I get both kinds of hit. Adding the semantic ranker then orders the top results by meaning.
Experienced developer How do you decide between an indexer and pushing documents yourself?
Model answer
If the data lives in a supported source such as Blob Storage, SQL or Cosmos DB, an indexer handles scheduling, change tracking and skills for me. I'd push through the API when the data comes from my own app and needs near real-time updates, or the source isn't supported.
Scenario Users complain the agent forgets their allergies, and sometimes quotes a retired policy. What do you change?
Model answer
Two separate fixes. For allergies, I'd turn on user profile memory scoped to the signed-in user. For the retired policy, I'd fix the index: a scheduled indexer that notices deletions, and metadata such as effective date so retrieval can filter. Memory can't fix stale knowledge, and a fresh index can't remember a person.
Quick revision
Key points
- Knowledge bases (Foundry IQ on Azure AI Search) hold curated company content and return cited passages.
- Hybrid search with semantic ranking is the usual strong default. Pure vector misses exact terms.
- File search covers files a user uploads in a conversation, without a separate index build.
- Memory is per user (user profile and chat summary). Knowledge is shared and curated.
- Index with an indexer for supported sources, or push through the API. Chunk, and enrich with metadata.
Important terminology
- Hybrid search
- A query that runs keyword and vector search together and merges the results. Usually the best starting point for retrieval-augmented generation.
- Semantic ranker
- An Azure AI Search feature that re-ranks the top results by meaning and can return captions and answers.
- Agentic retrieval
- A retrieval mode where a model plans sub-queries from a conversation, runs them in parallel and returns grounded passages. It powers Foundry IQ knowledge bases.
- Chunking
- Splitting documents into pieces before indexing so each piece is small enough to retrieve and fits the model's context.
- Integrated vectorization
- An Azure AI Search feature that chunks content and calls an embedding model during indexing and at query time, so you don't write that code.
- Agent memory
- A store of information the agent learned about a user across sessions, such as preferences. Separate from knowledge, and scoped to one user.
Common mistakes
- Using memory to store company policy, or a knowledge base to store personal preferences.
- Pure vector search for part numbers and codes.
- Building a one-off index and never scheduling refreshes, so answers go stale.
Exam tips
- "Exact codes and meaning-based matches" = hybrid search.
- "User uploads a file in chat" = file search.
- "Remember preferences across sessions" = memory, scoped per user.
- "Plans sub-queries over several sources" = agentic retrieval / a Foundry IQ knowledge base.
Five quick revision questions
-
1.Which search mode combines keyword and vector results?Show
Hybrid search.
-
2.Where do company policies belong for an agent?Show
In a knowledge base on Azure AI Search (Foundry IQ).
-
3.Which agent feature handles a user's own uploaded file?Show
File search.
-
4.What are the two kinds of memory most agents need?Show
User profile memory and chat summary memory.
-
5.What does chunking do?Show
Splits documents into small pieces for indexing and retrieval.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Foundry Infrastructure and Deployment Options
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.