AI Agent Orchestration · Solo Developer
Marketing OS
An Electron control tower that turns Claude Code, Codex, and OpenCode into scheduled, self-governing content agents — with a PostgreSQL anti-duplication registry, QC gating, and Facebook publishing analytics.
- Role
- Sole designer & developer
- Codebase
- ~11K lines · 46 files · 9 Python scripts
- Data
- 5-table PostgreSQL schema
- Stack
- Electron · Node.js · Python · PostgreSQL · MCP
The problem
Hands-on content doesn't scale. Naive automation doesn't either.
Shipping content at volume means running the same loop by hand: research what's working, write something new, check it isn't a repeat, and only then publish. Manually it doesn't scale. Naively with an LLM it floods the page with near-duplicates and unvetted output. Marketing OS replaces that ad-hoc loop with a supervised, governed pipeline — a desktop control tower where the models do the work and a registry guarantees nothing duplicated or unapproved ever reaches production.
My role
Sole designer and developer. Architecture, the Electron app, the Python pipelines, the PostgreSQL schema, the MCP server, agent orchestration, and the Facebook integration were all built from scratch.
What it does
An orchestration, safety, retrieval and data-integrity story.
Agent orchestration layer
Multiple agent CLIs — Claude Code, Codex, OpenCode — driven through one unified session model: real PTY sessions (node-pty + xterm.js) for human-in-the-loop work, headless stream-JSON runs for one-click autopilot, and a /-skill picker that injects any installed SKILL.md into a session's context.
Custom MCP server for human-in-the-loop control
A single harness_ask tool implemented in raw JSON-RPC on stdio, with zero third-party dependencies. When an agent needs approval it writes a request file, the server polls at 250ms, and the agent blocks until a human answers — supervised autonomy inside a GUI, with a deny-by-default 10-minute timeout.
Tool-use safety & governance
A single Python gate re-verifies both duplicate checks and the QC verdict before any publish call. Nothing ungoverned can reach production — one non-bypassable chokepoint, not a convention agents can skip.
Retrieval + anti-duplication
Four independent signals against repeating content: SHA-256 exact hashing, perceptual hashing (pHash) across keyframes, a rolling 14-day source-reuse window, and optional semantic similarity via embeddings — cosine similarity computed in-process, no pgvector or DB extension required.
Video generation and scheduled publishing
Generates video content with OpenMontage and produces static assets, then publishes both to a Facebook Page on a scheduled time through the Facebook Graph API. Every asset is logged to the registry before it goes live.
Closed feedback loop
Past posts and their measured performance are embedded and surfaced as "similar past posts" context inside the generation loop, so agents optimise toward what actually worked rather than starting from zero.
Architecture
One governed pipeline, one non-bypassable gate.
- Research
- Create
- Deduplicate
- QC
- Gated publish
Every run passes through the same governed sequence. The publish step re-checks dedup and QC, so it cannot be reached by anything that skipped them.
Electron main → sessions (node-pty) · runner (headless autopilot) · schedulers · ipc
→ mcp/harness-mcp.js (JSON-RPC human-in-the-loop approvals)
→ registry · performance · fb · embed · fingerprint · scrapers
Renderer → xterm terminal · output gallery · Registry / Feedback / Performance dashboards
Python pipeline → ytclip · memepipeline · caption · fbpost · fingerprint · registry · publish_gate
Data → PostgreSQL (content_registry, content_feedback, registry_checks,
post_performance, page_performance)
SQLite (local) · AES-256-GCM encrypted secrets
Agents → Claude Code · Codex · OpenCode
Integrations → Facebook Graph API · yt-dlp/YouTube · ffmpeg/Pillow
OpenMontage (video) · OpenAI / Gemini / Cohere embeddingsHard problems solved
What made it interesting.
Duplicate prevention across modalities
Combined cryptographic, perceptual, temporal, and semantic signals instead of trusting any single one — so a re-encoded video or a lightly reworded caption still gets caught.
RAG without infrastructure lock-in
Embeddings stored as plain REAL[], cosine similarity computed in-process, and the embedding provider (OpenAI / Gemini / Cohere) swappable at runtime — no pgvector, no vendor lock.
Supervised autonomy
A dependency-free MCP bridge that lets agents pause mid-run for a human decision, then resume — approval mediated without any third-party framework.
Secret safety
Platform tokens encrypted at rest, injected only into each agent's environment scope, and never logged.
Impact
Measured where it's measured.
- ▹Cut a manual [~X hr/day] content workflow to [~Y min] oversight per channel.
- ▹Blocked [N] duplicate / near-duplicate posts in [timeframe].
- ▹Maintained a [Z]% QC pass rate across [N] published assets.
- ▹Ran [N] scheduled autonomous generations at a [failure rate] error rate.
Bracketed placeholders are filled in from live telemetry.
Stack
Built with.
- AI Agents
- LLM Orchestration
- Model Context Protocol (MCP)
- JSON-RPC
- RAG
- Embeddings
- Cosine Similarity
- Perceptual Hashing
- Electron
- Node.js
- node-pty
- xterm.js
- Python
- PostgreSQL
- SQLite
- OpenMontage
- ffmpeg
- Facebook Graph API
- AES-256-GCM
Next
Want the full walkthrough?
I can walk through the orchestration layer, the MCP approval bridge, or the anti-duplication design in detail. The fastest way to reach me is email.