A web-based chat platform where users communicate with an AI browser agent powered by Magnitude. Users see a chat interface alongside a live stream of the browser as the agent performs tasks.
┌─────────────────────────────────────────────────────────────┐
│ Frontend (React) │
│ ┌──────────────────────┐ ┌─────────────────────────────┐ │
│ │ Chat Panel │ │ Browser View Panel │ │
│ │ - Message input │ │ - Live screenshot stream │ │
│ │ - Chat history │ │ - Agent status indicator │ │
│ │ - Agent thoughts │ │ - Current URL display │ │
│ └──────────────────────┘ └─────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│ WebSocket
▼
┌─────────────────────────────────────────────────────────────┐
│ Backend (Node.js) │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Express API │ │ WS Server │ │ Magnitude Agent │ │
│ │ - Health │ │ - Events │ │ - act() │ │
│ │ - Sessions │ │ - Screenshots│ │ - extract() │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Node.js 18+
- npm 9+
- An Anthropic API key
- Clone the repo:
git clone https://github.com/magnitudedev/magnitude-demo-repo.git
cd magnitude-demo-repo/browser-agent-chat- Create a
.envfile in theserverdirectory:
echo "ANTHROPIC_API_KEY=your-api-key-here" > server/.env- Install dependencies:
npm installnpm run devTerminal 1 - Server (http://localhost:3001):
npm run dev:serverTerminal 2 - Client (http://localhost:5174):
npm run dev:client- Open http://localhost:5174 in your browser
- Enter a URL in the input field (default: https://magnitodo.com)
- Click "Start Agent" to launch the browser agent
- Once the agent is ready, you'll see a screenshot of the page
- Type a task in the chat input (e.g., "Create a todo called 'Test task'")
- Watch the agent work - you'll see its thoughts in the chat and screenshots updating
- Frontend: React 19 + TypeScript + Vite
- Backend: Node.js + Express + ws (WebSocket)
- Browser Automation: magnitude-core
- Database: Supabase
- Fork this repository
- Go to Render Dashboard
- Click New → Blueprint
- Connect your forked repo and select
browser-agent-chat/render.yaml - Add your
ANTHROPIC_API_KEYin the environment variables - Deploy!
Server (Web Service):
- Create a new Web Service on Render
- Connect your repo, set root directory to
browser-agent-chat/server - Choose Docker as runtime
- Set environment variables:
ANTHROPIC_API_KEY: your keyCORS_ORIGIN: your client URL (e.g.,https://your-client.onrender.com)
- Use at least the Starter plan (browser needs memory)
Client (Static Site):
- Create a new Static Site on Render
- Connect your repo, set root directory to
browser-agent-chat/client - Build command:
npm install && npm run build - Publish directory:
dist - Set environment variable:
VITE_WS_URL:wss://your-server.onrender.com
| Variable | Service | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Server | Your Anthropic API key |
CORS_ORIGIN |
Server | Client URL for CORS |
VITE_WS_URL |
Client | WebSocket URL to server (use wss:// for production) |