Rapto AI System Design: Inside Our Distributed Meeting Accountability Architecture

A comprehensive, code-level teardown of Rapto AI's distributed backend: Node.js API, Python FastAPI AI pipeline, polyglot persistence (PostgreSQL + MongoDB + Redis), BullMQ queue workers, and cross-meeting resolution state machines.

Sarah Chen, Head of AI & Systems Architecture at Rapto AI
Sarah Chen

Head of AI & Systems Architecture

•14 min read•Updated Sep 2, 2026
High-throughput distributed backend server network topology representing Rapto AI system design
High-throughput distributed backend server network topology representing Rapto AI system design

Why Rapto AI Needs This Architecture

Modern meeting assistants typically suffer from two severe structural shortcomings:

  • The Passive Transcript Trap: They act as basic audio transcription recorders that dump thousands of words into passive summary documents nobody reads.
  • Stateless Disconnection: They treat every meeting as an isolated, ephemeral event, completely blind to promises made in prior standups or sprint reviews.
  • Rapto AI is engineered specifically to solve the Accountability Gap—turning ephemeral spoken conversations into persistent, tracked commitments that bi-directionally sync with developer issue trackers (Linear, Jira) and verify resolution across successive meetings.

    To deliver this at production scale, the platform must satisfy five demanding technical requirements:

  • Asynchronous Multi-Stage Processing: Ingest multi-gigabyte audio streams and thousands of diarized dialogue turns without blocking the user-facing REST API.
  • Dual Persistence Model: Maintain ACID transaction guarantees for multi-tenant billing, permissions, and team ownership (PostgreSQL), while storing large, flexible transcript payloads and prompt traces (MongoDB).
  • Deterministic NLP State Extraction: Extract structured commitments (Actor, Action, Deadline, Confidence) from messy human dialogue while defending against LLM hallucinations.
  • Cross-Meeting Memory Graph: Match current spoken phrases (e.g., "I pushed the auth fix yesterday") against historical open promises across weeks of standups.
  • High-Throughput Webhook Orchestration: Ingest and dispatch real-time webhooks across Zoom, Google Meet, Microsoft Teams, Linear, Jira, Slack, and Paddle.

  • High-Level System Architecture

    Rapto AI employs a decoupled microservices architecture separated along functional domain boundaries: an edge reverse proxy gateway, a Node.js Core API, a Python AI extraction microservice, an asynchronous BullMQ worker cluster, and a polyglot data tier.

    Interactive Architecture Diagram (React Flow)
    Interactive Rapto AI High-Level Architecture — Pan, zoom, and drag nodes to explore the ingress, compute, data, and integration layers

    Core Services Breakdown

    The backend is partitioned into three specialized runtime environments:

    1. Node.js Core API Gateway (Express + TypeScript)

    Located in services/api, this service runs on Node.js 20+ with Express and TypeScript. It acts as the central business logic controller, multi-tenant authentication provider, and external webhook listener.

  • Authentication & Identity: JWT access tokens (15-minute expiry in memory) + cryptographically hashed refresh tokens (30-day sliding window in PostgreSQL), OAuth 2.0 (Google, Microsoft, GitHub), and SAML 2.0 / OIDC enterprise SSO.
  • Multi-Tenancy & Authorization: Enforces strict teamId partition rules using Prisma ORM middleware and RBAC/ABAC permission checks (OWNER, ADMIN, MANAGER, MEMBER).
  • Bot & Calendar Sync: Contains calendar-sync.service.ts for polling Google Calendar and Outlook Graph deltas, and dedup.service.ts to ensure only one bot joins a multi-attendee meeting.
  • Speaker Resolution: Runs owner-resolver.service.ts to map fuzzy speech tags (e.g., "Sarah", "sarah@company.com", "Sarah C") to verified team member IDs.
  • 2. Python AI Pipeline Microservice (FastAPI + Pydantic)

    Located in services/ai-pipeline, this service runs on Python 3.11 with FastAPI and Uvicorn. It is dedicated strictly to compute-heavy natural language processing, semantic similarity calculations, prompt template compilation, and OpenAI API orchestration.

  • Sliding-Window Chunker (chunker.py): Splits raw transcripts into token-bounded segments (EXTRACTION_CHUNK_MAX_TOKENS = 3000) with overlapping dialogue turns (EXTRACTION_CHUNK_OVERLAP_TURNS = 2) to preserve conversational context across split boundaries.
  • Hierarchical Extractor (extractor.py): Executes concurrent multi-chunk extraction via asyncio.gather(return_exceptions=True), followed by a meta-summary synthesis pass.
  • Cross-Chunk Entity Deduplication: Compares extracted decisions, blockers, and commitments across chunks using normalized Levenshtein and cosine similarity with a strict threshold (_CROSS_CHUNK_DEDUP_THRESHOLD = 0.70).
  • Cross-Meeting Resolution Engine (resolution_detector.py & commitment_resolver.py): Evaluates active open commitments from historical meetings against current conversational utterances to detect fulfillment, blockers, or timeline amendments.
  • 3. Distributed Background Workers (BullMQ + Redis)

    Running as a dedicated container (rapto-worker), this Node.js process consumes jobs from Redis-backed BullMQ queues. It decouples long-running asynchronous workflows from client HTTP latency.


    Request / API Data Flow

    Every external HTTP request entering Rapto AI passes through an engineered validation, authentication, and rate-limiting pipeline:

    mermaid
    sequenceDiagram
      autonumber
      actor User as Web / Mobile Client
      participant Nginx as NGINX Reverse Proxy
      participant API as Node.js API Gateway
      participant Redis as Redis 7 (Rate Limit & Cache)
      participant Postgres as PostgreSQL (Prisma ORM)
      participant Worker as BullMQ Queue
    
      User->>Nginx: POST /api/v1/meetings/{id}/process (Bearer JWT)
      Nginx->>Nginx: Rate Limit Check (Zone: api_limit)
      Nginx->>API: Proxy to http://api:5000
      API->>API: Validate JWT Signature & Expiry
      API->>Redis: Check User Session & Permissions Cache
      alt Cache Miss
        API->>Postgres: Query TeamMember & Role (Prisma RLS)
        API->>Redis: Cache Session (TTL: 300s)
      end
      API->>Postgres: Verify Resource Ownership (teamId match)
      API->>Worker: Enqueue Job into 'extract.queue'
      API->>Postgres: Update MeetingStatus to 'PROCESSING'
      API-->>User: HTTP 202 Accepted { jobId: "job_9841fbc", status: "PROCESSING" }

    Service-to-Service Communication & HMAC Security

    The Node.js API and Python AI Pipeline communicate over private internal Docker networks (rapto-app-network). To prevent unauthorized execution or internal request spoofing, all inter-service endpoints enforce strict cryptographic authentication:

    mermaid
    sequenceDiagram
      autonumber
      participant Worker as Node.js BullMQ Worker
      participant AIPipeline as Python FastAPI (:8001)
      participant OpenAI as OpenAI API
    
      Worker->>Worker: Prepare ExtractRequest Payload
      Worker->>Worker: Attach 'X-Service-Key' Header (API_SHARED_SECRET)
      Worker->>AIPipeline: POST /api/v1/extract (JSON Payload)
      AIPipeline->>AIPipeline: verify_internal_service_key() (Constant-Time Compare)
      alt Key Invalid / Missing
        AIPipeline-->>Worker: HTTP 401 Unauthorized
      end
      AIPipeline->>AIPipeline: Chunk Transcript & Tokenize (tiktoken)
      AIPipeline->>OpenAI: Concurrent Structured Extraction (GPT-4o)
      OpenAI-->>AIPipeline: Structured JSON Entities
      AIPipeline->>AIPipeline: Cross-Chunk Deduplication (threshold: 0.70)
      AIPipeline-->>Worker: HTTP 200 OK (ExtractResponse Model)
    python
    # Python FastAPI Inter-Service Authentication Dependency
    async def verify_internal_service_key(
        x_service_key: Optional[str] = Header(None, alias="X-Service-Key")
    ) -> None:
        if not x_service_key:
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Missing X-Service-Key authentication header"
            )
        if not secrets.compare_digest(x_service_key, settings.API_SHARED_SECRET):
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Invalid service key credentials"
            )

    Database & Polyglot Persistence Architecture

    Rapto AI rejects the anti-pattern of forcing all data structures into a single database. Instead, it leverages a Polyglot Persistence model optimized for access patterns, scale, and compliance:

    Interactive Architecture Diagram (React Flow)
    Interactive Polyglot Storage Architecture — PostgreSQL ACID models, MongoDB transcript documents, and Redis queue/caching layers

    PostgreSQL: Relational Source of Truth & Tenant Isolation

  • Managed with Prisma ORM with migration parity across staging and production.
  • Houses high-integrity entities requiring strict relational foreign keys and ACID transactional integrity (e.g., users, teams, memberships, commitment statuses, external ticket mappings, Paddle subscription states).
  • Tenant Isolation: Every tenant entity includes an indexed team_id foreign key. PostgreSQL Row-Level Security (RLS) policies enforce hardware-level database isolation.
  • MongoDB: Large Semi-Structured Transcript Document Store

  • A typical 60-minute meeting produces over 1,500 diarized dialogue turns, acoustic word-level confidence arrays, and structured prompt audit logs.
  • Storing large multi-megabyte JSON trees in relational tables causes table bloat and high memory pressure. MongoDB stores raw transcripts and intermediate LLM payloads with flexible schemas and sub-millisecond retrieval.
  • Redis: BullMQ Queues, Distributed Locks & Session Caching

  • Houses 9 BullMQ job queues.
  • Stores short-lived ephemeral OAuth state verification tokens (oauth:state:{token}, TTL 600s).
  • Acts as a distributed lock manager (redlock) to prevent race conditions during calendar bot dispatches and Paddle webhook processing.

  • Async Processing & Queue Topology

    The platform relies on a distributed cluster of 9 specialized BullMQ queues to handle all asynchronous computation:

    Interactive Architecture Diagram (React Flow)
    Interactive BullMQ Asynchronous Processing Pipeline — Dependency graph of all 9 queue stages
    Queue NameWorker FileConcurrencyJob Responsibility
    **`transcribe.queue`**`transcribe.worker.ts`5Ingests Recall.ai webhooks, stores diarized transcripts in MongoDB, triggers extraction.
    **`extract.queue`**`extract.worker.ts`10Chunks transcript, calls Python AI microservice, persists extracted commitments to PostgreSQL.
    **`resolve.queue`**`resolve.worker.ts`5Executes cross-meeting resolution against past open promises, updates fulfillment states.
    **`integrate.queue`**`integrate.worker.ts`15Dispatches bi-directional issues into Linear, Jira, Notion, and Slack.
    **`notify.queue`**`notify.worker.ts`20Sends Brevo transactional emails, Slack Block Kit messages, and Socket.io events.
    **`calendar-sync.queue`**`calendar-sync.worker.ts`5Syncs Google Calendar and Microsoft Outlook Graph deltas every 15 minutes.
    **`calendar.queue`**`calendar.worker.ts`10Schedules and dispatches Recall.ai bot instances for upcoming calendar events.
    **`deadline.queue`**`deadline.worker.ts`2Cron-like worker evaluating upcoming and overdue commitment deadlines.
    **`token-refresh.queue`**`token-refresh.worker.ts`3Proactively refreshes expiring OAuth access tokens before integration API calls fail.

    Important End-to-End User Workflow

    Here is how a real-world commitment transitions from spoken audio to a closed Linear issue and an updated Team Health Score:

    Interactive Architecture Diagram (React Flow)
    Interactive End-to-End Commitment Lifecycle — From spoken meeting dialogue to automated Linear issue and Team Health Score update
    mermaid
    sequenceDiagram
      autonumber
      actor Engineer as Engineer (Dave)
      participant Meet as Video Conference (Google Meet / Zoom)
      participant Recall as Recall.ai Recording Bot
      participant API as Node.js API Gateway
      participant Worker as BullMQ Worker Cluster
      participant PythonAI as Python AI Pipeline
      participant DB as PostgreSQL & MongoDB
      participant Linear as Linear / Jira Backlog
      participant Slack as Slack Channel
    
      Engineer->>Meet: "I'll benchmark the connection pool before Thursday's release"
      Meet-->>Recall: Audio Stream Captured
      Meet->>Meet: Meeting Concludes
      Recall->>API: Webhook: bot.status_change (DONE + Transcript URL)
      API->>Worker: Enqueue to 'transcribe.queue'
      Worker->>DB: Store Diarized Transcript into MongoDB
      Worker->>Worker: Enqueue to 'extract.queue'
      Worker->>PythonAI: POST /extract (Cleaned Transcript)
      PythonAI->>PythonAI: Chunking + Structured Entity Extraction
      PythonAI-->>Worker: Extracted Commitment: { Actor: "Dave", Action: "Benchmark connection pool", Deadline: "2026-09-04" }
      Worker->>DB: Resolve Speaker Dave -> TeamMember usr_982 & Insert Commitment (PENDING)
      Worker->>Worker: Enqueue 'integrate.queue' & 'resolve.queue'
      Worker->>Linear: POST /issues (Create Issue: "Benchmark connection pool")
      Linear-->>Worker: Issue Created (ENG-842)
      Worker->>DB: Save ExternalCommitmentMapping (Jira/Linear ID: ENG-842)
      Worker->>Slack: Send Interactive Block Kit Card to #eng-backend
    
      Note over Engineer,Meet: Next Standup (3 Days Later)
      Engineer->>Meet: "That connection pool benchmark is done, latency dropped 40%"
      Meet-->>Recall: Audio Stream Captured
      Recall->>API: Webhook: Transcript Ready
      Worker->>PythonAI: POST /resolve (Unresolved Commitments + Current Transcript)
      PythonAI->>PythonAI: Vector Similarity Match (0.89 Confidence)
      PythonAI-->>Worker: Resolution: { commitmentId: "cmt_104", status: "FULFILLED" }
      Worker->>DB: Update Commitment status = 'FULFILLED'
      Worker->>DB: Recalculate TeamHealthScore (Recency-Weighted Velocity)
      Worker->>Slack: Update Slack Card: FULFILLED ✓

    External Integrations & Bot Orchestration

    Rapto AI connects directly with enterprise identity, meeting, productivity, and billing platforms:

  • Video & Audio Capture: Interfaced via Recall.ai, supporting automated bot dispatch and native calendar ingestion across Zoom, Google Meet, Microsoft Teams, and Webex.
  • Calendar Synchronization: Bidirectional delta-token sync with Google Calendar API v3 and Microsoft Graph API.
  • Work Management: Deep bi-directional OAuth integrations with Linear SDK, Atlassian Jira REST API, and Notion API.
  • Real-Time Team Comms: Slack Bolt SDK with interactive Block Kit messages, commitment snooze actions, and fulfillment broadcasts.
  • Transactional Email: Brevo (Sendinblue) API for transactional onboarding drips, password resets, and automated Monday morning accountability digests.
  • SaaS Billing & Subscriptions: Paddle Billing v2 SDK with cryptographic webhook signature verification (Paddle-Signature SHA-256 HMAC) managing multi-tier team subscriptions (STARTER, GROWTH, BUSINESS, ENTERPRISE).

  • Security, Authentication & Multi-Tenancy

    Rapto AI is engineered to satisfy enterprise security audits and SOC-2 Type II controls:

    mermaid
    graph TD
      subgraph Security_Architecture [Defense-in-Depth Security Layers]
        L1[Layer 1: Edge TLS 1.3 & NGINX Rate Limiting]
        L2[Layer 2: JWT Access Token 15m + Rotating HttpOnly Refresh Token 30d]
        L3[Layer 3: Prisma ORM Tenant Middleware auto-injecting teamId]
        L4[Layer 4: PostgreSQL Row-Level Security RLS Policies]
        L5[Layer 5: AES-256-GCM Envelope Encryption for OAuth Tokens]
        L6[Layer 6: Zero-Data-Retention Agreements on LLM Pipelines]
      end
    
      L1 --> L2
      L2 --> L3
      L3 --> L4
      L4 --> L5
      L5 --> L6
  • Token Rotation & Theft Detection: If an attacker attempts to replay an expired or already-rotated refresh token, the system instantly revokes all active sessions for that user and fires a security alert.
  • Encrypted Secrets: All third-party OAuth access and refresh tokens (Jira, Linear, Google, Slack) are encrypted at rest using AES-256-GCM before writing to PostgreSQL.
  • Zero Foundation Model Training: Customer conversational audio and transcripts are processed exclusively under zero-data-retention (ZDR) enterprise terms. Raw audio buffers are deleted immediately following transcription.

  • Scalability, Resilience & Fault Tolerance

    To guarantee 99.9% uptime during traffic surges (e.g. all client standups concluding simultaneously at 9:30 AM EST), the architecture implements several defensive patterns:

  • Hierarchical Chunking with Error Isolation: In services/ai-pipeline/src/services/extraction/extractor.py, multi-chunk processing uses asyncio.gather(return_exceptions=True). If chunk 3 fails due to a transient API blip, chunks 1, 2, and 4 still succeed, returning a Partial Extraction (HTTP 206) rather than crashing the entire meeting job.
  • Transcript Cleanup Degradation: If the text cleanup pipeline fails, the state transitions to TRANSCRIPT_CLEANUP_DEGRADED and immediately routes the raw transcript to the extractor.
  • Dead Letter Queues (DLQ) & Exponential Backoff: All BullMQ workers configure exponential backoff (e.g., attempts: 5, backoff: 3000ms exponential). Jobs exceeding max retries are moved to a dead-letter queue with Sentry alerting.
  • Proactive OAuth Token Refresher: token-refresh.worker.ts runs every 10 minutes to refresh tokens expiring within the next 30 minutes, eliminating 401 Unauthorized errors during webhook dispatches.

  • Key Architectural Trade-offs

    Every production system design represents deliberate trade-offs:

    DecisionChosen ArchitectureRejected AlternativeEngineering Rationale
    **Backend Language Split**Node.js (API) + Python (AI)Single Node.js or Python MonolithNode.js excels at high-concurrency webhook I/O and OAuth integrations. Python is non-negotiable for robust AI chunking, tokenization, and vector similarity mathematics.
    **Data Storage Model**Dual (PostgreSQL + MongoDB)Pure PostgreSQL (JSONB) or Pure MongoDBJSONB in PostgreSQL causes table bloat on multi-megabyte transcripts. Pure MongoDB lacks strict relational foreign keys and ACID billing transactions.
    **Task Synchronization**Asynchronous BullMQ QueueSynchronous HTTP ChainingProcessing audio, LLM extraction, and syncing 4 external issue trackers takes 15–45 seconds. Synchronous calls would cause client HTTP timeouts.
    **Multi-Tenancy**Shared Schema + Tenant ColumnDatabase-per-tenantDatabase-per-tenant creates massive operational overhead (running 1,000+ Postgres instances) and slow schema migrations for B2B SaaS.

    Lessons for Building a Production SaaS Platform

  • Decouple Fast I/O from Heavy LLM Inference: Never make your user-facing API wait on an LLM inference call. Return HTTP 202 Accepted immediately and push processing to background workers.
  • Design State Machines with Degraded Fallbacks: AI APIs will timeout, rate-limit, or hallucinate. Your system must support explicit degradation states (EXTRACTED_PARTIAL, TRANSCRIPT_CLEANUP_DEGRADED) so users still get value.
  • Treat Token Lifecycles as First-Class Citizens: If you integrate with third-party tools (Linear, Jira, Slack, Google Calendar), proactive background token refreshing is mandatory. Never wait for an API call to fail with a 401 to refresh tokens.
  • Isolate Raw Transcripts from Relational Rows: Transcripts are write-heavy, large, and read infrequently after processing. Keep them in document storage or object stores to keep your primary relational database lean and lightning-fast.

  • Frequently Asked Questions

    json
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [
        {
          "@type": "Question",
          "name": "Why did Rapto AI split the backend between Node.js and Python?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Node.js with TypeScript is uniquely suited for high-throughput, I/O-intensive operations like handling hundreds of concurrent OAuth webhook integrations, managing real-time Socket.io connections, and serving low-latency REST APIs. Python with FastAPI provides first-class native tooling for tokenization, chunking, and AI model orchestration."
          }
        },
        {
          "@type": "Question",
          "name": "How does Rapto AI ensure multi-tenant data isolation?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Rapto AI implements defense-in-depth tenant isolation: application middleware, Prisma ORM query extensions auto-injecting teamId filters, PostgreSQL Row-Level Security (RLS), and namespace-scoped Redis keys."
          }
        }
      ]
    }

    Frequently Asked Questions

    Node.js with TypeScript is uniquely suited for high-throughput, I/O-intensive operations like handling hundreds of concurrent OAuth webhook integrations (Jira, Linear, Slack, Google Calendar, Outlook), managing real-time Socket.io connections, and serving low-latency REST APIs. Python with FastAPI provides first-class native tooling for machine learning, tokenization via tiktoken, sliding-window chunking, NumPy/SciPy similarity matrix computations, and asynchronous LLM orchestration with Pydantic type safety.

    Share:
    Sarah Chen, Head of AI & Systems Architecture at Rapto AI
    Sarah ChenHead of AI & Systems Architecture

    Ex-DeepMind Research, MIT EECS, 12+ Distributed AI Patents

    Sarah leads AI systems architecture at Rapto, specializing in large language model reasoning, real-time audio pipeline synthesis, and deterministic state extraction from multi-party conversations. Former Senior Staff Research Engineer at DeepMind and MIT EECS alum.

    Related Deep-Dives & Guides

    Ready to keep every meeting promise?

    Onboard your entire team in under 5 minutes. Flat team rates, zero per-seat anxiety.

    No credit card required · 5 free meetings/mo · Works with Zoom, Meet & Teams