Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

94 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PostPrism logo

PostPrism

A hackathon prototype for adapting one piece of content and orchestrating isolated computer-use agents for LinkedIn, X, and Instagram in parallel.

Build Agent S2.5 ORGO UI-TARS 1.5 Live demo License: MIT

Quick start Β· Hosted demo Β· Architecture Β· Setup Β· Technical deep dive

PostPrism is a full-stack experiment built for the ORGO AI hackathon. The credentialed backend creates a separate computer-use agent and ORGO VM per platform, adapts content per platform, executes the agents concurrently, and emits screenshots and progress events to one dashboard. The hosted Lovable build is a front-end-only simulation and does not sign in to or publish on social platforms. Front end: React + TypeScript (Vite). Back end: Flask + Agent S2.5 with UI-TARS 1.5 visual grounding.

Quick start

The front end builds and runs on Bun; this demo mode needs no API keys.

git clone https://github.com/zelinewang/postprism.git
cd postprism
bun install
bun run build    # verified: 1769 modules transformed, built in ~2s
bun run dev      # front end at http://localhost:8080

For the credentialed experimental backend (ORGO + OpenAI keys), see Setup.


Hosted front-end demo

Launch PostPrism Watch demo video

The hosted Lovable deployment is deliberately front-end only. It uses src/services/demoService.ts to simulate parallel progress and results without backend calls, account access, provider credentials, or publishing.

What you'll see:

  • A simulated three-platform progress dashboard
  • Local platform-specific content adaptation
  • Simulated agent actions and completion states
  • The interface and information flow used by the credentialed backend path

Demo workflow: type one piece of content β†’ the browser adapts it per platform β†’ simulated agents progress in parallel. The demo does not create social posts. The video records the hackathon workflow, not a current end-to-end publishing guarantee.


About this project

Built solo for the ORGO AI hackathon. Implemented surfaces:

  • Front end: React + TypeScript (Vite)
  • Experimental back end: Flask + Python orchestration
  • Agent S2.5 integration with custom optimizations
  • ORGO VM management and parallel execution
  • Real-time screen streaming over WebSocket
  • Progress monitoring

The hardest part: Agent S2.5 released on August 1st and I migrated from S2 to S2.5 under 24 hours before the deadline, which meant standing up a separate UI-TARS grounding endpoint on short notice.


What is implemented

  • Backend frame and progress events. During the credentialed backend path, each agent step emits its ORGO screenshot and action state over Flask-SocketIO. The hosted demo simulates these events locally.
  • One isolated agent per platform. The backend initializes separate ORGO computers, grounding agents, and Agent S2.5 instances so the runs do not share browser state.
  • Parallel task execution. The backend creates one coroutine per platform and awaits them together with asyncio.gather.
  • Agent S2.5 + UI-TARS grounding. Uses Agent S2.5 for computer use with ui-tars-1.5-7b visual grounding and a configurable OpenAI decision model (gpt-4o-mini by default).
  • Loop breakers and rate-limit backoff. OptimizedAgentManager detects repeated actions and rewrite attempts, caps steps, and increases per-platform delay after rate-limit errors.

Success semantics

The backend is an experimental hackathon path, not a verified publishing service. Its current controller can return success=True when it detects a repeated action or a rewrite attempt, without reading the platform afterward to confirm that a post exists. It also generates a placeholder post_url rather than extracting a canonical URL from the platform. Treat a success result as "the controller terminated its run," not as proof of publication; verify the target account manually.


Architecture

postprism/
β”œβ”€β”€ πŸ“„ README.md                          # This README
β”œβ”€β”€ πŸ“„ env.example.txt                    # Environment setup template
β”‚
β”œβ”€β”€ 🎨 src/                               # Frontend (React + TypeScript)
β”‚   β”œβ”€β”€ πŸ“„ App.tsx                        # Main application entry
β”‚   β”‚                                     # Location: ./src/App.tsx
β”‚   β”œβ”€β”€ πŸ“„ pages/Index.tsx                # Primary publishing interface
β”‚   β”‚                                     # Location: ./src/pages/Index.tsx
β”‚   β”œβ”€β”€ πŸ“„ components/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ ContentInput.tsx           # Content input with AI preprocessing
β”‚   β”‚   β”œβ”€β”€ πŸ“„ LiveStreamViewer.tsx       # Real-time AI observation dashboard
β”‚   β”‚   β”œβ”€β”€ πŸ“„ PublishResults.tsx         # Results analytics & tracking
β”‚   β”‚   └── πŸ“„ PlatformCard.tsx           # Platform status display
β”‚   └── πŸ“„ config/api.ts                  # API configuration & demo mode
β”‚
β”œβ”€β”€ πŸ€– backend/                           # Backend (Flask + Agent S2.5)
β”‚   β”œβ”€β”€ πŸ“„ run_fixed.py                   # Backend entry point
β”‚   β”‚                                     # Location: ./backend/run_fixed.py
β”‚   β”œβ”€β”€ πŸ“„ app_fixed.py                   # Main Flask application
β”‚   β”‚                                     # Location: ./backend/app_fixed.py
β”‚   β”œβ”€β”€ πŸ“„ requirements.txt               # Dependencies
β”‚   β”œβ”€β”€ πŸ“„ install_dependencies.sh        # Automated setup
β”‚   β”‚
β”‚   β”œβ”€β”€ 🧠 agent_s2_controller/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ optimized_agent_manager.py # Custom Agent S2.5 enhancements
β”‚   β”‚   β”‚                                 # Anti-perfectionism, loop detection
β”‚   β”‚   └── πŸ“„ official_agent_manager.py  # Standard wrapper
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸŽ₯ streaming/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ video_streamer.py          # Real-time video streaming
β”‚   β”‚   └── πŸ“„ progress_tracker.py        # Progress monitoring
β”‚   β”‚
β”‚   └── πŸ”„ content_adapters/
β”‚       └── πŸ“„ multi_platform_adapter.py  # AI content optimization
β”‚
└── πŸ“š docs/archive/                      # Development documentation

Setup

Note: the credentialed backend is designed around three accounts (LinkedIn, X, Instagram); the hosted demo does not access any account. The architecture can be extended to more platforms/accounts.

Prerequisites

1. ORGO AI account & VM setup

This enables the parallel architecture.

# Step 1: Get ORGO API Access
# Sign up at: https://docs.orgo.ai/introduction

# Step 2: Create 3 Dedicated VMs (one for each platform)
LinkedIn VM    β†’ Project ID: "proj_linkedin_abc123" (save this!)
Twitter VM     β†’ Project ID: "proj_twitter_def456" (save this!)
Instagram VM   β†’ Project ID: "proj_instagram_ghi789" (save this!)

# Step 3: Persistent login setup
# For each VM:
1. Connect to VM via ORGO interface
2. Open browser β†’ Navigate to platform β†’ Login
3. Keep browser open, stay logged in
4. Test: Refresh page β†’ Should remain logged in

# Why this works:
# - ORGO VMs maintain state when paused
# - No re-authentication needed = faster publishing
# - Each VM has a unique IP

2. Agent S2.5 configuration

# Required: OpenAI API Key
OPENAI_API_KEY=sk-your_openai_key_here
AGENTS2_5_MODEL=o3-2025-04-16              # Recommended by Agent S2.5 team
# but we use gpt-4o-mini for speed

# Required: UI-TARS 1.5 Grounding Model
AGENTS2_5_GROUNDING_URL=https://your-endpoint.endpoints.huggingface.cloud
AGENTS2_5_GROUNDING_API_KEY=hf_your_token_here

3. Environment configuration

Create .env file:

# ORGO AI Configuration
ORGO_API_KEY=your_orgo_api_key_here

# Platform-Specific VM IDs
ORGO_LINKEDIN_PROJECT_ID=proj_linkedin_abc123
ORGO_TWITTER_PROJECT_ID=proj_twitter_def456
ORGO_INSTAGRAM_PROJECT_ID=proj_instagram_ghi789

# AI Model Configuration
OPENAI_API_KEY=sk-your_openai_key_here
AGENTS2_5_MODEL=o3-2025-04-16
# but we use gpt-4o-mini for speed

# UI-TARS 1.5 Configuration
AGENTS2_5_GROUNDING_URL=your_grounding_endpoint
AGENTS2_5_GROUNDING_API_KEY=your_grounding_key
AGENTS2_5_GROUNDING_MODEL=ui-tars-1.5-7b

# Feature toggles
ENABLE_ANTI_PERFECTIONISM=true
ENABLE_LOOP_DETECTION=true
ENABLE_LIVE_STREAMING=true

Installation & launch

# Clone & setup
git clone https://github.com/zelinewang/postprism.git
cd postprism

# Run automated backend dependencies installation
cd backend && chmod +x install_dependencies.sh && ./install_dependencies.sh

# The setup script creates/updates .env in the project root; edit it with your keys and VM IDs

# Launch
cd ..                                     # Return to project root
bun run dev &                             # Frontend on :8080 (npm run dev also works)
python backend/run_fixed.py               # Backend on :8000

# Open http://localhost:8080 and watch the agents run

Technical deep dive

The architecture below maps directly to tracked implementation; there is no pseudocode API in this section.

Parallel orchestration

PostPrismApp._execute_official_publishing builds one _publish_single_platform_parallel coroutine per requested platform and passes the complete list to asyncio.gather(..., return_exceptions=True). It then normalizes each OptimizedPublishResult and emits per-platform and aggregate Socket.IO events.

Agent execution loop

OptimizedAgentManager._run_optimized_agent_loop repeats four concrete operations: capture an ORGO screenshot, call AgentS2_5.predict, emit the frame/action state, and execute the returned action through Computer.exec. The same method contains the repeated-action and rewrite loop breakers described in Success semantics.

Stream lifecycle

VideoStreamer owns session lifecycle, frame buffers, frame-rate limits, and Socket.IO broadcast state. Agent frames are emitted by OptimizedAgentManager as video_frame events with the session, platform, step, and base64 screenshot payload.


Configuration reference

Use the configuration below (from env.example.txt); the implementation uses AGENTS2_5_* variable names.

# ===== CORE REQUIREMENTS =====
OPENAI_API_KEY=sk-your-openai-api-key-here     # From: https://platform.openai.com/api-keys
ORGO_API_KEY=your-orgo-api-key-here            # From: https://console.orgo.ai/

# ===== PLATFORM VM IDs (Optional but recommended) =====
ORGO_LINKEDIN_PROJECT_ID=your-linkedin-vm-id   # Create at: https://console.orgo.ai/projects
ORGO_TWITTER_PROJECT_ID=your-twitter-vm-id      # Enables persistent login states
ORGO_INSTAGRAM_PROJECT_ID=your-instagram-vm-id  # Faster publishing performance

# ===== AGENT S2.5 CONFIGURATION =====
AGENTS2_5_MODEL=gpt-4o-mini                    # Default: fast & cost-effective
AGENTS2_5_MODEL_TYPE=openai                    # Provider: openai/anthropic
AGENTS2_5_GROUNDING_MODEL=ui-tars-1.5-7b       # Visual UI detection model
AGENTS2_5_GROUNDING_TYPE=huggingface           # Grounding service provider
AGENTS2_5_MAX_STEPS=15                         # Maximum automation steps
AGENTS2_5_STEP_DELAY=1.0                       # Delay between actions (seconds)
AGENTS2_5_MAX_TRAJECTORY_LENGTH=8              # Memory efficiency
AGENTS2_5_ENABLE_REFLECTION=true               # Learning capability

Model selection guide

Model Relative trade-off Intended use
gpt-4o-mini Faster / lower-cost Default development path
gpt-4o More capable / higher-cost Accuracy-sensitive experiments
o3-2025-04-16 Slower reasoning path Explicit opt-in experiments

Automated installation

install_dependencies.sh handles:

  1. Python virtual environment β€” isolated dependency management
  2. Standard dependencies β€” Flask 3.0+, SocketIO 5.3+, OpenAI 1.25+, etc. (requirements.txt)
  3. GUI Agents S2.5 β€” v0.2.5 (Aug 2025) from the official repository
  4. ORGO AI client β€” virtual desktop orchestration (pip install orgo)
  5. Production extras β€” Gunicorn, Eventlet
  6. Environment setup β€” interactive wizard via setup_env.py

Run: chmod +x install_dependencies.sh && ./install_dependencies.sh

Ports

  • Frontend: http://localhost:8080 (Vite dev server)
  • Backend: http://localhost:8000 (Flask)
  • Health check: http://localhost:8000/health

Deployment options (see DEPLOYMENT_STRATEGY.md)

Demo mode (no backend):

bun install && bun run dev
echo "VITE_DEMO_MODE=true" > .env.local

Credentialed local backend path (experimental):

cd backend && chmod +x install_dependencies.sh && ./install_dependencies.sh
cd .. && bun install
cp env.example.txt .env  # edit with your keys
bun run dev & python backend/run_fixed.py

Cloud: the hosted Lovable front end is forced into front-end-only demo mode. The repository contains Render/Railway configuration for a separate backend, but that credentialed path is not part of the public demo and is not claimed as production-ready.

Troubleshooting (see SETUP_GUIDE.md)

# Backend connection failed
curl http://localhost:8000/health

# OpenAI rate limits β€” use a cheaper model
AGENTS2_5_MODEL=gpt-4o-mini

# ORGO VM access issues
curl -H "Authorization: Bearer $ORGO_API_KEY" https://api.orgo.ai/health

# Installation verification
python backend/run_fixed.py --test

Status

Hackathon project (ORGO AI hackathon, 2025); not actively maintained. This README was trimmed from its original hackathon pitch to focus on what you can run today. The hosted front end is reproducible as a simulation. The credentialed backend is source-documented but was not end-to-end revalidated for this README and does not verify publication state.

License

MIT.

Acknowledgments

About

Hackathon prototype for parallel computer-use agents; the hosted front end is a simulation.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages