How urshashi09/hr-policy-rag-assistant works
This is a security-conscious HR-policy RAG assistant. An employee submits a question in the Streamlit chat; the pipeline screens it, invokes an agent that can retrieve policy context, screens the draft answer, and returns either a safe answer or a refusal. A separate evaluation path runs curated questions through the real assistant and scores correctness and groundedness. The graph preserves the documented ingestion, routing, tracing, and logging capabilities; unsampled implementation details are represented only where the README documents them.
Main entry points: pipeline.py RAG pipeline · evaluation.py Evaluation runner · vector_store.py Qdrant vector store · app.py Streamlit chat
Components 21
Chat interface
- Streamlit chat
app.py
Assistant runtime
- RAG pipeline
hr_assistant/pipeline.py - Safety guardrails
hr_assistant/guardrails.py - HR agent
hr_assistant/agent.py - Runtime configuration
hr_assistant/config.py
Policy retrieval
- Policy loader
hr_assistant/document_loader.py - Chunk splitter
hr_assistant/doc_splitter.py - Jina embeddings
hr_assistant/embeddings.py - Qdrant vector store
hr_assistant/vector_store.py - Policy search tool
hr_assistant/tools.py
AI operations
- Gateway LLM client
hr_assistant/llm.py - Portkey routing
hr_assistant/gateway.py - LangSmith tracing
hr_assistant/tracing.py - Daily logs
hr_assistant/logger.py
Evaluation
- Evaluation runner
hr_assistant/evaluation.py - Evaluation entry
evaluate.py
Other components
- Employee
- Portkey service
- Qdrant Cloud
- Jina embedding service
- LangSmith service
Connections 26
- Employee → Streamlit chat: asks question
README.md - Streamlit chat → RAG pipeline: submits query
app.py - RAG pipeline → Safety guardrails: screens input
hr_assistant/pipeline.py - Safety guardrails → Portkey service: classifies safety
hr_assistant/guardrails.py - RAG pipeline → HR agent: invokes agent
hr_assistant/pipeline.py - HR agent → Policy search tool: calls tool
README.md - Policy search tool → Qdrant vector store: retrieves chunks
hr_assistant/tools.py - Qdrant vector store → Qdrant Cloud: queries collection
hr_assistant/vector_store.py - Qdrant vector store → Jina embeddings: creates embeddings
hr_assistant/vector_store.py - Jina embeddings → Jina embedding service: embeds text
README.md - RAG pipeline → Policy loader: loads policy
hr_assistant/pipeline.py - RAG pipeline → Chunk splitter: splits documents
hr_assistant/pipeline.py - RAG pipeline → Qdrant vector store: builds or loads
hr_assistant/pipeline.py - RAG pipeline → Gateway LLM client: gets model
hr_assistant/pipeline.py - Gateway LLM client → Portkey routing: requests routed model
hr_assistant/llm.py - Portkey routing → Portkey service: routes model calls
hr_assistant/gateway.py - RAG pipeline → Safety guardrails: screens draft
hr_assistant/pipeline.py - RAG pipeline → LangSmith tracing: checks tracing
hr_assistant/pipeline.py - RAG pipeline → Daily logs: records events
hr_assistant/pipeline.py - RAG pipeline → Streamlit chat: returns answer
app.py - Evaluation entry → Evaluation runner: starts evaluation
evaluate.py - Evaluation runner → RAG pipeline: runs questions
hr_assistant/evaluation.py - Evaluation runner → Qdrant vector store: fetches context
hr_assistant/evaluation.py - Evaluation runner → Portkey service: routes judge
README.md - Evaluation runner → LangSmith service: evaluates dataset
README.md - LangSmith tracing → LangSmith service: sends traces
README.md