Other

/google-drive-archive

Archive >100KB research/media to Brain Drive. Triggers: Drive upload, archive this, post-digest archival.

$ golems-cli skills install google-drive-archive

Updated 2 weeks ago

Pattern: Brain Drive holds forever. docs.local/ holds latest only. BrainLayer indexes both. A _DRIVE-LEDGER.md per docs.local/ subdir maps local → Drive.

This skill is for putting things INTO Drive. To query Drive content via Gemini, use /braindrive. To research the web with Drive sources, use /gemini-research.


Source-of-Truth Hierarchy

┌──────────────────────────────────────────────────────────────┐
│  BRAIN DRIVE                                                 │
│  ────────────                                                │
│  • Forever storage (free up to 15GB; user has the quota)     │
│  • All versions, heavy assets, raw research outputs          │
│  • Path: Brain Drive/06_ARCHIVE/<area>/<topic>/<date>/...    │
│  • Source of truth — if it's only in docs.local/, it isn't   │
│    durable                                                   │
└──────────────────────────────────────────────────────────────┘
                         ▲
                         │  upload + update ledger
                         │
┌──────────────────────────────────────────────────────────────┐
│  docs.local/  (git-ignored)                                  │
│  ───────────                                                 │
│  • Local cache — only the LATEST versions                    │
│  • Lightweight markdown only (no >100KB media)               │
│  • Per-dir `_DRIVE-LEDGER.md` lists every Drive copy + URL   │
│  • Safe to delete: contents are recoverable from Drive       │
└──────────────────────────────────────────────────────────────┘
                         ▲
                         │  brain_digest extracts entities/relations
                         │
┌──────────────────────────────────────────────────────────────┐
│  BRAINLAYER                                                  │
│  ──────────                                                  │
│  • Searchable index over text content (transcripts, docs)    │
│  • Chunks link back to Drive URLs                            │
│  • Use brain_search before brain_store — dedupe the index    │
└──────────────────────────────────────────────────────────────┘

One-line rule: Heavy or forever → Drive + ledger entry + (if textual) brain_digest. Local copies are caches, not archives.


Triggers

Invoke this skill when:

  1. Pre-write hint: about to save anything >100KB to docs.local/research/, docs.local/audits/, or docs.local/plans/ — especially if it contains transcripts, audio, video, or large logs.
  2. Explicit user request: "save this to Drive", "archive this", "this should be in Brain Drive", "put this in the archive".
  3. Post-digest: a research output has been brain_digest'd into BrainLayer and the raw file is a candidate for archival (BrainLayer indexes it; Drive holds the original).
  4. /tmp cleanup: about to rm -rf /tmp/<heavy-stuff> — if any of it is forever-knowledge, route it through this skill first.

Skip this skill when:

  • The artifact is genuinely ephemeral (CLI test output, throwaway diff, audit prompt that's already digested).
  • The content is already covered by another archive flow (e.g. PR merges live in git, not Drive).
  • File is <100KB markdown that's the canonical doc kept in docs.local/ (no need to upload markdown notes).

Workflow

1. Decide: ephemeral or forever?

Ask: "Will future-Etan or another agent want to re-read this raw artifact a month from now?"

AnswerAction
Yes (transcripts, audits, plans, research outputs, media)Forever → continue to step 2.
No (intermediate processing files, throwaway logs, regeneratable derivatives)Skip. Just delete after use. Note the choice in commit message or BrainLayer.
Mixed (e.g. audio.wav keep, audio-16k.wav derivative skip)Upload only the originals. Document which derivatives are regeneratable + how.

2. Resolve the Drive archive path

Default convention (matches Brain Drive/06_ARCHIVE/repos/union-2026-04/ precedent):

Brain Drive/06_ARCHIVE/<area>/<topic>/<date-or-tag>/<artifact-folder>/
<area>When
researchWeb research, deep research, video gems, audits-as-research
auditsCode audits, security reviews, compliance reports
plansMulti-phase plans (large-plan outputs), architecture proposals
reposWhole-repo snapshots (e.g. before a destructive refactor)
voiceVoice session transcripts + audio

Use mcp__google-drive__search to find existing parent folders before creating new ones — match precedent if one exists.

3. Create the folder tree

mcp__google-drive__createFolder(name=<level>, parent=<parent-id>)

Capture the returned folder ID at every level. You will need them in the ledger.

4. Upload the artifacts

mcp__google-drive__uploadFile(localPath=<absolute>, parentFolderId=<id>)
  • Parallel for files in the same folder is safe.
  • Big files (>100MB): the MCP handles them; just call once and wait.
  • Capture id, link, and size from each upload return.

5. brain_digest text content

For every transcript.txt, report.md, audit.md, plan.md you upload:

mcp__brainlayer__brain_digest(content=<file content>)

Capture the returned chunk_id. This makes the full text searchable — gem extractions and structured chunks cover the highlights, but brain_digest is what catches phrases the gem extractor missed.

For files >150KB, an inner agent with brain_digest loaded can do this in the background (large content blows up the orchestrator's context).

6. Write / update the local ledger

Path: docs.local/<area>/<topic>/_DRIVE-LEDGER.md

# Drive Ledger — <topic>
 
> Source of truth for these artifacts is Brain Drive. Local files are caches.
 
| File | Local path | Drive folder | Drive ID | Drive URL | Size | BrainLayer chunk | Uploaded |
|---|---|---|---|---|---|---|---|
| transcript.txt | docs.local/.../transcript.txt | <folder-id> | <file-id> | <link> | 30KB | brainbar-... | 2026-04-25 13:01 |
| audio.wav | (deleted from /tmp after upload) | <folder-id> | <file-id> | <link> | 312MB | n/a | 2026-04-25 13:08 |