Saberra Academy
Technology 6 of 10 in this collection

Living Sources: The Drive Folder Watcher

Technology · 3 min read

Sera can continuously monitor designated Google Drive folders and auto-extract new or changed files as Draft Knowledge Base articles on the same three-minute cycle as email. Point it at a standing repository once, and new documents become searchable memory without anyone forwarding them. Use the watcher for repositories and the capture inbox for one-offs.

Most content reaches Sera by email. Living Sources adds a second channel: Sera can watch designated Google Drive folders and automatically pull new or changed files into memory as Draft Knowledge Base articles, on the same three-minute cycle the email poller runs.

This turns a shared folder into a standing input. Drop a document in, and within a poll cycle it becomes a searchable KB draft — no forwarding, no manual step.

Setting it up

  1. Create a folder in Google Drive, for example one named "Sera Sources".
  2. Share it with the service or capture identity as at least Viewer. Read access is enough; Sera never needs to edit your files.
  3. Copy the folder ID — it is the part of the folder's URL that comes after /folders/.
  4. Set the ID in the LIVING_SOURCES_FOLDER_IDS setting. To watch several folders, list their IDs separated by commas.
  5. Deploy. On the first poll after deployment, Sera discovers the files already in the folder and begins extracting them.

How it works under the hood

Living Sources is built to be efficient and safe at scale:

  • Incremental polling. It uses the Google Drive Changes API and stores a page token, so each cycle only re-reads files that actually changed rather than rescanning the whole folder.
  • Graceful fallback. If the state database is unavailable and the stored token cannot be read, it falls back to a full scan so nothing is silently missed.
  • Deduplication. Files are deduped by their Drive File ID, so the same document is not extracted twice.
  • No new permissions. It reuses the existing Drive credentials already in place for meeting-asset access. There is no additional OAuth scope to grant.

Supported file types

The watcher handles the document formats teams keep in shared drives:

  • Google Docs, Sheets, and Slides
  • PDF and DOCX
  • XLSX spreadsheets
  • RTF and plain text

When to use the watcher versus the capture inbox

They are complementary:

  • Use the folder watcher for standing repositories — policy libraries, handbooks, reference material, anything that lives in Drive and grows over time.
  • Use the capture inbox for one-offs, external files, and urgent items — a single document, something a partner sent you, or anything you need in memory right now rather than on the next poll.

One current limitation

Modifying a file that Sera has already ingested does not yet update the existing KB article. New files are picked up automatically, but an edit to an already-extracted document will not re-flow into its draft. If a source document changes materially, treat it as a fresh capture until update-on-change ships. Keep this in mind when you decide what belongs in a watched folder versus what you send once and forget.

Key points

Living Sources watches designated Google Drive folders and turns new or changed files into Draft KB articles on the normal three-minute poll. Set it up by creating a Sera Sources folder, sharing it with the capture identity as at least Viewer, copying the folder ID from the URL after /folders/, and listing it in the LIVING_SOURCES_FOLDER_IDS setting (comma-separated for several). It uses the Drive Changes API with a stored page token for incremental polling, falls back to a full scan if the database is unavailable, dedups by Drive File ID, and reuses existing Drive credentials with no new OAuth scope. It supports Docs, Sheets, Slides, PDF, DOCX, XLSX, RTF, and text. Modifying a file does not yet update the existing article.

Discussion

Sign in or create an account to comment.

No comments yet. If you have tried this, say how it went.