Agent orchestration platform optimised for marketing.
vitereactexpressxaiobsidianpostgres

Key Facts

  • Role: Lead Engineer (Fork Maintainer & Extension Author)
  • Stack: React 19, Express 5, Drizzle ORM, PostgreSQL, Temporal-style Heartbeats, PostBridge API, pnpm Monorepo
  • Target: Autonomous AI marketing teams & internal content ops
  • Status: Active Internal Tool (Fork of Paperclip)

Executive Summary

Managing a fleet of AI agents across different runtimes quickly becomes untenable when each agent runs in isolation with no shared state or governance. Paperclip is an open-source orchestration platform that solves this by modelling autonomous agent teams as companies—complete with org charts, budgets, and approval workflows.

I forked Paperclip to engineer a content production automation layer for Arkwright Solutions. The fork adds a full content lifecycle: AI-driven research, multi-platform drafting, human approval with social previews, and automated publishing via the PostBridge API. The result is an autonomous content team—an AI "marketing department"—that researches, writes, and publishes across LinkedIn and X with minimal human oversight.

The Challenge

Running AI agents at scale exposes critical friction points that individual prompting sessions hide:

  • Context Fragmentation: Agent A doesn't know what Agent B just did, leading to duplicated work and conflicting decisions.
  • Runaway Costs: A single agent can burn through hundreds of dollars of API credits in an hour if left unchecked.
  • Governance Gaps: Autonomous agents need a secure approval gate before modifying production systems or publishing public content.
  • Temporal Scheduling: Content production requires publishing at optimal times, which agents don't naturally handle.

The Stack

The system prioritizes batteries-included local development and production scalability:

  • Frontend: React 19, Vite 6, Tailwind CSS v4, Radix UI.
  • Backend: Express 5, Drizzle ORM, PostgreSQL.
  • Realtime: WebSocket server for live event streaming and agent heartbeat monitoring.
  • Agent Adapters: Support for 8+ runtimes including Claude Code, Codex, and Gemini.
  • Arkwright Extensions: PostBridge (publishing API), dnd-kit (drag-and-drop scheduling), rrule (recurrence), MDX Editor (approval editing).

Key Architectural Decisions

1. Companies as First-Class Entities & Heartbeats

Paperclip models agent teams as hierarchical companies rather than flat lists of prompts.

  • Org Chart Enforcement: Each agent has a defined role (CEO, VP Marketing, Writer) with hierarchical reporting lines. Tasks trace their lineage back to company-level missions.
  • The Heartbeat System: Agents don't run continuously. They "wake up" on heartbeats—either event-driven (assigned task) or periodic (polling).
  • Atomic Checkout: Task assignment uses database-level locking to prevent two agents from working on the same ticket simultaneously.

2. Governance via PostBridge Approval Workflows

I engineered a secure boundary between agent drafts and live social platforms.

  • Content Gallery: A vertical scroll feed where reviewers see "Social Previews" (mock LinkedIn/X cards) exactly as they will appear to followers.
  • The PostBridge API: Approved content is handed off to a specialized client (postbridge.ts) that abstracts platform-specific APIs.
  • Context Deferral: To save tokens, PostBridge API references are removed from the agent's pre-approval context, only being injected into the runtime environment after human sign-off.

3. Self-Improving Feedback Loops

When a reviewer declines content, it triggers a structured feedback cycle:

  • MDX Feedback: Reviewers write rejection notes with rich formatting.
  • Skill Absorption: The authoring agent is woken with the feedback payload and absorbs the rationale into its persistent "skill-graph" or context documents.
  • Iterative Redrafting: The agent re-drafts and resubmits, creating a team that measurably improves based on human critique.

4. Proactive Slot Engine & RRULE Scheduling

I built a bridge between the agent team and a professional marketing calendar.

  • The Slot Engine: Scans upcoming empty slots and wakes the assigned content agent with enough lead time to research and draft before the window closes.
  • RRULE Templates: Recurrence rules define placeholder slots (e.g., "LinkedIn thought leadership every Tuesday at 9am GMT"), which the engine materializes on-demand.

Outcome

The Arkwright Paperclip fork transforms a general-purpose agent platform into a specialized content production engine. It proves that AI agents can operate as a coordinated team with proper governance and cost control. For Arkwright, it serves as a powerful proof-of-concept for client engagements: demonstrating exactly what a fully autonomous, human-governed marketing department looks like in production.