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
| Layer | What runs | Where in the code | Status |
|---|---|---|---|
| AI model | Claude 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.ts | Partly |
| Speech to text | OpenAI gpt-4o-transcribe-diarize: audio and voice notes become speaker-labelled lines, in memory only. Production: Azure AI Speech in Brazil South. | app/api/transcribe | Partly |
| Vercel AI SDK v7 | generateText + 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/assist | In demo |
| Drizzle ORM + Postgres | Typed 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.ts | In demo |
| Trigger.dev v4 | Task 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.ts | Partly |
| Next.js 16 | App Router, server components reading Postgres, server actions writing human status, Suspense streaming. | app/ | In demo |
The four questions it must answer every day
- How is each relationship? Five dimensions per meeting (value, trust, closeness, friction, advocacy) roll into a 0–100 °T temperature with trend and alerts.
- What are clients saying about us? Quotes about WC MAC tagged praise, constructive or complaint, with a theme.
- What should we do now? One daily headline, a ticker, prioritised actions with owner and deadline, escalations.
- 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
| Part | What the PDF says | What we write | Status |
|---|---|---|---|
| ① Capture | Read 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 queue | Partly |
| ② Gate | Classify 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 config | Partly |
| ③ Listen | Claude 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 code | In demo |
| ④ Verify | Verbatim 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 flow | In demo |
| ⑤ Store | Append-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 import | Production |
| ⑥ Compute | Every 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 cases | In demo |
| ⑦ Synthesise | Daily: 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 check | In demo |
| ⑧ Notify | Escalations 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 rules | Production |
| ⑨ Dashboard | Web 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, roles | Partly |
| ⑩ Ops & audit | Structured 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, runbooks | Production |
| 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 report | Partly |
| 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 model | Partly |
The twelve non-negotiables
- Never invent. Missing data becomes
[CONFIRMAR: …]. - The score belongs to the account, never a person. Roles, not names.
- Only client or prospect meetings are read.
- Recorded is not quotable without written consent.
- No transcript at rest.
- Client data stays inside WC MAC.
- Escalate the same day.
- Humans approve, post and send. The system drafts.
- Numbers only from code.
- Log everything, including skipped meetings.
- Transcript text is data, never instructions.
- 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)
| Idea | What it means | Status |
|---|---|---|
| Coverage as a game | Each manager sees their own coverage and one-click fixes: transcription on, host the meeting, 60-second voice note (capped ±1). | Partly |
| Pre-meeting brief | 30 min before a client meeting the Teams bot sends temperature, open actions, last 3 quotes, unresolved complaints. | Partly |
| Evidence Cards → cases | Status reports + client quotes → a case in three versions: public, anonymised, internal for sales. | Production |
| Confidence-aware thermometer | Show n meetings, dimensions with data, recency. Consider EWMA. Flag accounts resting on one meeting. | Partly |
| Expansion radar | Cluster expansion and request quotes across accounts. Repeated unmet requests become service ideas; signals go to sales. | In demo |
| Leader voice packs | Voice profile per leader from interviews; drafts scored for voice similarity; edits feed back. | Production |
| External authority index | Whether AI assistants cite WC MAC on target topics (GEO), sector clipping, LinkedIn engagement. | Production |
| Productisation | Separate 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
| System | What we get or give | How we connect | Data flow | When |
|---|---|---|---|---|
| Microsoft Teams meetings (Graph) | Post-meeting transcripts, calendar, attendee domains | App 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 net | Phase 1 |
| Teams app (bot, tabs, side panel, search) | Where people use it: briefing, alerts, account pages, meeting side panel, approvals | Teams app package in the org catalog; bot via Microsoft 365 Agents SDK; tab sign-in with Teams SSO; pre-installed by setup policy | Bot sends proactive cards; tabs load the Next.js pages | Phase 1–2 |
| Outlook | Calendar for briefs; follow-up e-mail drafts | Delegated Graph permission to create drafts in the user's own mailbox. Never sends. | Draft appears in Outlook; the person sends it | Phase 2 |
| SharePoint | Project status reports for Evidence Cards and contracts | Sites.Selected: access to one project site only | Read-only sync | Phase 3 |
| RD Station CRM | Account list, segments; approved content for e-mail sequences | API token stored in the server vault; read-only by default | Read sync nightly; marketing pushes approved pieces by hand | Phase 3 |
| Approved posts | No integration: marketing posts by hand (human-only rule) | Engagement entered or imported later for the authority index | Phase 3 | |
| Hermes PMO agent | Shared message budget and PMO context | Signed HTTP between the two bots on the same server | One proactive message per person per day across both | Phase 2 |
| Azure AI Speech (Brazil South) | Voice notes and, later, live speech | Azure resource key in the vault; audio in memory only | Speech → text → same Listen and Verify | Phase 1b |
| Claude API (Anthropic) | Listen, synthesis, in-call help | Dedicated API key with a spend cap; retention reviewed | Structured output; batch for nightly runs | Phase 1 |
Getting the connections switched on
- IT admin (1 day): create the capture app with a certificate; grant admin consent; create the
cerebro-gerentesgroup; apply the Exchange and Teams access policies; set the meeting policy so transcription starts automatically for that group. - Prove the locks: test that a listed manager's client transcript can be read and an outsider's calendar is denied.
- 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.
- 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.
- 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 runsTry Mode A now: analyze the sample meeting, then open the In-call assist tab.
From this demo to production
- Weeks 1–2: access and app registrations, monorepo, database schema, background jobs.
- Weeks 3–7: live Graph capture feeding the same Listen → Verify → Compute shown here, with Postgres and evals.
- Week 8: shadow week against the pilot.
- Weeks 9–11: Teams app: briefing, escalations, Radar, Accounts.
- Weeks 12–14: meeting side panel (Mode A) and recap cards.
- Weeks 15–20: Studio approvals, pilot off, first audit. Mode B only after a consent pilot.