Recipe · Automation & AI agents
An internal HR and policy FAQ agent over your company PDFs, for a small team
Upload your employee handbook, leave policy and expense rules, and give the team a chat agent that answers questions such as “how many days of annual leave do I get?” in the language of the question, names the document and section it used, and says “please ask HR” when the documents do not cover it.
Steps
- Collect the documents: the latest handbook and the leave, expense, travel and remote-work policies as text-based PDF or Word files (not scans), with the date in each file name. Remove anything personal such as salaries or named employees, and choose one person who owns updates.
- Dify: sign up at dify.ai (the free Sandbox plan allows 50 knowledge documents and 50 MB of storage) or self-host the open-source Community Edition. Go to Knowledge > Create > Create a ready-to-use knowledge base and upload the files.
- Keep the default automatic chunking at first, choose the high-quality index method and hybrid retrieval if your plan offers them, preview a few chunks to check that the text reads correctly, and wait until processing finishes.
- Go to Studio, create a Chatflow or Agent app, attach the knowledge base (a Knowledge Retrieval node in a Chatflow, or the Knowledge section of an Agent app), choose a model, and paste the template below as the instructions.
- Test in the preview pane with 20 real questions from the team, including questions the documents do not answer and questions in both languages. When an answer is wrong, look at the retrieved chunk first: usually the policy is ambiguous or the chunk cuts a table in half.
- Publish the app and share the web app link with the team. Restrict who can open it if your plan offers access control, or self-host Dify inside your network if the documents must stay there.
- On Microsoft 365 instead: in Copilot Studio, create an agent, select Add knowledge on the Overview or Knowledge page, upload the files, give each a clear description, and select Add to agent. Test it in the test pane, publish it, and add it to the Microsoft Teams channel so staff can ask it inside Teams.
- Set a monthly reminder for the document owner: replace outdated files, delete superseded versions (old versions cause contradictory answers), and rerun the 20 test questions.
Agent template
Replace anything in { } with your details.
You are the internal policy assistant for {COMPANY NAME} employees.
Answer only from the retrieved company documents. Do not use general knowledge about labour law or other companies.
Reply in the language of the question.
For every answer:
1. Give the direct answer in 1-3 sentences.
2. Add the source on its own line: document name, section or heading, and the document date.
3. If the documents give conditions or exceptions (probation, notice periods, approval levels), list them briefly.
If the documents do not answer the question, or two documents contradict each other, say so plainly and reply: "Please ask HR: {HR CONTACT}". Never guess numbers such as days, amounts or deadlines.
Do not answer questions about a specific person’s salary, performance, health or disciplinary case; direct them to HR.
Keep a neutral, helpful tone, and never say that the policy may be different from what the documents state. Expected output
A chat link (or a Teams agent) that answers policy questions in the language they are asked in, in a few sentences, names the document, section and date it used, and sends anything the documents do not cover to HR.
Gotchas
- ⚠ Dify’s free Sandbox plan is small: 200 message credits, 5 apps, 50 knowledge documents and 50 MB of knowledge storage (dify.ai/pricing). A handbook and a few policies fit; daily use by a team does not, so plan for a paid workspace or self-hosting.
- ⚠ Copilot Studio needs a licence or trial in your Microsoft tenant, and uploaded files need Dataverse search turned on by an admin. Files over 512 MB and encrypted or sensitivity-labelled files are not supported, and an agent can hold up to 500 files (learn.microsoft.com, “Upload files as a knowledge source”).
- ⚠ The agent will sometimes answer confidently from the wrong chunk. Make it name the document and section, and tell staff that the PDF, not the bot, is the policy.
- ⚠ Uploaded documents are stored and processed by the platform and the model provider. Do not upload salary tables, personal files or anything under legal hold; self-host Dify if documents cannot leave your servers.