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

Bibliothek / RAG & Wissensdatenbanken

RAG & Wissensdatenbanken

Hochgeladene Dateien in Google Drive archivieren und in Pinecone indexieren

Empfängt Dateien per Webhook, archiviert sie in Google Drive und zerlegt sie mit OpenAI in Chunks, die anschließend für die RAG-Suche in Pinecone eingebettet werden. Die Chunk-Größe richtet sich nach Dateityp und -größe.

Was sie bewirkt

# Upload Files to a Pinecone Knowledge Base Send a file to a webhook and it gets archived in Google Drive and indexed into Pinecone, ready to be searched by a RAG chatbot. Chunk size, overlap, and embedding batch size are all calculated automatically from the file's size and type, so small text files and large PDFs are each handled sensibly without manual tuning. ### How it works 1. A webhook receives the uploaded file as binary data. 2. A Code node reads the file size and extension, then works out the best chunk size, chunk overlap, and embedding batch size. PDFs get smaller chunks, plain text gets larger ones, and everything stays inside safe limits. 3. The file is uploaded to a Google Drive folder so the original stays available for source links later. 4. The file is downloaded back from Drive and passed to the Pinecone node. 5. A data loader splits the file page by page and tags every chunk with its source filename, the text splitter applies the calculated chunk settings, and OpenAI embeddings are stored in your Pinecone index. 6. The webhook responds once indexing finishes. ### Setup 1. Add your API keys to the credential placeholders: OpenAI, Pinecone, and your Google Drive account. 2. Replace YOUR_PINECONE_INDEX_NAME with your Pinecone index, and YOUR_GOOGLE_DRIVE_FOLDER_ID with the folder that should hold the originals. 3. Activate the workflow and POST a file to the webhook URL as multipart form data. ### Customization - Edit the size thresholds in the Code node to change how aggressively files are chunked. - Add extra metadata fields in the data loader to filter searches later.

Die Schritte

  1. 1. Webhook - Receive File Upload
  2. 6. Respond - Confirm Upload
  3. 5. Pinecone - Store Document Chunks
  4. Embeddings - OpenAI
  5. Text Splitter - Dynamic Chunk Size
  6. Data Loader - Split Pages and Tag Source
  7. 2. Code - Calculate Chunk and Batch Size
  8. 3. Google Drive - Upload File
  9. 4. Google Drive - Download File

Ähnliche Automatisierungen