Skip to content

project · tier 1 · 2026

Vera — a Chief of Staff agent for C-level leaders

A reporting and second-brain agent that runs inside each leader's own Google Workspace: Forms capture the team's daily and weekly reports, Gemini summarises and consolidates them, and a Drive wiki builds itself from every report with hybrid embedding + lexical search. A Cloudflare Worker exposes it to Claude and ChatGPT as a 13-tool MCP server. Apps Script library, 421 tests.

Role
Creator & Engineer — Xertica
Period
Jul 2026 — Present
View the repository
github.com/JosephRobles23/cos-vera
13MCP tools for Claude & ChatGPT
421tests, Apps Script mocked
30runtime modules in one shared library
1Sheet per leader, no central admin

Problem

A C-level leader needs to know, every day and every week, what the team achieved, what is blocking it, what changed and what deserves attention — without chasing anyone, without reading eight forms and without consolidating anything by hand. They also need to walk into each meeting with the context of every person and project already at hand.

At Xertica that cycle ran on people: someone sent the reminders, someone read the replies, someone wrote the summary. Any tool that replaced it had to run inside the leader's own Google Workspace, under their own account and quota, with no server to operate and no IT ticket to open. And it had to accumulate memory, not just forward mail.

What I built

Vera is an Apps Script agent that each leader owns as a copy: their own Sheet for settings and data, their own Daily and Weekly Forms, their own team roster. Everything runs as the leader — mail goes out from their account — and nothing runs as a central admin. The logic is not copied into each Sheet: it lives in one shared, read-only library, CoSLib, and every leader's Sheet carries only a thin stub that forwards to it. One push to the library reaches every leader; the Gemini key stays in the library's Script Properties and never travels with a copied Sheet.

Two triggers move everything. onFormSubmit summarises each report row with Gemini Flash the moment it lands and feeds it into the brain. A dispatcher every five minutes decides what is due: invitations at the configured hour, the day's or week's consolidated brief with Gemini Pro, silence scans for people who stopped reporting, backfill of the history, and Deep Prep briefings before meetings. Prompts are layered and editable per leader — a voice file, a context file and one system prompt per task — with defaults baked in.

The second brain is a Drive wiki in markdown with frontmatter: person and project pages that build themselves from every report and from Gemini meeting notes. Search is hybrid — gemini-embedding-2 vectors at 768 dimensions, int8, fused with lexical results by reciprocal rank fusion — and reindexes only when the embedding model changes. On top of it sit a morning briefing, a deterministic team follow-up view, the leader's own task board and a read-only Telegram bot.

The third surface is Vera-MCP: a stateless Cloudflare Worker that turns each leader's brain and tasks into 13 MCP tools for their personal Claude or ChatGPT. It is a thin multi-tenant proxy with no mirror of the data — OAuth 2.1 with a pairing code identifies the leader, a per-tenant secret verified by challenge-response authenticates the Worker to that leader's Web App, and the Sheet id never travels in a request, so the model can never point a tool at someone else's data.

Architecture

  • Leader's Sheet + Forms (container-bound stub) — settings tabs, Daily and Weekly Forms, onOpen, sidebar host, triggers. No business logic.
  • CoSLib shared library — 30 *-runtime.js modules in one Apps Script namespace: summaries, consolidation, invites, forms, prompts, brain, deep prep, briefing, follow-up, sharing, Telegram, MCP.
  • Dispatcher — a five-minute trigger that owns all timing: invitations, consolidation, silences, backfill, Deep Prep.
  • Gemini bridge — Flash for per-row summaries, Pro for consolidated briefs, Flash-Lite for cheap extraction, gemini-embedding-2 for the index.
  • Second brain (Drive) — markdown wiki with frontmatter, hybrid RRF search, Meet-notes ingestion, a curation centre for merges and purges.
  • UI bridge — sidebar and dialogs call one generic cosRun that dispatches into the library by name; no named google.script.run calls.
  • Web App — follow-up buttons in mail with single-use tokens; also the entry point the MCP proxy calls.
  • Vera-MCP (Cloudflare Worker)createMcpHandler + OAuth provider, D1 for the tenant map, KV for OAuth state; 13 tools over tasks, wiki, Calendar, Deep Prep, reports and mail.
  • Tests — 421 on node --test, with a mock harness for the Apps Script globals; clasp pushes the library.

Evidence

Vera is internal tooling at Xertica, so there is no public URL — the repository is the evidence. It documents the architecture and contracts, the per-leader onboarding runbook, the MCP spec and its design log, and ships 421 passing tests against a mocked Apps Script runtime.

Edges