Incremental Knowledge Ingestion & Indexing Pipeline
Keeps the SDLC artifact pipeline's search index current: it syncs only new or updated files from a shared Google Workspace folder, then cleans, chunks, embeds and indexes them so answers and artifacts are drawn from the latest material.
Workflow
From “App startup, a greeting, page load or the Sync button” to result
- 1. Trigger
Authenticate
The pipeline connects to Google Workspace with a dedicated service account. If that fails, answers keep working on the existing index.
- 2. Action
List the folder
A paged listing returns each file's type and last-modified time, briefly cached to avoid redundant API calls.
- 3. Action
Filter
Unsupported file types and files outside the configured time window are skipped.
- 4. Action
Compare with sync state
Unchanged files count as up to date; the rest are marked new or updated.
- 5. Action
Download
Changed files are downloaded; native Docs, Sheets and Slides are exported to text formats first.
- 6. Action
Parse, clean & chunk
Each format has its own parser. Transcripts lose filler words and are cut into overlapping, speaker-aware chunks.
- 7. Action
Embed & index
Chunks are embedded in batches into the vector index, the keyword index is rebuilt, and duplicates are skipped.
- 8. Output
Save sync state
The index and sync state are saved, with counts of files synced, new chunks and files up to date.
Does this file need syncing?
flowchart TD
S([Sync starts]) --> AU{Connected to Workspace?}
AU -- no --> X[Keep existing index]
AU -- yes --> L[List folder]
L --> F{Supported type?}
F -- no --> SK[Skip]
F -- yes --> W{Inside the time window?}
W -- no --> OUT[Skip]
W -- yes --> C{Changed since last sync?}
C -- no --> UTD[Up to date]
C -- yes --> P[Process: new or updated]
P --> I[Index all new chunks]
I --> ST[(Save sync state)]Problem
The pipeline can only answer from what is in its index, and transcripts and documents keep arriving. Re-processing every file on every sync wastes time and API calls, and a cold start meant loading a heavy embedding model on top of stale data. The ingestion has to notice what changed, process only that, and have the service ready with fresh data before the first request.
Architecture
Four components do the work: a Workspace connector with a short-lived listing cache, a file processor with one parser per format, a transcript processor that cleans and chunks meetings by speaker, and an index manager that owns the vector and keyword indexes. Sync state records what has already been processed, so every run is incremental. The same sync runs at startup, before a fresh conversation, on page load and on demand. At startup the embedding model loads in the background and the service waits for it, so the first request doesn't pay for it.
Input
A shared Google Drive folder of meeting-recorder JSON transcripts and PDF, DOCX, XLSX, PPTX, CSV, TXT and Markdown files.
Output
New chunks in the FAISS and BM25 indexes, an updated sync-state file, and counts of files synced, new chunks, files up to date and files outside the date range.
Integrations
Limitations
Files removed from the folder are not yet removed from the index, and the pipeline watches a single folder. A sync triggered at the start of a conversation adds a little latency to that first reply.
Security Notes
Access to Workspace uses a dedicated service account limited to the shared folder, with its credentials kept out of source control. Sync operations are internal to the service and not exposed for public use.
Learnings
Tracking each file's last-modified time is enough to make ingestion incremental. Caching the folder listing cut redundant API calls, and loading the embedding model in the background at startup means the first user doesn't wait for it.