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

Bibliothek / RAG & Wissensdatenbanken

RAG & Wissensdatenbanken

Einen RAG-Chatassistenten für Google-Drive-Dokumente mit Ollama, Pinecone und Gemini bauen

Überwacht Google Drive auf neue oder geänderte PDF-, Text- und Markdown-Dateien, bettet sie lokal mit Ollama in Pinecone ein und beantwortet Chatfragen mit Gemini unter Nutzung von semantischem Caching.

Was sie bewirkt

## Build a dual-stage RAG chat assistant with Google Drive, Pinecone and Gemini ### How it works This workflow implements an enterprise-grade, dual-stage Retrieval-Augmented Generation (RAG) system with Pinecone vector stores and semantic caching. It operates in two synchronized pipelines: 1. Document Ingestion Pipeline (Top Track): Continuously monitors Google Drive for newly uploaded or modified knowledge documents (PDFs, plain text, and Markdown), downloads them, extracts textual content, generates 768-dimensional dense vector embeddings using local Ollama (nomic-embed-text), and indexes the documents into a primary Pinecone knowledge base with source metadata. 2. Semantic Cache & Conversational AI Pipeline (Bottom Track): Intercepts incoming user chat questions and performs an ultra-fast vector similarity lookup in a Pinecone Semantic Cache index (rag-semantic-cache). If a semantic match is found (score >= 0.88), the cached answer is returned immediately in under 100ms. On a cache miss, the query is seamlessly routed to an autonomous AI Agent powered by Google Gemini 1.5 Flash, conversational buffer memory, and a Pinecone Vector Store retrieval tool. The AI Agent's grounded response is delivered to the user and automatically indexed into the Pinecone Semantic Cache for future instant retrieval. ### Setup steps - Google Drive: Connect your Google Drive OAuth2 credentials and specify your target Knowledge Base folder ID in the When File Updated in Drive and Search Drive Files nodes. - Pinecone Vector Database: Create two Pinecone indexes with dimension 768 and metric cosine: - nomic-embed-text: Stores document chunks and metadata for knowledge retrieval. - rag-semantic-cache: Stores cached Q&A query vectors and answers. - Local Ollama: Ensure Ollama is running (ollama pull nomic-embed-text) and configure the Ollama Base URL in your credentials (e.g., http://localhost:11434 or http://host.docker.internal:11434). - Google Gemini API: Connect your Google Gemini (PaLM) API credentials and select models/gemini-1.5-flash for the agent and tool language models. - Test Workflow: Use the Manual Test Trigger to test knowledge base ingestion, and the On Chat Message Received trigger to test chat inference and cache seeding. ### Customization - Adjust the similarity threshold in Check Cache Hit (default: 0.88) to balance cache precision and hit rate. - Modify the AI A

Die Schritte

  1. Manual Test Trigger
  2. When File Updated in Drive
  3. Search Drive Files
  4. Download Drive File
  5. Check If PDF
  6. Extract PDF Content
  7. Extract Text Content
  8. Merge Extracted Content
  9. Store Knowledge in Pinecone
  10. Generate Ollama Embeddings
  11. Load Data for Ingestion
  12. On Chat Message Received
  13. Lookup in Semantic Cache
  14. Cache Query with Ollama

Insgesamt 27 Schritte.

Ähnliche Automatisierungen