Learn 🧠 All Concepts (20) 🤖 What is an LLM? 📚 RAG Explained ⚡ AI Agents 💻 Run AI Locally 🇮🇳 AI in India 📖 Learn Tracks 🔧 DevOps Track ⚙️ AI Ops Track 🗺️ AI Engineer Roadmap
Tools 🔧 AI Tools Directory 🔓 Open Source AI ⭐ Top GitHub Repos ✦ Claude Skill Repos 🚀 Ready-to-Deploy Projects
Build 🏗️ Build Hub 🎯 Master Prompts 🧩 RAG Agents 🚀 App Megaprompts
Workflows ⚡ All Workflows (22) 🎥 Text to Video 🎞️ Image to Video 🔊 Text to Speech ♻️ Automation
Resources 🧪 Colab Notebooks ⚙️ n8n Workflows 📈 Algo Trading 💰 Passive Income
🗂️ Browse All Topics About AItheGuru
← RAG agents
👩‍💼 RAG Agent · HR

HR Policy and Leave Management Agent

Answers HR policy questions, leave calculations, and payroll queries from your company handbook instantly.

HR Beginner Streamlit CloudHuggingFace Spaces

Quick info

CategoryHR
DifficultyBeginner
Deploy onStreamlit Cloud

Get the code

Includes install commands in comments

What it does

Answers leave and policy questions
Handles Indian PF/ESI rules
Multi-PDF knowledge base
Streamlit web interface
Source citation on every answer

Stack

PythonLangChainOpenAIStreamlit

Deploy on

✓ Streamlit Cloud✓ HuggingFace Spaces

Full source code

Install commands are in the top comments. Copy and run.

from langchain_community.document_loaders import PyPDFLoader from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain_openai import OpenAIEmbeddings, ChatOpenAI from langchain_community.vectorstores import FAISS from langchain.chains import RetrievalQA from langchain.prompts import PromptTemplate import streamlit as st PROMPT = PromptTemplate( template='You are an HR assistant.\nIndian regulations apply (PF, ESI, maternity 26wk).\nContext: {context}\nQ: {question}\nA:', input_variables=['context','question'] ) @st.cache_resource def load_agent(): pages = PyPDFLoader('hr_handbook.pdf').load() chunks = RecursiveCharacterTextSplitter(chunk_size=800,chunk_overlap=100).split_documents(pages) db = FAISS.from_documents(chunks, OpenAIEmbeddings()) return RetrievalQA.from_chain_type( llm=ChatOpenAI(model='gpt-4o-mini',temperature=0), retriever=db.as_retriever(search_kwargs={'k':4}), return_source_documents=True, chain_type_kwargs={'prompt':PROMPT} ) st.title('HR Policy Assistant') if question := st.text_input('Ask about leave, policies...'): st.write(load_agent().invoke({'query':question})['result'])