Grounding on real sources
Already wiring web, SharePoint and file search with citations? Skip to the next lesson.
Last lesson you searched one small set of documents. Real questions need several sources, and every claim needs to point back at one.
The idea
Grounding means every statement your agent makes can be traced to something it actually read. Not "the model is fairly sure", but "here is the page it came from".
Three sources cover most workplaces:
- The web, for public information. Cite with a link.
- SharePoint, which is where most companies keep internal documents. Cite with a link to the page.
- Your own files, on disk or in cloud storage. Cite with the file path.
Keep them as three separate tools rather than one. They have different permissions and different trust levels, and when an answer is wrong you want the trace to tell you which one it came from.
A citation is a promise
A citation is only worth something if someone can follow it. That means a locator: a URL, a link, a path. A snippet with no locator is just a sentence you cannot check, and lesson 0.3 showed you exactly how convincing an unverifiable sentence can be.
The format here is [web] title (url): snippet, so the next turn can reuse it.
What to write
cite(kind, title, locator, snippet)to build the citation stringsearch_web,search_sharepointandsearch_files, each returning acite(...)stringTOOLSandexecute_toolfor all three- The agent loop, with
tools=TOOLSanddeployment=AZURE_DEPLOYMENT
The point
If you cannot point at a source, you do not know. You are guessing politely.
Break it on purpose
Return bare snippets with no locator. The check fails for missing sources, and the answer still reads perfectly well. That is the danger.
Check yourself
Answer out loud first. Reading the answer without trying is where the learning leaks out.
1. Why keep web, SharePoint, and files as separate tools?
2. What belongs in a citation besides the snippet?
3. Who runs the search, the model or your code?