Библиотека / RAG и базы знаний
RAG и базы знаний
Создайте RAG-чат-ассистента по документам Google Drive на базе Ollama, Pinecone и Gemini
Отслеживает новые и изменённые PDF, текстовые файлы и файлы Markdown в Google Drive, локально встраивает их через Ollama в Pinecone и отвечает на вопросы в чате с помощью Gemini, используя семантическое кэширование.
Что делает
## 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
Шаги
- 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
Всего шагов: 27.
Похожие автоматизации
RAG и базы знанийBuild a Google Drive document similarity database with Ollama and PostgresШагов: 56RAG и базы знанийЕжедневно синхронизируйте документацию GitHub с векторами Qdrant через эмбеддинги OllamaШагов: 14RAG и базы знанийChat with local documents using Ollama and MariaDB Vector cacheШагов: 28RAG и базы знанийНаполнение векторной базы знаний Supabase из Notion с эмбеддингами через OllamaШагов: 11