Skip to content

DREAMTEAM — Technical Architecture

DREAMTEAM is three tightly-coupled systems sharing a common data layer:

SystemMaps to SpecCore Engineering Challenge
Team Hub + Workspace IntelligenceBucket 3 (Team Workspace) + Reimagined TerminalBrain² as the memory spine, multi-agent orchestrator with swarm management, two-way voice agent interface, conversational chat with context-drift detection — all surfaced through a terminal-like wrapped web app
Presentation EngineBucket 1 (Presentation Deck)Format-agnostic content model that renders as both click-through deck and long-scroll proposal, adapted for multi-tenant team editing with shared brand presets
Pitch Intelligence PipelineBucket 2 (Pitch Intelligence) + pitch-room features from Bucket 3Orchestrating AI outputs into a live presentation without visible latency — the edit lifecycle from proposal to landing, plus invisible group chat and live performance dashboard during pitches

Creative Intelligence (Bucket 4) and Public MCP are parked — not on the build roadmap. The proprietary creative-data moat is a separate, far-future bet that depends on DREAMTEAM being a working product first.

The central artifact is the hub. The hub is the thing that makes DREAMTEAM a place a team lives, not a deck tool with extras bolted on. Get the operating layer right, then everything else — the deck, pitch intelligence, follow-up generation — has a home to plug into. This shapes the entire data model and build order.


┌─────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ │
│ Wrapped Web App Mobile Companion PWA Bridge │
│ (Reimagined Terminal) (demand-gated) (day-one) │
│ primary surface React Native / Expo │
│ │
└──────────────┬──────────────────────┬───────────────────────────┘
│ │
▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ REAL-TIME LAYER │
│ │
│ Supabase Realtime │
│ ├── Broadcast (chat, dashboard signals, edit lifecycle) │
│ ├── Presence (who's online, viewport state, pitch status) │
│ └── Postgres Changes (data sync, task board updates) │
│ │
└──────────────┬──────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER │
│ │
│ Fastify Backend (Railway) + BullMQ Workers │
│ ├── Brain² Manager (tier cycling, critical-flag enforcement) │
│ ├── Agent Orchestrator (dispatch, swarm mgmt, completion) │
│ ├── AI Gateway (BYOK credential resolution, Vercel AI SDK) │
│ ├── Conversational Agent Runtime (voice out, turn-taking) │
│ ├── Chat Layer Engine (context-drift, auto-route, auto-save) │
│ ├── Migration Pipeline (Notion import, structure mapping) │
│ ├── Deck Operations (CRUD, versioning, brand-preset apply) │
│ ├── Edit Lifecycle Manager (propose → approve → land) │
│ ├── Pre-pitch Pipeline (calendar watch, research trigger) │
│ └── Meeting Capture Processor (Granola hook / fallback) │
│ │
└──────────────┬──────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ DATA LAYER │
│ │
│ Supabase (Postgres) │
│ ├── Core: orgs, members, projects, decks, slides, pitches │
│ ├── Workspace: chat_messages, conversations, threads │
│ ├── Tasks: task_board, agent_runs, swarm_runs │
│ ├── Memory: brain2_items (hot/warm/cold tiered) │
│ ├── Migration: import_jobs, source_mappings │
│ └── pgvector: embeddings for Brain², semantic search │
│ │
│ Supabase Storage │
│ ├── Brand assets (logos, fonts, images) │
│ ├── Meeting recordings / transcripts │
│ ├── Template marketplace assets │
│ └── Deck exports / snapshots │
│ │
└──────────────┬──────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ AI INTEGRATION BOUNDARY │
│ │
│ Engineering provides: AI team provides: │
│ ├── Audio capture pipeline ├── STT models │
│ ├── Agent runtime/scheduler ├── Voice-reactive inference │
│ ├── Suggestion UI + approval ├── Auto-tailor logic │
│ ├── Voice-out playback infra ├── TTS engine │
│ ├── Context-drift detection ├── Topic-embedding models │
│ ├── Scoring pipeline hooks ├── Suggestion generation │
│ └── Migration struct. mapping └── Content classification │
│ │
└─────────────────────────────────────────────────────────────────┘

3.1 Team Hub + Workspace Intelligence (Phase 1)

Section titled “3.1 Team Hub + Workspace Intelligence (Phase 1)”

What it does: The always-on operating layer — Brain², multi-agent orchestrator, conversational interfaces, meeting capture, migration. Everything reads and writes through this. Surfaced as a terminal-like wrapped web app.

Key technical components:

ComponentWhat it isHow it works
Brain²Tiered knowledge store — the memory spineThree Postgres tables (brain2_hot, brain2_warm, brain2_cold) with different retention policies. Hot = active project context (full rows). Warm = recent + semantically close (pgvector embeddings, searchable). Cold = historical archive (pgvector, compressed). Smart cycling keyed to active project/quarter/objective. Critical-flag items never auto-demote. Every demotion logged, one-click re-promote.
Multi-Agent Orchestrator + Task BoardRuntime for AI agent deployment + project managementKanban board with three input sources (human, auto-extracted from meetings, agent-proposed). Dispatches agents/squads against tasks. Swarm visibility (composite run view), swarm-sizing recommendation, auto-recognition of completion + board deduplication. Efficiency lens per teammate. Privacy gate for solo/scratch sessions.
Conversational Agent InterfaceTwo-way voice interactionVoice in already solved (Wispr-style dictation). This adds voice out + true turn-taking loop — teammate talks, DREAMTEAM responds aloud, teammate reacts, agent adjusts. Cross-cutting modality: applies anywhere you’d otherwise type at an agent (briefing swarms, reviewing runs, querying Brain²). Same agent runtime, voiced front-end.
Conversational Chat LayerPersistent conversation history with intelligenceClaude-style sidebar of every past conversation — scroll back, branch, resume. Context-drift detection (Wispr-style): when a conversation shifts topic, auto-spawn a new thread that stays aware of the prior one. No-manual-save running doc auto-populates as conversation unfolds. Auto-route on close: archive/close/inactivity routes the doc to the right destination (project folder, Brain² tier, task board). Direct Brain² intake — auto-routed concise docs feed warm/cold tiers.
Reimagined TerminalTerminal-style wrapped web appThe hub operates like a terminal: you work in it and it feels like a cloud that knows your entire brain, with room to tweak. Shipped as a wrapped web app — the primary surface. References: Macro and Merydian’s hub approaches as starting points.
Meeting CaptureGranola integration or native fallbackIf Granola connected: webhook to receive transcript/summary feed, store pointer + metadata. If not: native audio capture → STT → structured summary (action items, decisions, attendees, named-entity tags). Encrypted at rest, tenant-isolated. Feeds Brain², pre-pitch briefings, and follow-up decks.
Migration & OnboardingOne-click import from existing toolsNotion-first: workspaces, docs, databases, task boards via OAuth. Zero-config mapping: Notion pages/docs → Brain² (warm/cold), Notion databases/boards → task board, Notion teamspaces → workspace structure. Preserves hierarchy, links, properties/tags, assignees. Optional incremental re-sync until full cutover. Adjacent stores later (Google Docs/Drive, Linear, Asana, Coda).

Hard problems:

  • Brain² cycling logic: “Smart cycling keyed to active project/quarter/objective” — the interaction between cycling rules, critical-flag protection, and sublinear index maintenance is tricky. When items move from warm to cold, embeddings need re-indexing into the cold-tier vector index without blocking queries.
  • Multi-agent orchestration complexity: Swarm management, completion detection, swarm-sizing recommendation, and board deduplication are each non-trivial systems. Start simple: single-agent runs first, add swarm features incrementally.
  • Voice talkback pipeline: TTS engine selection, barge-in handling (interrupting the agent mid-sentence), and whether it runs client-side or streams from the runtime. Latency-sensitive — needs to feel conversational, not walkie-talkie.
  • Context-drift detection: What signals trigger an auto-spawned new thread (topic-embedding distance? explicit cue? silence gap?)? Too aggressive = annoying thread fragmentation. Too lax = conversations become incoherent. Needs tuning.
  • Migration fidelity: Preserving Notion page hierarchy, links between pages, properties/tags, and assignees so the imported workspace is navigable — not a flat dump. Incremental re-sync introduces conflict resolution if both sides edit during cutover.

What it does: Stores, renders, and mutates pitch decks. Already largely built (parzvl.com/dual-template, adaptive viewer, brand preset system). The Phase 2 work is adapting it to be team-editable: multi-tenant brand presets, shared delivery, team ownership — not a single-operator tool.

Key technical components:

ComponentWhat it isHow it works
Content ModelFormat-agnostic slide/block representationEach “slide” is an ordered list of content blocks (text, image, chart, embed) with layout hints. The renderer decides deck-vs-scroll layout, not the data model.
Brand Preset SystemVersioned design-token objectPalette, type system, logo treatments, motion, spacing, voice/tone, component skins. Stored as JSON with version history. Editing propagates to all linked decks. Per-deck overrides via JSON merge-patch. Multi-tenant: org-level presets with team ownership.
Dual-Mode RendererReact component libraryTwo layout engines consuming the same content model. Desktop defaults to deck, mobile defaults to scroll. Mode toggle preserves equivalent section. Build on existing dual-template prototype.
Shareable LinksEvery deck is a URL, never a fileNext.js dynamic routes with SSR for preview/SEO. Auth layer controls access (public link, org-only, password-protected). Live edits propagate to the same URL.
Template SystemMarketplace + house-line packsTemplates are deck skeletons. On download, auto-conform to user’s active brand preset.
Mode TogglesExecutive / Concept / Print-safe / Dark-LightGlobal presets that adjust rendering parameters. These are preset-modifier objects, not separate presets.

Hard problems:

  • Live hot-swap during presentation: When the live editing engine lands a change mid-pitch, the viewer’s deck must update without jarring transitions. Renderer needs a diffing strategy — update individual content blocks, not re-render the full slide.
  • “Smart auto-restructure”: If a pending edit isn’t done rendering when the presenter advances, promote the next-ready slide and reinsert the edited one when ready. Real-time priority queue for slide rendering.
  • Dual-mode rendering fidelity: Deck and scroll views diverging in quality/behavior. Invest in the content model — if the abstraction is right, both renderers are straightforward.

What it does: The AI-powered layer that adapts decks before, during, and after pitches. Engineering owns the plumbing; the AI team owns the intelligence. Includes the two pitch-room features (invisible group chat + live performance dashboard) relocated from Bucket 3 since they only matter during a pitch.

Key technical components:

ComponentEngineering ownsAI team owns
Live Editing EngineEdit lifecycle state machine (Proposed → Approved → Countdown → Landed → Reverted). WebSocket-driven. Visible countdown timer per push. Conflict resolution when multiple edits target the same slide.
Pre-pitch AdaptationCalendar integration (Google/Outlook API), scheduling pipeline (T-24h deep scan, T-2h final), approval UI for proposed modifications, briefing document rendererAuto-research (buyer news, exec moves, social signals), auto-tailor (cross-reference briefing against active deck, propose mods)
Voice-reactive ExtensionAudio capture pipeline (browser MediaStream API or native), relay to STT service, suggestion UI (inline in invisible chat), approval flow, live-edit push on approvalSTT transcription, real-time understanding (what’s landing, what isn’t), suggestion generation
Follow-up DeckPost-pitch trigger, template selection, auto-draft assembly from transcript + deck + action items, human review UIContent generation from transcript + deck context, action-item extraction
Invisible Group ChatSupabase Realtime Broadcast channel per pitch session. Each teammate has independent viewport state (Presence). Messages persisted for post-pitch review.
Live Performance DashboardRenders coaching signals: slide timer, talk-time balance bars, transcript surface, pacing flags. All inline in the invisible-chat surface as chips, not modal interrupts.Audio analysis signals: talk-time per speaker, pacing assessment, key-phrase highlights, “buyer hasn’t spoken” flags

The edit lifecycle is a state machine:

┌──────────┐ approve ┌──────────┐ timer ┌───────────┐
│ Proposed │──────────────▶│ Approved │──────────▶│ Countdown │
└──────────┘ └──────────┘ └─────┬─────┘
│ │ │
│ reject │ cancel │ timer expires
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Rejected │ │ Cancelled│ │ Landed │
└──────────┘ └──────────┘ └────┬─────┘
│ revert
┌──────────┐
│ Reverted │
└──────────┘

Hard problems:

  • Latency budget for voice-reactive: Audio capture → STT → understanding → suggestion → render. Must surface suggestions within seconds of the relevant conversation moment. Engineering needs to buffer and stream, not wait for complete utterances.
  • Slide-on-demand: Generate a brand-new slide from prompt during the pitch. Content model must support dynamic insertion, and the viewer’s navigation must accommodate it without disrupting the presenter’s flow.
  • Screen-share-invisible chat: The spec calls for kCGWindowSharingNone (macOS) and WDA_EXCLUDEFROMCAPTURE (Windows). This cannot be done in a browser tab — requires a native desktop shell. Fallback: the mobile companion IS the invisible back-channel (phones already on the table during pitches).

Organization
├── Members (user_id, role, permissions)
├── BrandPresets (versioned JSON, org-level, per-deck override)
├── Projects
│ ├── Decks
│ │ ├── Slides (ordered, content_blocks JSONB)
│ │ ├── DeckBrandOverride (merge-patch on org preset)
│ │ └── EditQueue (status, target_slide, target_block, proposed_content)
│ ├── Pitches (scheduled events)
│ │ ├── PitchSessions (live state: active/completed)
│ │ │ ├── ChatMessages (persisted back-channel)
│ │ │ ├── DashboardSignals (talk_time, pacing, transcript)
│ │ │ └── EditLifecycleEvents (proposed/approved/landed/reverted)
│ │ └── BuyerBriefings (pre-pitch research output)
│ ├── TaskBoard
│ │ ├── Tasks (source: human/meeting_capture/agent, status, assignee)
│ │ └── AgentRuns (task_id, agent_type, status, model, tokens, output)
│ │ └── SwarmRuns (composite run, child agent_runs)
│ └── Brain2Items (tier: hot/warm/cold, content, embedding, critical_flag)
├── Conversations (thread_id, parent_thread, topic_embedding, status)
│ ├── Messages (role, content, timestamp)
│ └── AutoRoutedDocs (destination, confirmation_status)
├── MeetingCaptures (transcript, action_items, decisions, attendees)
└── ImportJobs (source: notion/gdrive/etc, status, mapping_config)
└── SourceMappings (source_id, target_type, target_id, structure_meta)
Data typeStorageWhy
Structured data (all tables above)Supabase PostgresRelational integrity, RLS for multi-tenancy, real-time subscriptions
Vector embeddings (Brain², semantic search, context-drift)pgvector extensionNative to Supabase, no separate vector DB to manage
Brand assets, logos, fontsSupabase StorageCDN-backed, access-controlled
Meeting recordingsSupabase Storage (encrypted)Tenant-isolated, retention-controlled
Template marketplace assetsSupabase StoragePublic/paid access tiers
  • Row Level Security (RLS) on every table. Org membership determines access.
  • Brain² isolation: Each org’s memory is completely isolated. No cross-tenant data leakage.
  • Meeting captures encrypted at rest: Supabase Storage encryption + application-level encryption for transcript content.
  • Conversation privacy: Solo/scratch agent sessions stay private. Only runs explicitly attached to a task surface to the team.
  • Migration data isolation: Imported data inherits the org’s RLS policies on arrival.

LayerTechnologyRationale
Web frontendNext.js 15 (App Router)SSR for shareable deck links, React Server Components for dashboard, client-side for real-time. Vercel deployment. The web app IS the desktop experience day one.
Backend serviceFastify (TypeScript)Persistent backend for agent orchestration, AI gateway, voice pipeline, background jobs. Separate from Next.js because agent runs are long-lived (minutes), voice needs persistent WebSockets, and background jobs need a persistent process. Deploys to Railway.
Job queueBullMQ + RedisBackground job processing: agent dispatch, Brain² tier cycling, scheduled pre-pitch research (T-24h/T-2h triggers), migration imports, meeting capture processing.
DatabaseSupabase (Postgres)Relational data, RLS for multi-tenancy, Realtime subscriptions.
Vector searchpgvector (Supabase)Brain² warm/cold tiers, semantic search, context-drift topic embeddings. Native Postgres extension — no separate vector DB. Hardcoded to vector(1536) for now (matches OpenAI text-embedding-3-small).
Real-timeSupabase RealtimeBroadcast for chat/signals, Presence for user state, Postgres Changes for data sync.
AuthSupabase AuthEmail/password + OAuth (Google for calendar, Notion for migration). Org-based access via RLS. API key auth via Edge Function → JWT minting.
StorageSupabase StorageBrand assets, meeting recordings (encrypted), template marketplace assets, deck exports.
AI SDKVercel AI SDKProvider-agnostic interface across LLM providers (Anthropic, OpenAI, Google). Wraps each provider’s SDK (@ai-sdk/anthropic, @ai-sdk/openai) into a unified API. Streaming-first, tool calling, agent support. React hooks (useChat, useCompletion) for consuming AI streams in the frontend.
AI gatewayCustom (in backend service)Resolves BYOK credentials per org, routes through Vercel AI SDK to the right provider, logs usage to ai_usage_records. Security boundary — credential decryption happens here, never in the frontend or Edge Functions.
Edge FunctionsSupabase Edge Functions (Deno)Lightweight, short-lived operations: API key validation → JWT minting, webhook receivers (Granola, OAuth callbacks). NOT used for agent orchestration or AI calls.
Hosting (web)VercelNext.js deployment, preview URLs, edge rendering for global deck access.
Hosting (backend)RailwayLong-running Node.js process, WebSocket support, Redis addon for BullMQ. Simple deploy from monorepo subfolder.
Monorepopnpm workspacesShared TypeScript types between web + api from day one (both apps talk to the same DB and each other). No Turborepo — pnpm workspaces handle the dependency graph without extra tooling overhead.
PaymentsStripeSubscription billing, marketplace payouts (Stripe Connect).
MobileReact Native / ExpoDemand-gated — ship after web app. Shared data-layer logic via packages/shared. Native APIs for camera, mic, push notifications.
dreamteam/
├── apps/
│ ├── web/ — Next.js 15 (App Router)
│ │ ├── app/ Vercel deployment
│ │ ├── components/ The Reimagined Terminal, all UI
│ │ ├── lib/ Auth pages, SSR for shareable deck links
│ │ └── ... Supabase client for direct data access (RLS-enforced)
│ │ Consumes AI streams from backend via React hooks
│ │
│ └── api/ — Node.js backend service (Fastify)
│ ├── src/
│ │ ├── routes/ API endpoints
│ │ ├── agents/ Agent orchestrator + agent type definitions
│ │ ├── gateway/ AI gateway (BYOK credential resolution, provider routing)
│ │ ├── voice/ Voice pipeline (WebSocket, TTS, turn-taking)
│ │ ├── workers/ BullMQ job processors
│ │ │ ├── brain2/ Tier cycling, embedding computation
│ │ │ ├── migration/ Notion import pipeline
│ │ │ ├── meeting/ Meeting capture processing
│ │ │ └── research/ Pre-pitch research triggers
│ │ └── lib/ Shared utilities, Supabase client
│ └── ...
├── packages/
│ └── shared/ — Shared TypeScript
│ ├── src/
│ │ ├── types/ Domain types (AgentEvent, Brain2Item, TaskStatus, etc.)
│ │ ├── contracts/ API request/response shapes
│ │ ├── constants/ Status enums, tier names, scopes, provider list
│ │ └── supabase.ts Generated Supabase types (from supabase gen types)
│ └── ...
├── supabase/
│ ├── migrations/ — SQL migrations
│ │ └── 001_foundation.sql Schema: orgs, members, projects, Brain², tasks,
│ │ agents, API keys, credentials, usage, profiles
│ ├── functions/ — Edge Functions (Deno)
│ │ ├── auth-api-key/ API key validation → JWT minting
│ │ └── webhooks/ Granola, OAuth callbacks
│ ├── seed.sql — Development seed data
│ └── config.toml — Supabase project config
├── pnpm-workspace.yaml
├── package.json
└── tsconfig.base.json
ConcernWhereWhy there
UI rendering, auth pages, deck viewerapps/web (Vercel)Short-lived requests, SSR, static assets
Direct data queries (CRUD, search)apps/web → SupabaseRLS enforces auth, no backend roundtrip needed
Supabase Realtime subscriptionsapps/web client-sideBrowser holds the WebSocket to Supabase
Agent dispatching + swarm coordinationapps/api (Railway)Long-running (minutes), stateful, needs persistent process
AI calls (all providers, BYOK)apps/api via Vercel AI SDKSecurity boundary for credential decryption
Agent output streaming to UIapps/api → SSE/WebSocket → apps/webBackend streams tokens/progress, frontend renders
Voice turn-taking loopapps/api WebSocket endpointPersistent connection, latency-critical
Brain² tier cyclingapps/api BullMQ workerScheduled background job
Migration importsapps/api BullMQ workerLong-running, processes hundreds of pages
Meeting capture processingapps/api BullMQ workerAudio → STT → structured summary pipeline
Pre-pitch research triggersapps/api BullMQ workerScheduled (T-24h, T-2h), background
API key → JWT mintingsupabase/functions/Lightweight, runs close to the DB, short-lived
Webhook receiverssupabase/functions/Simple request → DB write

BYOK (Bring Your Own Key) only. Every org provides their own LLM provider API keys (Anthropic, OpenAI, etc.). DREAMTEAM does not hold platform keys or resell API access — the org pays their provider directly. This keeps the business model simple: DREAMTEAM charges for the platform, not for inference.

The AI gateway sits in the backend service and:

  1. Reads the org’s stored credentials for the requested provider
  2. Routes through the Vercel AI SDK (unified interface across providers)
  3. Logs usage to ai_usage_records for the efficiency lens (per-teammate AI usage visibility) — not for billing

Provider credentials are encrypted at the application level before storage. Raw keys are never returned to the frontend after creation.

Org model: Every user gets a personal org auto-created on signup (Supabase Auth trigger). Teams create additional orgs. API keys live at the org level. Solo users set their own key; team admins set the team key.

CapabilityEngineering provides (input)AI team provides (output)Latency requirement
Pre-pitch auto-researchBuyer name, company, meeting context, calendar metadataStructured briefing: news items, exec moves, social signals, competitive contextBackground (T-24h trigger), can be minutes
Auto-tailorCurrent deck (content model), buyer briefingProposed modifications (list of slide/block-level edits with rationale)Background (T-2h trigger), minutes acceptable
Voice-reactive suggestionsAudio stream (chunked), current deck state, current slide positionSuggestions: text + target slide/block + confidence score<3 seconds from relevant utterance
Follow-up deck draftMeeting transcript, original deck, action itemsDraft follow-up content blocks (recap, next steps, ask-specific addendum)Background (post-meeting), minutes acceptable
Live dashboard signalsAudio stream, speaker diarizationTalk-time per speaker, pacing assessment, key-phrase highlights, “buyer hasn’t spoken” flags<2 seconds
Meeting summarizationFull audio recording or transcriptStructured summary: action items, decisions, key moments, attendee contributionsPost-meeting, minutes acceptable
Voice-out / TTSText response from agent runtimeNatural speech audio stream with low latency<500ms first-byte for conversational feel
Context-drift detectionConversation message history + embeddingsTopic-shift signal (new topic detected, confidence score)<1 second per message
Migration content classificationRaw imported content (Notion pages, docs)Classification: project context vs. reference material vs. task vs. archiveBackground, seconds acceptable

The orchestrator dispatches AI agents. Each agent must conform to:

interface AgentContract {
agentType: string; // e.g., "research_buyer", "auto_tailor"
invoke(input: AgentInput): AsyncIterable<AgentEvent>;
// Events the agent must emit:
// - status_update: current step, progress estimate
// - task_delta: structured change to a task/artifact
// - completion: final output + one-sentence summary
// - error: failure with retry guidance
}

Alex paves the backend; Nate wires the frontend. Each wave ships backend work that unblocks frontend work. A wave is a coherent slice — not a time box. Sprints are the time box.

Why first: Everything downstream depends on typed contracts and a working API skeleton. Nate can’t build real UI without types and endpoints.

#ItemOwnerWhat ships
1.1Shared types from schemaAlexpackages/shared/ populated: Org, Member, Brain2Item, Task, AgentRun, SwarmRun, Conversation, Message, UserProfile, API key types. Generated Supabase types via supabase gen types.
1.2API service auth + Supabase clientAlexFastify middleware that validates Supabase JWT, extracts user/org context. Service-role Supabase client for backend operations.
1.3Org + profile endpointsAlexGET/PATCH org, GET org members, GET/PATCH user profile. Nate can build settings UI.
1.4API key management endpointsAlexCRUD for org API keys (BYOK). Encrypted storage, admin-only.
1.5Dashboard data endpointAlexAggregated endpoint: org summary, recent activity, member list. Unblocks Nate’s dashboard.

Nate unblocked on: Settings UI, dashboard shell, org management, user profile.

Why second: Brain² is the central data layer everything else reads/writes through. Chat feeds it, agents query it, meeting capture populates it. Build this before anything that depends on memory.

#ItemOwnerWhat ships
2.1Brain² CRUD APIAlexCreate/read/update/delete brain2 items. Filter by tier (hot/warm/cold), project, critical flag. Paginated list + single-item fetch.
2.2Brain² search (pgvector)AlexSemantic search endpoint: text query → embedding → cosine similarity search across warm+cold tiers. Uses vector(1536) with OpenAI text-embedding-3-small.
2.3Brain² tier cycling workerAlexBullMQ background job: evaluates items for demotion (hot→warm→cold) based on project activity, age, access frequency. Critical-flag items skip. Logs every demotion.
2.4Brain² re-promote endpointAlexOne-click re-promote: cold→warm or warm→hot. Reverses auto-demotion.
2.5Brain² intake endpointAlexAccepts content from other systems (chat auto-route, meeting capture) and classifies into the right tier.

Nate unblocked on: Brain² UI — the “second brain” view. Search interface. Memory timeline. Hot/warm/cold visualization.

Dependency note: Wave 2 requires Redis + BullMQ for the cycling worker. Set up Redis addon on Railway as part of 2.3.

Why third: The chat layer is the primary interaction surface — the main thing users type into. It feeds Brain² (wave 2) and later connects to the agent runtime (wave 4).

#ItemOwnerWhat ships
3.1Conversations + messages APIAlexCRUD for conversations (create, list, get with messages). Message streaming via Supabase Realtime (postgres_changes on messages table). Thread branching (parent_thread_id).
3.2Running doc auto-generationAlexAs messages arrive, maintain a concise running doc per conversation. Background job or trigger.
3.3Auto-route on closeAlexWhen conversation is archived/closed/inactive, route the running doc to a destination: Brain² tier, project folder, or task board. Confirmation chip (not a gate).
3.4Context-drift detection (v1)AlexBasic implementation: compute topic embeddings per message window, detect when similarity drops below threshold. Start conservative (explicit cues only). Auto-spawn new thread on drift.

Nate unblocked on: Chat UI — Claude-style sidebar, conversation history, thread navigation. The “reimagined terminal” is largely this + Brain² rendered in a terminal-like shell.

Wave 4 — Agent Runtime & In-App Task Board

Section titled “Wave 4 — Agent Runtime & In-App Task Board”

Why fourth: The agent runtime deploys AI agents against tasks. The in-app task board (not the project taskboard) is where agents and humans collaborate on project work.

#ItemOwnerWhat ships
4.1AgentContract + registryAlexTypeScript interface for agents (agentType, invoke → AsyncIterable). Agent registry for type→implementation lookup.
4.2AI gateway (BYOK routing)AlexResolve org’s provider credentials, route through Vercel AI SDK, log usage to ai_usage_records. Security boundary — credentials decrypted here only.
4.3Single-agent dispatcherAlexDispatch an agent against a task. Stream AgentEvents (status_update, task_delta, completion, error) back to the client via SSE.
4.4In-app task CRUDAlexCreate/read/update tasks within a project. Three sources: human, auto-extracted, agent-proposed. Assignee, status, project scope.
4.5Agent run trackingAlexTrack agent runs: model, tokens, current step, ETA. Attach runs to tasks. Stream progress.
4.6Agent completion detectionAlexAgents emit structured task-delta events. On completion, draft one-sentence summary. Flag candidate task completion for human review.
4.7Privacy gateAlexSolo/scratch agent sessions stay private. Only runs explicitly attached to a task surface to the team.

Nate unblocked on: Agent run UI, task board UI, efficiency lens (per-teammate AI usage), agent output streaming display.

Deferred from this wave (add incrementally): Swarm management, swarm-sizing recommendation, board deduplication. Start with single-agent runs.

Why fifth: Depends on agent runtime (wave 4). Voice is a modality on top of the existing agent + chat infrastructure.

#ItemOwnerWhat ships
5.1TTS engine integrationAlexSelect and integrate TTS engine (likely ElevenLabs or OpenAI TTS). Streaming audio output. <500ms first-byte target.
5.2Voice turn-taking WebSocketAlexPersistent WebSocket endpoint for voice sessions. Client sends audio chunks → STT → agent runtime → TTS → client plays audio. Turn-taking protocol.
5.3Barge-in handlingAlexClient-side detection of user speaking while agent is outputting. Interrupt agent mid-sentence, restart listening.

Nate unblocked on: Voice UI — mic button, audio playback, visual turn indicators.

Open question: TTS engine choice. Spike needed before committing.

Why sixth: Feeds Brain² and later pitch briefings. Not on the critical path for core hub experience but important for “knows your whole brain.”

#ItemOwnerWhat ships
6.1Meeting capture processorAlexBullMQ worker: accepts audio/transcript → STT (if audio) → structured summary (action items, decisions, attendees, named-entity tags).
6.2Granola integration (if available)AlexWebhook receiver: Granola sends transcript/summary → store pointer + metadata. Edge Function or API route.
6.3Brain² + task board feedAlexProcessed meeting outputs → Brain² warm tier. Action items → task board as proposed tasks.

Open question: Granola partnership model. Build native fallback first.

Why last in Phase 1: Important for adoption but not for core product experience. Teams can use DREAMTEAM without importing from Notion day one.

#ItemOwnerWhat ships
7.1Notion OAuth flowAlexOAuth integration for Notion API access. Stored at org level.
7.2Structure mapping engineAlexMap Notion hierarchy → DreamTeam structure. Pages/docs → Brain² (warm/cold). Databases/boards → task board. Teamspaces → workspace structure.
7.3Import pipeline workerAlexBullMQ worker: processes hundreds of pages. Preserves hierarchy, links, properties, assignees. Progress reporting.
7.4Re-sync (optional)AlexIncremental re-sync from Notion until full cutover. Conflict resolution if both sides edited.

Nate unblocked on: Migration UI — connect Notion, pick what to import, progress display, mapping review.

Cross-cutting (Nate-led, depends on waves 1-4)

Section titled “Cross-cutting (Nate-led, depends on waves 1-4)”
ItemOwnerDepends on
Reimagined Terminal shellNateWaves 1-3 (needs chat + brain2 APIs)
Dashboard with real dataNateWave 1 (dashboard endpoint)
Brain² UI (memory view)NateWave 2 (brain2 API)
Chat UI (sidebar, threads)NateWave 3 (chat API)
Agent run + task board UINateWave 4 (agent + task API)
Voice UINateWave 5 (voice pipeline)
Meeting capture UINateWave 6 (capture API)
Migration/onboarding UINateWave 7 (migration API)

#ProblemRiskMitigation
1Voice talkback pipeline latencyIf agent voice responses feel sluggish (>1s latency), the conversational interface feels broken — walkie-talkie, not conversationResearch TTS engines early. Prototype streaming voice output. Define barge-in handling strategy before building the full conversational interface.
2Brain² tier cycling under loadMoving items between tiers while maintaining query performanceStart with hot tier, add warm/cold incrementally when usage patterns are clear. pgvector reindexing can run as background jobs.
3Context-drift detection tuningToo aggressive = annoying thread fragmentation. Too lax = incoherent conversations.Start conservative (explicit cues only), add embedding-based detection as a tunable threshold. User override always available.
4Migration fidelityNotion page hierarchy, links, properties lost or flattened during importBuild a structural mapping layer, not just text extraction. Test against real Notion workspaces with complex hierarchies. Incremental re-sync introduces conflict resolution complexity.
5Multi-agent orchestration complexitySwarm management, completion detection, and board deduplication are each non-trivial systemsStart simple: single-agent runs. Add swarm features incrementally.
6Live deck mutation latencyViewer sees stale slides or janky transitions during a pitchBuild a prototype of the edit lifecycle early. Measure round-trip: edit approved → viewer sees update. Target <500ms.
7Screen-share-invisible chatMay require a desktop shell (Tauri/Electron), adding significant complexityFallback: mobile companion IS the invisible back-channel. Many pitch teams already have phones on the table. Desktop shell is post-mobile concern.
8Voice-reactive pipeline latencyIf AI suggestions arrive 10+ seconds after the relevant moment, they’re uselessDefine latency SLA with AI team early (<3s). Build the audio pipeline to stream chunks, not wait for complete utterances.
9Dual-mode rendering fidelityDeck and scroll views diverging in quality/behaviorInvest in the content model. If the abstraction is right, both renderers are straightforward. Prototype both views early.

#QuestionBlocksEngineering needs
1Granola partnership model (API, white-label, or screen-scraping shim?)Phase 1 meeting captureDetermines integration architecture
2Voice talkback stack — TTS engine + barge-in handling, client-side or server-streamed?Phase 1 conversational agent interfaceDetermines audio pipeline architecture
3Context-drift threshold — what signals trigger auto-spawned new thread, and how aggressive?Phase 1 chat layerDetermines detection model + tuning strategy
4Migration depth — one-time cutover import vs. live two-way sync with Notion? Conflict handling?Phase 1 migrationDetermines sync architecture complexity
5Full-screen-share invisibility — solvable, or accept window-share-only?Phase 2 invisible chatDetermines whether to rely on mobile fallback
6Per-brand upfront fee structure (fixed, deck-volume-scoped, tiered?)Phase 2 onboarding flowDetermines billing UI + Stripe product setup
7Marketplace revenue split (flat % or tiered?)Phase 2 marketplaceDetermines Stripe Connect configuration
8Push-lifecycle countdowns — static defaults or auto-tuned?Phase 2 edit lifecycleStatic is much simpler; auto-tuned needs historical data
9Task-delta event format — canonical schema?Phase 1 agent orchestratorDetermines the agent runtime contract
10Cross-tool agent ingestion — Claude Code / Cursor / arbitrary CLIs, or only DREAMTEAM-launched agents?Phase 1 agent orchestratorDetermines whether orchestrator needs a generic agent adapter layer
11Sublinear index choice — HNSW vs. FAISS-IVF vs. bespoke?Phase 1 Brain² cold tierpgvector uses HNSW natively; if FAISS is required, need separate service
12Swarm-sizing model — heuristic table, learned-from-history, or LLM-judged?Phase 1 orchestratorDetermines recommendation engine complexity
13Board-dedupe matching — how strict before flagging accidental completion?Phase 1 orchestratorDetermines matching strategy (exact title vs. semantic vs. artifact overlap)

10. Parked — Creative Intelligence (Bucket 4)

Section titled “10. Parked — Creative Intelligence (Bucket 4)”

The following systems from the DREAMTEAM Spec are parked, not sequenced:

  • Award-show credit database + scoring index
  • Love-the-Work-More AI — multi-modal study of award-winning work
  • Legend Arsenal — AI personas of advertising legends
  • Public MCP Server — metered API exposing the knowledge corpus to external agents

These will be revisited once DREAMTEAM is a working product. The orchestrator in Phase 1 is designed to be agent-agnostic, so Legend Arsenal personas can plug in later without architectural changes.


This document maps the DREAMTEAM Working Spec, Build Order v3, and wave-level execution plan to engineering reality. Updated 2026-05-29.