mit einem Klick
fullstack-architecture
// Architecture, directory layout, communication protocol, and conventions for the full-stack multi-agent application
// Architecture, directory layout, communication protocol, and conventions for the full-stack multi-agent application
REST and WebSocket endpoint patterns, error handling, and Pydantic schema conventions for the backend
Step-by-step guide to add a new REST or WebSocket endpoint to the backend
Step-by-step guide to add a new agent to the multi-agent team
Step-by-step guide to add a new page or component to the React frontend
How the Code Reviewer agent conducts systematic code reviews with prioritized findings
How the Research Analyst agent conducts research, evaluates sources, and produces structured reports
| name | fullstack-architecture |
| description | Architecture, directory layout, communication protocol, and conventions for the full-stack multi-agent application |
| license | Apache-2.0 |
backend/
├── app/
│ ├── main.py # FastAPI app — REST endpoints + WebSocket handler
│ ├── agents.py # AG2 agent team definition and run_team() entry point
│ └── schemas.py # Pydantic models shared between endpoints and agents
└── tests/
└── test_api.py
frontend/
├── src/
│ ├── main.tsx # React entry point
│ ├── App.tsx # Root component
│ └── components/
│ └── Chat.tsx # WebSocket chat UI
├── index.html
├── vite.config.ts # Vite config with API/WS proxy to backend
└── package.json
The frontend and backend communicate over a single WebSocket at /ws/chat.
Client → Server:
{"message": "user text here"}
Server → Client (one per agent response):
{"agent": "planner", "content": "...", "type": "agent_message"}
Server → Client (when all agents finish):
{"agent": "", "content": "", "type": "done"}
Message types: agent_message, status, error, done.
GET /api/health — returns {"status": "ok", "agents": ["planner", "coder", "reviewer"]}The backend runs a 3-agent team using AG2's RoundRobinPattern:
The run_team(message) function in agents.py is the single entry point. It returns a list of {"agent": name, "content": text} dicts.
schemas.py — import from there, never define inlineagents.py — main.py only imports run_team and AGENT_NAMES/api and /ws to the backend in dev — no hardcoded URLs in componentsmodel_dump_json() for serialization (v2 API)