Zum Inhalt springen
NEULerne Alaaddin kennen, deinen KI-Flaschengeist mit Stimme. trig8n startet am 1. Januar 2027. Neuigkeiten ansehen

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

  1. Question Webhook
  2. Capture Request
  3. Valid Question?
  4. Respond Bad Request
  5. Look Up Cached Answer
  6. Fresh Cache Hit?
  7. Respond From Cache
  8. Document Q&A Agent
  9. Answer Model
  10. Fallback Answer Model
  11. Conversation Memory
  12. Document Knowledge Base
  13. Search Embeddings
  14. Match Reranker

Insgesamt 24 Schritte.

Ähnliche Automatisierungen