Library / RAG & Knowledge Bases
RAG & Knowledge Bases
OpenAI File Retrieval RAG Chat with Citations
When a chat message arrives, an OpenAI assistant retrieves from uploaded files and the answer includes citations of the source documents.
What it does
# Make OpenAI Citation for File Retrieval RAG ## Overview Automated workflow: Make OpenAI Citation for File Retrieval RAG. This workflow integrates 11 different services: stickyNote, httpRequest, markdown, code, splitOut. It contains 24 nodes and follows best practices for error handling and security. ## Workflow Details - Total Nodes: 24 - Node Types: 11 - Error Handling: ✅ Implemented - Security: ✅ Hardened (no sensitive data) - Documentation: ✅ Complete ## Node Breakdown - Aggregate: aggregate - Window Buffer Memory: memoryBufferWindow - Sticky Note4: stickyNote - Sticky Note: stickyNote - Create a simple Trigger to have the Chat button within N8N: chatTrigger - OpenAI Assistant with Vector Store: openAi - Sticky Note1: stickyNote - Get ALL Thread Content: httpRequest - Sticky Note2: stickyNote - Split all message iterations from a thread: splitOut - ... and 14 more nodes ## Usage Instructions 1. Configure Credentials: Set up all required API keys and credentials 2. Update Variables: Replace any placeholder values with actual data 3. Test Workflow: Run in test mode to verify functionality 4. Deploy: Activate the workflow for production use ## Security Notes - All sensitive data has been removed or replaced with placeholders - Error handling is implemented for reliability - Follow security best practices when configuring credentials ## Troubleshooting - Check error logs if workflow fails - Verify all credentials are properly configured - Ensure all required services are accessible
The steps
- Manual Trigger
- Aggregate
- Window Buffer Memory
- Create a simple Trigger to have the Chat button within N8N
- OpenAI Assistant with Vector Store
- Get ALL Thread Content
- Split all message iterations from a thread
- Split all content from a single message
- Split all citations from a single message
- Retrieve file name from a file ID
- Regularize output
- Optional Markdown to HTML
- Finnaly format the output
- Error Handler
33 steps in total.
Similar automations
RAG & Knowledge BasesAdd Citations to OpenAI File Retrieval RAG Answers12 stepsRAG & Knowledge BasesOpenAI File Retrieval RAG Chat with Citations33 stepsRAG & Knowledge BasesAdd Citations to OpenAI File Retrieval Answers12 stepsRAG & Knowledge BasesRAG System with Automatic Source Citations Using Qdrant24 steps