Quick Overview
This workflow ingests company policy PDFs from BambooHR into a Supabase vector database and provides an employee chat interface that answers policy and benefits questions using OpenAI, with an additional employee/department lookup powered by BambooHR employee data.
How it works
- Starts a manual run to fetch files from BambooHR and keep only PDFs in the “Company Files” category.
- Downloads each selected PDF, splits it into chunks, generates OpenAI embeddings, and inserts the content into a Supabase vector table for retrieval.
- Exposes a chat trigger where employees submit questions to an HR assistant.
- Uses OpenAI with conversation memory and retrieves relevant policy content from the Supabase vector store to ground responses.
- When a question requires a contact person, looks up employee details in BambooHR by exact name or finds the most senior person in a requested department using an OpenAI-assisted department extraction and ranking step.
- Returns the final answer to the chat, including policy-based guidance and any retrieved employee contact details.
Setup
- Add BambooHR credentials and ensure your policies/benefits PDFs are available in the BambooHR file category named “Company Files.”
- Add Supabase credentials and create a
company_files table with a match_files similarity search function configured for your embedding dimensions.
- Add an OpenAI API key for both chat models and embeddings used across ingestion, retrieval, classification, and seniority selection.
- Run the manual ingestion once to populate Supabase before using the chat trigger, then share the chat webhook/URL with your chat client or n8n Chat UI.