OpenAI Assistant Citation Generation for File Retrieval RAG
detail.loadingPreview
Workflow to generate structured metadata with citations from an OpenAI Assistant's file retrieval RAG.
About This Workflow
This workflow leverages an OpenAI Assistant configured with a vector store for file retrieval (RAG). It aims to capture and format citations generated by the assistant, ensuring that textual content is clearly linked to its sources within the retrieved files. The output can be further processed for Markdown or HTML formatting.
Key Features
- Utilizes OpenAI Assistant with file retrieval capabilities.
- Captures and processes message annotations for citations.
- Retrieves file names associated with citations.
- Formats the output to include file names and citation text.
- Aggregates multiple citations and text substitutions.
- Option to convert Markdown to HTML.
How To Use
- Setup OpenAI Key: Ensure your OpenAI API credentials are configured.
- OpenAI Assistant: Use an existing OpenAI Assistant with file retrieval enabled and a vector store populated.
- Trigger: The workflow is triggered by the
Create a simple Trigger to have the Chat button within N8Nnode, allowing interactive testing. - Process:
- The
OpenAI Assistant with Vector Storenode sends a query to your assistant. Get ALL Thread Contentretrieves all messages, as OpenAI's direct response may not include all citations.Split all message iterations from a thread,Split all content from a single message, andSplit all citations from a single messagenodes dissect the thread messages to isolate content and citation details.Retrieve file name from a file IDfetches the actual filename for each citation.Regularize outputstructures the extracted citation information (ID, filename, text).Aggregateconsolidates all processed citation data.Finnaly format the outputuses a JavaScript code node to replace the original text snippets with formatted references (e.g.,_(filename)_).Optional Markdown to HTML(disabled by default) can convert the Markdown output to HTML.
- The
Apps Used
Workflow JSON
{
"id": "7e2a1e57-4741-4538-8112-562b25f65383",
"name": "OpenAI Assistant Citation Generation for File Retrieval RAG",
"nodes": 20,
"category": "AI / Machine Learning",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 7e2a1e57-4741...
About the Author
Crypto_Watcher
Web3 Developer
Automated trading bots and blockchain monitoring workflows.
Statistics
Related Workflows
Discover more workflows you might like
Notion Database AI Assistant Workflow Generator
Generates an AI Assistant workflow for a Notion database.
AI-Powered BambooHR Company Policies and Benefits Chatbot
An AI chatbot that answers employee questions about company policies and benefits by leveraging BambooHR data and an employee lookup tool.