LoopAI-103

Before you start

Short explainers for ideas this lesson builds on. Watch these first if they're new to you.

0 of 2 watched · about 4 min

Go deeper

Unlocks when you've watched the lesson.

0 of 1 watched · about 2 min
Read this lesson

Your own documents

The file search tool lets your model read from documents you've uploaded while it answers. It's built for questions about your own private or specialist material: policy documents, manuals, contracts, and the notes your team keeps internally. Rather than guessing from general training, the model searches an index of your files and answers from what it finds, which is what you want when the right answer lives in a trusted internal document. What you get: answers grounded in your uploaded files; semantic retrieval, which matches passages by meaning, so asking about a cab finds the paragraph on taxis; vector store integration, to search one indexed collection or several; citations, showing which results matched, for debugging and tracing; and enterprise relevance, because it draws on your organization's own knowledge. Picture an HR assistant answering staff questions from policy PDFs, a support bot pulling up troubleshooting steps, a legal reviewer finding one clause across fifty contracts, or a helper that summarizes technical docs.

How it works

Start by creating a vector store, a searchable collection that splits your files into small chunks and stores each one with its embedding, say, policy docs, and upload a file into it, like an expenses policy PDF. Then call responses dot create with a file search tool that lists your vector store IDs. If you like, ask for the file search results to be included in the response too. Now ask, what's the most I can claim for a taxi ride, and the model searches the indexed policy and answers from the passages it pulled out. Step by step: the files go into a vector store first. Your request carries the file search tool and the store IDs. The model searches the indexed chunks for anything relevant. The best-matching passages are slipped into the model's context, like sticky notes on its desk. And the model writes its answer from those passages.

Practices and limits

For the best results, feed it clean, up-to-date files. Ask focused, specific questions, so the search doesn't grab the wrong passage. Keep vector stores tidy, with separate ones for areas like HR, legal, and finance when that helps. While you're building, include the retrieval results, so you can see what it found. And keep a person in the loop for critical work. Now the limits: answers are only as good as your documents, how much they cover, and how well the chunks match the question. A huge store that mixes many topics can hand back context that's less on point. When you update a file, it may need re-indexing before the new text can be found. And better grounding still isn't a substitute for human review on sensitive decisions. Used well, file search turns a general model into an assistant that knows your domain. And for enterprise agents that draw on lots of data across many stores, look at a Foundry IQ knowledge base, connected to a Microsoft Foundry agent.

Facts from Microsoft's documentation: File search tool for Microsoft Foundry agents; Vector stores for file search in Foundry Agent Service (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. The coding lab is based on code samples in Microsoft's Azure AI documentation (MicrosoftDocs/azure-ai-docs, MIT License; notice). Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.