Библиотека / RAG и базы знаний
RAG и базы знаний
Ответы на вопросы по документам через webhook с Pinecone, OpenAI и Google Drive
Предоставляет POST-эндпоинт, который отвечает на вопросы по библиотеке PDF с цитатами и ссылками на Google Drive, кэширует повторные вопросы и блокирует ответы с низкой уверенностью.
Что делает
## Document Q&A API with Citations, Cache and Confidence Gate A POST endpoint that answers questions about your own PDF library and returns the answer, the exact passage it came from, the page number, and clickable Google Drive links to every source file. Built to be called by a website chat widget, a Slack bot, or any front end that can send JSON. ### How it works The webhook validates the request first and returns a 400 when the question is missing, so bad calls never reach a paid model. A repeated question is served from an answer cache held in an n8n data table, which keeps a busy endpoint fast and cheap for seven days. New questions go to a retrieval agent that searches a Pinecone index through OpenAI embeddings, reranks the matches with Cohere, and returns structured JSON: the answer, a confidence number, and one citation per supporting passage. A confidence gate sits after the agent, so a weak or unsupported answer comes back as an honest not-found response rather than a guess. Good answers have their source file names deduplicated, looked up once each in Google Drive, and turned into view and download links, with any file missing from Drive named in the reply. Every answer is then cached, written to an audit log with its confidence and response time, and returned. Conversation memory keyed on the caller's session id makes follow-up questions work. ### Setup Add your OpenAI, Gemini, Pinecone, Cohere, Drive and Sheets credentials. Point the Knowledge Base node at your Pinecone index, create a data table with the columns named on the cache node, and set the sheet ID and QA Log tab. ### Customization Change the cache window, the confidence threshold, or the reranker topN to trade accuracy against cost.
Шаги
- Question Webhook
- Capture Request
- Valid Question?
- Respond Bad Request
- Look Up Cached Answer
- Fresh Cache Hit?
- Respond From Cache
- Document Q&A Agent
- Answer Model
- Fallback Answer Model
- Conversation Memory
- Document Knowledge Base
- Search Embeddings
- Match Reranker
Всего шагов: 24.
Похожие автоматизации
RAG и базы знанийIndex Google Drive documents with OpenAI embeddings and PineconeШагов: 62RAG и базы знанийИндексация документов Google Drive в Pinecone с контекстным разбиениемШагов: 13RAG и базы знанийЗагрузка документов Google Drive в Pinecone с контекстным разбиением на фрагментыШагов: 13RAG и базы знанийIngest LinkedIn posts from Google Drive into Pinecone with Gemini and SupabaseШагов: 21