Перейти к содержанию
НОВОЕПознакомьтесь с Alaaddin — вашим ИИ-джинном с голосом. trig8n запускается 1 января 2027. Что нового

Библиотека / RAG и базы знаний

RAG и базы знаний

Добавление цитат из file search OpenAI Assistant в форматах Markdown или HTML

Запускает ассистента OpenAI, основанного на векторном хранилище, и переписывает его ответы с пронумерованными ссылками на источники в формате Markdown или HTML. Запускается вручную.

Что делает

## Make OpenAI Citation for File Retrieval RAG ## Use case In this example, we will ensure that all texts from the OpenAI assistant search for citations and sources in the vector store files. We can also format the output for Markdown or HTML tags. This is necessary because the assistant sometimes generates strange characters, and we can also use dynamic references such as citations 1, 2, 3, for example. ## What this workflow does In this workflow, we will use an OpenAI assistant created within their interface, equipped with a vector store containing some files for file retrieval. The assistant will perform the file search within the OpenAI infrastructure and will return the content with citations. - We will make an HTTP request to retrieve all the details we need to format the text output. ## Setup Insert an OpenAI Key ## How to adjust it to your needs At the end of the workflow, we have a block of code that will format the output, and there we can add Markdown tags to create links. Optionally, we can transform the Markdown formatting into HTML. by Davi Saranszky Mesquita {{ $env.WEBHOOK_URL }}

Шаги

  1. Manual Trigger
  2. Aggregate
  3. Window Buffer Memory
  4. Create a simple Trigger to have the Chat button within N8N
  5. OpenAI Assistant with Vector Store
  6. Get ALL Thread Content
  7. Split all message iterations from a thread
  8. Split all content from a single message
  9. Split all citations from a single message
  10. Retrieve file name from a file ID
  11. Regularize output
  12. Optional Markdown to HTML
  13. Finnaly format the output

Похожие автоматизации