What the PDF asks for, and how we connect it

“Authority Brain — technical handoff v1.0” (WC MAC, 11 Nov 2026). For an industrial consultancy the advantage is access: weekly conversations with the people who run plants. The pilot turns those conversations into measurable reputation, next actions and authored content, but it runs on Renan's desktop and personal login. The ask: make it autonomous and company-owned, on WC MAC infrastructure, without losing the guarantees that make the board trust it.

Stack and AI in this demo

LayerWhat runsWhere in the codeStatus
AI modelClaude Opus 5.5 (claude-opus-5-5) when ANTHROPIC_API_KEY is set, as the spec chooses. Otherwise OpenAI (gpt-5.4). Without a working key, the sample meeting replays a recorded AI output.lib/model.tsPartly
Speech to textOpenAI gpt-4o-transcribe-diarize: audio and voice notes become speaker-labelled lines, in memory only. Production: Azure AI Speech in Brazil South.app/api/transcribePartly
Vercel AI SDK v7generateText + Output.object(zod) for structured Listen and Synthesise; streamText for the in-call helper; transcribe for audio. One SDK, any provider.lib/pipeline.ts, app/api/assistIn demo
Drizzle ORM + PostgresTyped schema, generated migrations, append-only triggers on quotes, scores, human status and the event log. Embedded Postgres (PGlite) so nothing needs installing; production points the same schema at the Brazil Postgres.db/schema.ts, db/migrations, db/store.tsIn demo
Trigger.dev v4Task process-meeting (the full pipeline as a durable run with retries and a concurrency limit), scheduled daily-briefing at 07:40 São Paulo, health-check at 09:00. Runs with npx trigger.dev dev once a project is connected; until then the web app runs the same functions inline.trigger/*.ts, trigger.config.tsPartly
Next.js 16App Router, server components reading Postgres, server actions writing human status, Suspense streaming.app/In demo

The four questions it must answer every day

  1. How is each relationship? Five dimensions per meeting (value, trust, closeness, friction, advocacy) roll into a 0–100 °T temperature with trend and alerts.
  2. What are clients saying about us? Quotes about WC MAC tagged praise, constructive or complaint, with a theme.
  3. What should we do now? One daily headline, a ticker, prioritised actions with owner and deadline, escalations.
  4. What can we publish that only we could? Anonymised micro-cases signed by a named leader: LinkedIn posts, newsletters, 1:1 e-mails, ABM pieces.

Everything the PDF specifies, and what we have to build

PartWhat the PDF saysWhat we writeStatus
① CaptureRead client meetings through a tenant-level Microsoft Graph app, not Renan's login. Push notifications for new transcripts + a daily reconciliation sweep. Idempotency key (organiser, meeting, occurrence, transcript).Capture service, Graph client with certificate auth, webhook, sweep job, idempotent queuePartly
② GateClassify by attendee e-mail domain in code before any transcript is requested. Internal, vendor, partner and personal meetings are never read. Unknown domain → human confirms.Domain classifier + accounts/domains configPartly
③ ListenClaude extracts verbatim quotes, scores 5 dimensions on rubric v0.1, tags reputation tone. Structured output, cached prompt prefix, transcript inside a data block, batch API for the nightly run.Listen prompt, Zod/JSON schema, speaker side labelling in codeIn demo
④ VerifyVerbatim check (fuzzy ≥ 0.95 near the minute), speaker must be client side, every non-zero score cites a kept quote, schema retry then quarantine, sanity invariants.Verify module + quarantine flowIn demo
⑤ StoreAppend-only Postgres in Brazil, encrypted. Corrections are new rows (supersedes_id). Model id, prompt hash and rubric version on every row. Transcript never stored.Drizzle schema, migrations, append-only triggers, pilot CSV importProduction
⑥ ComputeEvery number from tested code: meeting mean (round half toward zero), account mean of last 3, temperature (mean+2)/4×100, bands 37.5/67.5, trend ±0.3, low data < 3 meetings.Pure functions + unit tests for the edge casesIn demo
⑦ SynthesiseDaily: one headline, ticker, actions with stable ids, readings. Weekly Studio: posts, e-mails, ABM pieces in the leader's voice, 'only WC MAC could write this', grounding check, approval levels livre / revisar / cliente.Synthesis + Studio prompts, grounding checkIn demo
⑧ NotifyEscalations to the board the same day (< 2 h), briefing 07:40, weekly digest, through the Hermes Teams bot with frequency limits.Teams bot / Hermes client, escalation rulesProduction
⑨ DashboardWeb app behind Microsoft sign-in, also a Teams tab. Radar, Reputation, Studio, Coverage. Human status written to the DB with user and time. Keep the pilot's visual language.Next.js app, Entra SSO, rolesPartly
⑩ Ops & auditStructured logs, run health check at 09:00, cost per meeting, monthly cross-check of every transcript read against Microsoft's Graph activity logs.Ops crons, audit job, runbooksProduction
Evals (§11)Golden set of 20–30 labelled meetings. Gates: quote fidelity 100%, recall ≥ 80%, score agreement ≥ 80% (κ ≥ 0.6), escalation recall 100%, tone ≥ 85%, grounding 100%. Shadow week vs the pilot. Drift watch.Golden-set protocol, eval runner, shadow diff reportPartly
Security & LGPD (§12)Least-privilege app, certificate, two locks (Microsoft access policy + domain gate), legitimate interest, RIPD before go-live, recording notice, retention, data-subject requests, prompt-injection defence, human approval matrix.RIPD, recording notice, retention policy, DSR runbook, threat modelPartly

The twelve non-negotiables

  1. Never invent. Missing data becomes [CONFIRMAR: …].
  2. The score belongs to the account, never a person. Roles, not names.
  3. Only client or prospect meetings are read.
  4. Recorded is not quotable without written consent.
  5. No transcript at rest.
  6. Client data stays inside WC MAC.
  1. Escalate the same day.
  2. Humans approve, post and send. The system drafts.
  3. Numbers only from code.
  4. Log everything, including skipped meetings.
  5. Transcript text is data, never instructions.
  6. Ids stay stable.

The demo shows 1, 2, 4 (every quote marked “needs approval”), 5 (audio and transcript are not saved), 9, 11 (the sample contains an injection attempt) and 12.

Lessons from the pilot it tells us to design out

  • 37% of client meetings unreadable (client tenants, transcription off, in person) → WC MAC hosts, transcription on by policy, voice notes, coverage KPI.
  • The daily task stalled when the desktop app was closed → server scheduler and a 09:00 health check.
  • A merge silently dropped all quotes → typed models, transactions, post-run invariants.
  • Drafts over-claimed a client's industry → grounding check on every claim.
  • “Yes, right.” tagged as praise → explicit rule + test case. The demo rejects it.
  • Free-text score references in two formats → structured references.
  • Filters didn't hide, mobile broke → a real front end with tests.
  • A personal account as the capture identity → a dedicated app with an access policy.

Ideas for being excellent (§13)

IdeaWhat it meansStatus
Coverage as a gameEach manager sees their own coverage and one-click fixes: transcription on, host the meeting, 60-second voice note (capped ±1).Partly
Pre-meeting brief30 min before a client meeting the Teams bot sends temperature, open actions, last 3 quotes, unresolved complaints.Partly
Evidence Cards → casesStatus reports + client quotes → a case in three versions: public, anonymised, internal for sales.Production
Confidence-aware thermometerShow n meetings, dimensions with data, recency. Consider EWMA. Flag accounts resting on one meeting.Partly
Expansion radarCluster expansion and request quotes across accounts. Repeated unmet requests become service ideas; signals go to sales.In demo
Leader voice packsVoice profile per leader from interviews; drafts scored for voice similarity; edits feed back.Production
External authority indexWhether AI assistants cite WC MAC on target topics (GEO), sector clipping, LinkedIn engagement.Production
ProductisationSeparate the generic engine from the WC MAC instance with config files.Production

Roadmap the PDF sets

  • M0 Access: app, group, access policies. Done when a manager is granted and an outsider is denied.
  • M1 Capture: capture, domain gate, queue, event log. Internal meetings skipped; no transcript on disk.
  • M2 Listen: extraction, Verify, Postgres, compute, golden set. All eval gates met; pilot numbers reproduced.
  • M3 Shadow: one week in parallel with the pilot; every discrepancy explained.
  • M4 Surface: dashboard with sign-in, Teams alerts and briefing. Escalation reaches Teams in < 2 h.
  • M5 Synthesis: daily insights and weekly Studio. 100% grounded drafts; nothing sent automatically.
  • M6 Decommission: desktop tasks and Renan's connector off; first monthly audit.

Open decisions it leaves: hosting (Hermes VPS vs Azure Brazil South), storage (Postgres recommended), orchestration, dashboard form, client-tenant meetings, licensing (Teams Premium, Entra P1/P2) and recording consent.

Integration plan: how we connect to everything

SystemWhat we get or giveHow we connectData flowWhen
Microsoft Teams meetings (Graph)Post-meeting transcripts, calendar, attendee domainsApp registration 'Cerebro-Transcricoes', certificate, application permissions Calendars.Read, OnlineMeetings.Read.All, OnlineMeetingTranscript.Read.All. Scoped to the managers group by access policy. IT admin grants consent once.Change notification → webhook → job; daily sweep as safety netPhase 1
Teams app (bot, tabs, side panel, search)Where people use it: briefing, alerts, account pages, meeting side panel, approvalsTeams app package in the org catalog; bot via Microsoft 365 Agents SDK; tab sign-in with Teams SSO; pre-installed by setup policyBot sends proactive cards; tabs load the Next.js pagesPhase 1–2
OutlookCalendar for briefs; follow-up e-mail draftsDelegated Graph permission to create drafts in the user's own mailbox. Never sends.Draft appears in Outlook; the person sends itPhase 2
SharePointProject status reports for Evidence Cards and contractsSites.Selected: access to one project site onlyRead-only syncPhase 3
RD Station CRMAccount list, segments; approved content for e-mail sequencesAPI token stored in the server vault; read-only by defaultRead sync nightly; marketing pushes approved pieces by handPhase 3
LinkedInApproved postsNo integration: marketing posts by hand (human-only rule)Engagement entered or imported later for the authority indexPhase 3
Hermes PMO agentShared message budget and PMO contextSigned HTTP between the two bots on the same serverOne proactive message per person per day across bothPhase 2
Azure AI Speech (Brazil South)Voice notes and, later, live speechAzure resource key in the vault; audio in memory onlySpeech → text → same Listen and VerifyPhase 1b
Claude API (Anthropic)Listen, synthesis, in-call helpDedicated API key with a spend cap; retention reviewedStructured output; batch for nightly runsPhase 1

Getting the connections switched on

  1. IT admin (1 day): create the capture app with a certificate; grant admin consent; create the cerebro-gerentes group; apply the Exchange and Teams access policies; set the meeting policy so transcription starts automatically for that group.
  2. Prove the locks: test that a listed manager's client transcript can be read and an outsider's calendar is denied.
  3. Teams app: register the bot and tab sign-in apps, upload the app package to the org catalog, and pre-install it for the board and managers with a setup policy.
  4. Other systems: RD Station API token, SharePoint site access (Sites.Selected), Azure Speech resource in Brazil South, Anthropic key with a spend cap. All secrets in the server vault, never in code.
  5. People: recording notice added to invite templates; opt-in for proactive messages; legal signs the RIPD before go-live.

AI help during calls: what it looks like in real life

Two modes. Mode A works with what Teams gives apps today: the consultant types or taps, the AI answers in seconds. Mode B adds live listening through a media bot that joins the call. That is technically possible, but it needs explicit consent, a bot visible in the call and more infrastructure, so it comes later and only with the board's decision.

Brief arrives in Teams

The Authority Brain bot messages Marina: Ferro Vale Sul is 47 °T and falling; the client will hear another consultancy before the March renewal; the shutdown report was late three times; lead with the bearing caught on line two. Three talking points, each linked to the quote behind it.

Side panel opens in the meeting

Talking-point checklist, open actions, and a box: “Client asked…”. A green check confirms transcription is on.

The client asks something she can't answer

Carlos: “What would the energy-loss audit cost across all plants?” Marina taps the question (Mode A) or the bot hears it (Mode B). In about 5 seconds the panel shows: SAY “We've done these by plant; I'll bring a scoped proposal on Friday rather than guess a number now.” USE his ESG remark (quote id). DON'T PROMISE a price or a date for all plants. ASK BACK “Which plant has the highest energy bill?” Missing facts show as [CONFIRMAR], never a made-up figure.

One-tap capture

Marina taps “+ Commitment: report 48 h before planning”. It becomes a tracked commitment with owner and due date.

Recap card after the transcript lands

Summary, score preview, three proposed actions with Confirm / Dismiss, hidden opportunities (new kiln, technician training, sister plant referral), and a follow-up e-mail draft that opens in Outlook. Nothing is sent by the system.

Board sees it on the Radar

The escalation reached the board within 2 hours. The headline, temperature and actions are updated, each traceable to the sentence that produced it.

How in-call help is built

MODE A (now)   Teams meeting side panel (Next.js page)  →  /api/assist
               context = account quotes + open actions + account notes + this meeting's captures
               answer streams in ~3–5 s: SAY · USE · DON'T PROMISE · ASK BACK

MODE B (later) media bot joins the call (consent banner + verbal notice)
               audio → streaming speech-to-text in memory (Azure, Brazil South)
               question detector → same /api/assist → card pops in the side panel
               nothing from the live stream is stored; the normal post-meeting pipeline still runs

Try Mode A now: analyze the sample meeting, then open the In-call assist tab.

From this demo to production

  1. Weeks 1–2: access and app registrations, monorepo, database schema, background jobs.
  2. Weeks 3–7: live Graph capture feeding the same Listen → Verify → Compute shown here, with Postgres and evals.
  3. Week 8: shadow week against the pilot.
  4. Weeks 9–11: Teams app: briefing, escalations, Radar, Accounts.
  5. Weeks 12–14: meeting side panel (Mode A) and recap cards.
  6. Weeks 15–20: Studio approvals, pilot off, first audit. Mode B only after a consent pilot.

Evidence