acadable / labs/research/assembly-ai-lab
    RESEARCH · PROTOTYPEMULTI-AGENT SYSTEMSAPPLIED AI

    Assembly AI Lab

    A multi-agent constitutional deliberation platform - turning legal text into structured, observable debate between AI delegates.

    AUTHORS
    Sachin Verma
    Rishi Raj Das
    PERIOD
    Jan – May 2026
    STACK
    React · TypeScript · Express · Firestore · LLM providers
    STATUS
    Working prototype · not production-hardened
    // ABSTRACT

    Abstract

    Assembly AI Lab is a research prototype that recreates a constitutional assembly using AI delegates. A user uploads a constitution or passage of law, the system parses it into clause-level units, and an orchestrator runs a structured deliberation session - speaker election, clause-by-clause debate, amendments, voting, summaries, and a final narrative report.

    The system is built as a React + TypeScript frontend, an Express + TypeScript backend, and a Firebase Firestore layer providing real-time persistence. Large language models are accessed through a provider abstraction. The orchestrator is the most distinguishing component: rather than producing free-form chatter, it drives delegates through a deterministic procedural workflow that produces transcripts and metrics suitable for academic review.

    KEYWORDS
    Multi-Agent DebateConstitutional DeliberationLLM OrchestrationReal-time PersistenceDocument IntelligenceResearch Prototype
    // ARCHITECTURE

    System architecture

    Three layers, separated by clear contracts. The frontend renders state; the backend writes it; Firestore synchronizes everything in real time.

    high-level architecture
    Frontend
    React + TypeScript + Vite
    Pages, workspace, analytics, SessionContext, Firestore listeners
    Backend
    Express + TypeScript
    Session creation, launch, control, parsing, model adapters
    Firebase Firestore
    Real-time persistence
    Constitutions, clauses, sessions, agents, messages, events, amendments, votes, metrics, reports
    ↓ reads via SDK ↓
    ↓ writes via Admin SDK ↓
    ↑ subscribes ↑
    LIVE STATE BUS
    Frontend reads live session state directly from Firestore - no polling required.
    Browser Speech Synthesis
    Web Speech API
    Playback ACK loop for serialized spoken turns - the workspace plays delegate speech client-side and notifies the backend on completion.
    LLM Providers
    Adapter layer
    Groq (default), Gemini, Ollama, xAI - swappable behind one interface.
    Figure 1. High-level architecture of Assembly AI Lab showing the React frontend, Express backend, Firestore as live-state bus, browser speech synthesis, and pluggable LLM providers.
    // METHODOLOGY

    End-to-end orchestration

    The orchestrator is the system's distinguishing feature. Rather than free-form chat, it drives a deterministic five-phase workflow from upload to final report.

    1

    Constitution ingestion

    User uploads a PDF or TXT. Backend extracts text and applies parsing logic to detect headings - article, section, part. Each clause becomes a Firestore document under a parent constitution. When no clean structure is detected, the system falls back to chunk-based segmentation so a session can still proceed.

    2

    Session configuration

    User specifies the constitution, one or more language models, the number of active agents, max clauses, majority threshold, speech preferences, rebuttal behavior, and whether a speaker is elected. The backend validates and writes a normalized session shell to Firestore.

    3

    Orchestration & debate

    On launch, the backend acquires a Firestore lock to prevent duplicate orchestrators. Delegate agents are instantiated from persona templates; an optional speaker election runs. For each clause: openings → optional rebuttals → amendment proposals → evaluation → voting → patch application. Every event writes to Firestore in real time.

    4

    Live state & frontend monitoring

    The workspace subscribes directly to the session document and its subcollections (agents, messages, events, amendments). The frontend also drives browser-side speech synthesis with a playback-ACK handshake so the orchestrator advances safely.

    5

    Finalization & output

    After the last clause, the orchestrator assembles the final draft, writes a narrative report under the reports collection, updates lifecycle state, and releases the session lock. Stored transcripts, metrics, amendments, and reports remain available for post-session review.

    Figure 2. End-to-end orchestration workflow from constitution upload and clause parsing through session launch, debate rounds, accepted amendments, metrics generation, and final report writing.
    // FINDINGS

    Architectural & functional results

    Three observations stood out across the implementation: a clean separation of concerns, Firestore as a live synchronization layer (not just a database), and a procedural orchestrator that makes deliberation auditable.

    Clean three-layer separation

    React frontend, Express backend, and Firestore form a clear boundary stack. Each layer is independently understandable and observable in real time, which made debugging orchestration-stage transitions tractable.

    Firestore as a live event bus

    Subscribing the workspace directly to session documents and subcollections eliminated a polling loop and let the UI animate as the orchestrator wrote events - closer to a streaming-state model than a request-response one.

    Clause-level document intelligence

    Treating ingestion as a parser problem (headings - clause records) rather than free-form chunking made every later step - debate, amendment, vote, summary - addressable per clause and traceable back to the source document.

    Procedural orchestrator over free chat

    The deterministic phase machine (open → rebut → amend → evaluate → vote → apply) produced transcripts that read as deliberation rather than conversation, and made post-session review meaningful instead of anecdotal.

    The platform combines a technical design, real-time data persistence, and a structural format of deliberation into one place. At the same time, parts of the system have conceptual richness exceeding their current implementation maturity.

    - From the project's own results & discussion section
    // KNOWN GAPS

    What this prototype is honest about

    The implementation is partially complete and the report is candid about it. These are the contract gaps and engineering shortfalls we'd close before calling it production-ready.

    AREA
    OBSERVED GAP
    IMPACT
    Analytics payload
    Frontend expects aggregate KPIs, heatmaps, rankings, trends. Backend currently returns plain metric data.
    Analytics views render incomplete.
    Report payload
    Frontend renders structured executive-summary + key-findings layouts. Backend writes a more primitive narrative.
    Report page falls back to a stub.
    Configuration keys
    Field names in the session-creation UI don't always match the backend's expected keys.
    Some user-set options silently default.
    Hand-raise queue
    Modeled in the session shell but not populated by the backend pipeline.
    UI element is currently cosmetic.
    Test coverage
    Confidence is largely from static analysis and manual verification - minimal integration or smoke tests in the repo.
    Regressions hard to catch automatically.
    Security & access control
    Direct frontend-to-Firestore reads without production-grade rules or authentication scoping.
    Not yet safe for shared deployment.
    // FUTURE WORK

    What comes next

    01

    Contract unification

    A single shared schema for session config, metrics, and reports - synchronized across backend and frontend so every visible field has a runtime impact.

    02

    Testing & reproducibility

    Integration tests, orchestrator smoke tests, and a deterministic mock LLM provider so demonstration sessions become repeatable.

    03

    Analytics enhancement

    Delegate-influence estimation, consensus measurement, amendment-acceptance analysis, cross-session comparison.

    04

    Session reporting

    Full narrative report generation plus direct export of session summaries as paper-ready artifacts.

    05

    Security & authentication

    Production Firestore rules, authentication, secret management, structured error logging.

    06

    Visual interface

    A visual state machine, session presets, and explanations aimed at non-technical readers of debate transcripts.

    // CITE

    Cite this work

    bibtex
    @techreport{verma2026assembly,
      title   = {Assembly AI Lab: A Multi-Agent Constitutional
                 Deliberation Platform},
      author  = {Verma, Sachin and Das, Rishi Raj},
      year    = {2026},
      month   = {May},
      type    = {Research Prototype Report},
      institution = {Acadable Labs},
      note    = {Working prototype}
    }

    Want the full report, the Firestore schema, or to talk about extending the orchestrator? Get in touch.