December 5, 2026
RAG inside Outlook: a location aware AI assistant that cut HR response time by 50%
HR teams answer the same questions every day. How much annual leave can I carry over? What is the policy on working abroad? How do I claim training expenses? The answers are written down in policy documents, but finding the right paragraph and turning it into a polite reply takes time.
There is an extra twist when an organisation operates in several countries and one shared HR team serves all of them. The same question can have a different correct answer depending on where the employee is based. Leave entitlement in one country is not the same as in another.
I built an AI powered Outlook add-in to handle this. It reads an incoming employee email, works out where the sender is based, finds the policy that applies to that location, and drafts a grounded reply inside Outlook for the HR person to review and send.
• Supports 200+ employees across 5 departments
• 50% faster HR response time
• 80% less manual drafting effort
WHY AN ADD-IN, NOT A CHATBOT
HR staff already work in Outlook, and employees already email HR. A chatbot would have asked both groups to change their habits. An add-in puts the AI exactly where the work happens: open an email, click once, and a draft appears beside it. That did more for adoption than any feature.
THE ARCHITECTURE
The diagram at the top of this post shows the full flow.
• Outlook add-in: React and TypeScript with Office.js. Reads the open email and inserts the draft reply.
• Backend API: orchestrates each request.
• Microsoft Graph: the organisation's directory, used to find the sender's country and office.
• Azure AI Search: returns relevant policy passages, filtered by location.
• Azure OpenAI (GPT-4): drafts the reply from those passages only.
• Azure Blob Storage: stores the HR policy documents, each tagged with the location it applies to.
Request flow:
1. Where is the sender? Microsoft Graph looks up the sender's profile, including country and office location.
2. Retrieve. Azure AI Search returns the policy passages relevant to the question, filtered to that employee's location.
3. Generate. Azure OpenAI drafts the reply using only those passages, plus employee details to fill in the template.
4. Review. The draft appears in Outlook, and HR checks it and sends.
LESSON 1: THE RIGHT ANSWER DEPENDS ON WHO IS ASKING
This was the most important design decision. A plain RAG system searches every policy document and returns whatever looks most similar to the question. In an organisation spread across several locations that is dangerous. The leave policy for one country and the leave policy for another read almost identically, so similarity search cannot tell them apart. The model would happily answer a question from one country with another country's rules.
The fix was to stop asking the model to guess the location and take it from a reliable source instead. The organisation's directory already knows where every employee is based, so the backend calls Microsoft Graph with the sender's email address and reads their country and office location. That value becomes a hard filter on the search. Only policies tagged for that location, plus any genuinely global policies, can be retrieved.
• Location is decided by data, not by the model. Retrieval is deterministic, so a wrong country's policy cannot slip through.
• No location, no guessing. When the directory has no location for someone, the add-in flags the draft so HR can confirm before sending.
LESSON 2: FILL THE BLANKS, DO NOT MAKE PEOPLE RETYPE THEM
HR replies are full of personal details: the employee's name, their office, the entitlement that applies to them, the right contact for their region. The system fills these from the Graph profile and the retrieved policy, so the draft arrives complete rather than as a template full of gaps. That is a big part of where the 80% drafting saving came from.
LESSON 3: RETRIEVAL QUALITY DECIDES ANSWER QUALITY
Most bad answers came from bad retrieval, not from the model. If the search step returns the wrong paragraph, even the best model writes a confident, wrong reply. Getting the right passages in front of the model, for the right location, mattered far more than prompt tweaks.
LESSON 4: THE MODEL MUST BE ALLOWED TO SAY "I DON'T KNOW"
An HR reply that invents a policy is worse than no reply at all. The prompt tells the model to answer only from the retrieved passages and to say clearly when the policy does not cover the question. HR staff stopped rechecking every sentence once they saw the system flag its own gaps rather than bluff.
LESSON 5: KEEP THE HUMAN IN THE LOOP
The add-in drafts. It never sends. HR replies can affect someone's pay, leave or employment, so a person stays accountable for every message. It also made rollout far easier: approving a tool that writes first drafts is a much smaller ask than approving an AI that emails staff on its own.
WHAT I WOULD DO NEXT
• Show the source passages and the detected location beside each draft, so reviewers can verify at a glance.
• Re-index automatically whenever a policy document changes.
• Use HR's edits as feedback to find gaps in the policies themselves.
TAKEAWAY
In a real organisation, the correct answer depends on who is asking. Use the data you already trust, in this case the directory in Microsoft Graph, to narrow the search before the model ever sees it. Add solid retrieval, honest handling of gaps and a human reviewer, and even a modest model feels reliable.
If you are building RAG systems on Azure, or AI tools inside Microsoft 365, I am always happy to compare notes.