Библиотека / RAG и базы знаний
RAG и базы знаний
Отвечать на замаскированные обращения в поддержку с помощью RAG на Claude и Gemini по прошлым ответам
Запускается на каждое входящее обращение через webhook: маскирует персональные данные, ищет похожие прошлые ответы сотрудников, отвечает автоматически только при высокой уверенности, а в остальных случаях передаёт сотруднику и учится на его ответах.
Что делает
## Customer support RAG that learns from your staff Auto-replies only what past staff answers can settle, hands everything else to staff, and learns from the answers staff give (with personal data masked). 1. Inquiry POST /webhook/cs-rag-inquiry with {name, email, message} The message is masked, then similar past Q&A are searched. Claude replies automatically only when the similarity is above the threshold AND Claude says the reference answers are enough. Everything else is logged as waiting for staff, so it fails on the safe side. 2. Staff answer, then learning POST /webhook/cs-rag-answer with {case_id, answer, staff, learn?} Regex masking, an AI masking pass, then a check for leftover patterns. Only Q&A that pass are added to the vector store. If personal data may remain, nothing is learned and the case is marked for review. 3. Rebuild POST /webhook/cs-rag-reindex The in-memory vector store is lost when n8n restarts. This restores it from the learned rows of the Data Table. Set up 1. Create a Data Table cs_rag_cases with string columns case_id, status, received_at, customer_name, customer_email, question_raw, question_masked, answer_raw, answer_masked, auto_answer, staff, learned_at and a number column match_score. Select it in every Data table node. 2. Create credentials: Anthropic, Google Gemini (PaLM) API (used for embeddings), and Header Auth for the three webhooks (for example header X-API-Key). 3. Publish. The system starts empty: send a few inquiries, answer them through the Staff answer webhook, and similar questions will then be answered automatically. 4. Tune THRESHOLD in Check similarity with your own data.
Шаги
- Webhook: New inquiry
- Normalize and mask input
- Search similar Q&A
- Check similarity
- Similar answer found?
- AI: Draft the reply
- Validate the draft
- Safe to auto-reply?
- Log: auto-answered
- Respond: auto-reply
- Log: waiting for staff
- Respond: escalated to staff
- Webhook: Staff answer
- Get the case
Всего шагов: 32.
Похожие автоматизации
Поддержка клиентов и служба помощиОбработка сообщений поддержки LINE в Slack с Claude и эмбеддингами GeminiШагов: 66RAG и базы знанийMap marketplace product categories with Gemini embeddings and a review queueШагов: 26Чат-боты и боты для мессенджеровGive AI astrology readings via chat and Telegram with RoxyAPI, Gemini, OpenAI and ClaudeШагов: 58Синхронизация данных и ETLСинхронизировать события Google Calendar с задачами Asana с журналом синхронизации в таблице данныхШагов: 23