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
- Manual Test Trigger
- When File Updated in Drive
- Search Drive Files
- Download Drive File
- Check If PDF
- Extract PDF Content
- Extract Text Content
- Merge Extracted Content
- Store Knowledge in Pinecone
- Generate Ollama Embeddings
- Load Data for Ingestion
- On Chat Message Received
- Lookup in Semantic Cache
- Cache Query with Ollama
Insgesamt 27 Schritte.
Ähnliche Automatisierungen
RAG & WissensdatenbankenBuild a Google Drive document similarity database with Ollama and Postgres56 SchritteRAG & WissensdatenbankenGitHub-Dokumentation täglich mit Ollama-Embeddings als Vektoren in Qdrant synchronisieren14 SchritteRAG & WissensdatenbankenChat with local documents using Ollama and MariaDB Vector cache28 SchritteRAG & WissensdatenbankenSupabase-Vektor-Wissensdatenbank aus Notion mit Ollama-Embeddings befüllen11 Schritte