İçeriğe geç
YENİAlaaddin ile tanış: sesi olan yapay zekâ cinin. trig8n 1 Ocak 2027'de yayında. Yeniliklere bak

Kütüphane / RAG ve Bilgi Bankaları

RAG ve Bilgi Bankaları

Pinecone, OpenAI ve Google Drive ile webhook üzerinden belge sorularını yanıtlar

Alıntılanmış pasajlar ve Drive bağlantıları içeren, PDF kütüphanesindeki soruları yanıtlayan bir POST uç noktası sunar. Tekrarlanan soruları önbelleğe alır, düşük güvenilirlikli yanıtları ise engeller.

Ne yapar

## 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.

Adımlar

  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

Toplam 24 adım.

Benzer otomasyonlar