A full-stack application that combines an intelligent AI agent backend with a real-time visualization frontend. Watch as AI agents spawn, execute tasks, and collaborate to solve complex problems.
- Real-time Agent Visualization: See your AI agents work in a beautiful tree structure
- Multi-Agent System: Agents can spawn sub-agents to explore parallel solutions
- Human-in-the-Loop: Agents can ask for clarification when needed
- Python Tool Integration: Agents can execute Python code with fork/wait capabilities
- WebSocket Communication: Instant updates as agents work
- Streaming Responses: See agent thoughts as they're generated
- WebSocket server on port 3001
- Sophisticated agent system with:
- Clarification checks
- Blocking questions when needed
- Async subquestion generation
- Python execution environment
- Fork/wait for parallel agent execution
- Real-time visualization of agent tree
- Interactive node system
- User input handling
- Connection status monitoring
-
Clone and navigate to the project
cd thread -
Configure backend
cd backend cp .env.example .env # If you have one # Edit .env and add your ANTHROPIC_API_KEY
-
Install dependencies
# Backend cd backend bun install # Frontend cd ../frontend npm install
Linux/Mac:
chmod +x start.sh
./start.shWindows:
start.batTerminal 1 - Backend:
cd backend
bun run devTerminal 2 - Frontend:
cd frontend
npm run dev- Open your browser to the frontend URL (usually
http://localhost:5173) - Check that the connection indicator shows "Connected" (green dot)
- Enter a prompt in the master node textbox
- Watch as agents spawn and work on your request
- If an agent needs input, it will show an orange border with a question
- Type your response and press Enter
- The final answer will be highlighted with a special badge
- π΅ Blue - Running: Agent is actively working
- π’ Green - Completed: Agent finished successfully
- π΄ Red - Error: Something went wrong
- π Orange - Awaiting User: Agent needs your input
- βͺ Gray - Idle: Agent hasn't started yet
- Thick green border + badge - Final answer from master agent
- Orange highlight - Agent is waiting for user response
- Animated edges - Active data flow
AI_MODEL=claude-3-5-haiku-20241022
ANTHROPIC_API_KEY=your_key_here- Backend WebSocket:
3001 - Frontend Dev Server: Default Vite port (usually
5173)
See INTEGRATION.md for detailed WebSocket message specifications.
Frontend β Backend:
start-agent- Begin new agent with promptuser-response- Answer to agent's questionuser-intervention- Modify/delete agent
Backend β Frontend:
agent-state- Agent status updatetext-delta- Streaming text chunkuser-query- Agent asking for inputagent-completed- All work finished
thread/
βββ backend/
β βββ src/
β β βββ index.ts # WebSocket server
β β βββ ai.ts # Agent system
β β βββ agent.ts # Simple agent
β β βββ python.ts # Python execution
β βββ package.json
β βββ tsconfig.json
βββ frontend/
β βββ src/
β β βββ App.tsx # Main app + WebSocket client
β β βββ components/
β β β βββ AgentNode.tsx
β β β βββ MasterNode.tsx
β β β βββ ReactFlowWrapper.tsx
β β βββ types/
β β βββ Node.ts
β βββ package.json
β βββ vite.config.ts
βββ INTEGRATION.md # Technical integration docs
βββ README.md # This file
- Backend: Bun, TypeScript, Anthropic AI SDK, Zod
- Frontend: SolidJS, React Flow, TypeScript
- Communication: WebSocket (native Bun WebSocket)
- Ensure backend is running on port 3001
- Check for firewall/antivirus blocking WebSocket
- Verify
.envhas valid API key
- Open browser DevTools console
- Check for WebSocket messages
- Verify backend logs show agent creation
- Confirm
text-deltamessages includeagentId - Check backend is properly forwarding chunks
- Verify frontend is handling messages
This is a demonstration project showcasing real-time AI agent visualization. Feel free to:
- Report issues
- Suggest features
- Submit pull requests
- Fork and experiment
See LICENSE file for details.
- Built with Anthropic Claude
- Visualization powered by React Flow
- UI framework: SolidJS
- Runtime: Bun
- INTEGRATION.md - Detailed WebSocket protocol
- backend/AGENT_ARCHITECTURE.md - Agent system design
- React Flow Docs - Visualization library
- Anthropic AI SDK - AI integration
Built with β€οΈ for exploring AI agent systems