Bibliothek / RAG & Wissensdatenbanken
RAG & Wissensdatenbanken
Dokumentfragen per Webhook beantworten mit Pinecone, OpenAI und Google Drive
Stellt einen POST-Endpunkt bereit, der Fragen zu einer PDF-Bibliothek mit zitierten Textstellen und Drive-Links beantwortet, wiederholte Fragen zwischenspeichert und Antworten mit geringer Konfidenz zurückhält.
Was sie bewirkt
## 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.
Die Schritte
- 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
Insgesamt 24 Schritte.
Ähnliche Automatisierungen
RAG & WissensdatenbankenIndex Google Drive documents with OpenAI embeddings and Pinecone62 SchritteRAG & WissensdatenbankenGoogle-Drive-Dokumente mit kontextbezogenem Chunking in Pinecone indizieren13 SchritteRAG & WissensdatenbankenGoogle-Drive-Dokumente mit kontextbezogenem Chunking in Pinecone laden13 SchritteRAG & WissensdatenbankenRAG-Chatbot über Google-Drive-Dateien mit OpenAI und Pinecone erstellen20 Schritte