Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / RAG & Knowledge Bases

RAG & Knowledge Bases

Build a RAG chat assistant over Google Drive docs with Ollama, Pinecone and Gemini

Watches Google Drive for new or changed PDFs, text and Markdown files, embeds them locally with Ollama into Pinecone, and answers chat questions with Gemini using semantic caching.

What it does

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

The steps

  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

27 steps in total.

Similar automations