๐ง Power Placetel voice answers from OneDrive docs with OpenAI and Groq
โก 7 views ยท ๐ง Miscellaneous
Description
Quick Overview
This workflow indexes text files from Microsoft OneDrive into a Supabase vector store using OpenAI embeddings, then answers incoming webhook questions with a Groq LLM using retrieval-augmented generation (RAG) and returns the response to the caller.
How it works
- Runs on a daily schedule at 02:00 or starts manually to re-index documents.
- Lists files in a specified OneDrive folder via the Microsoft Graph API and iterates through each file.
- Downloads each OneDrive file, loads its text content, generates OpenAI embeddings, and stores the resulting chunks in a Supabase vector store table.
- Receives a POST request on a webhook containing a question in
body.chatInput. - Creates an embedding for the question, retrieves the top matching chunks from Supabase, and uses Groq (Llama 3.1) to generate a structured answer based on the retrieved context.
- Returns the generated answer as the webhook response.
Setup
- Create a Microsoft OneDrive OAuth2 credential and update the Microsoft Graph folder path in the OneDrive listing request URL.
- Add an OpenAI API key for embeddings and ensure the same embeddings model is used for both indexing and querying.
- Set up Supabase credentials and a
documentstable (with the configuredmatch_documentsquery/function) for the Supabase vector store. - Add a Groq API key and confirm the Groq model selection and prompt content match your voice-assistant use case.
- Copy the webhook URL and configure the calling system to send POST requests with a JSON body like
{ "chatInput": "..." }.
๐ Nodes Used
HTTP Request, Webhook, Microsoft OneDrive, Schedule Trigger, Question and Answer Chain, Embeddings OpenAI
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File