| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 18, TypeScript, Tailwind CSS, shadcn/ui |
| Backend | Python 3.11+, FastAPI, LangGraph |
| Database | PostgreSQL, Redis |
| Storage | Cloudflare R2 |
| Sandbox | E2B |
- Node.js 20+
- Python 3.11+
- Docker (optional, for PostgreSQL and Redis)
cd HyperAgent
cp backend/.env.example backend/.env
cp web/.env.example web/.env
# Edit backend/.env and add your API keys
# Optional: use YAML for structured config
cp backend/config.yaml.example backend/config.yamldocker-compose up -d postgres redisOr run PostgreSQL and Redis locally.
make installOr install separately:
make install-web # Frontend dependencies
make install-backend # Backend dependenciesmake dev-backendmake dev-webOr start both in separate terminals:
make dev # Shows instructions to run dev-web and dev-backend separatelyVisit http://localhost:5000
HyperAgent/
├── web/ # Next.js frontend
│ ├── app/ # App router pages
│ ├── components/ # React components
│ │ ├── ui/ # shadcn/ui components
│ │ ├── chat/ # Chat components
│ │ ├── research/ # Research components
│ │ └── layout/ # Layout components
│ └── lib/ # Utilities, stores, types
│
├── backend/ # Python backend
│ ├── app/
│ │ ├── routers/ # API endpoints
│ │ ├── agents/ # LangGraph agents
│ │ │ └── tools/ # Tool implementations (incl. codeact.py)
│ │ ├── sandbox/ # Sandbox managers (unified, execution, app, desktop)
│ │ │ └── hyperagent_lib/ # Helper library for CodeAct mode
│ │ ├── services/ # Business logic (incl. snapshot_service.py)
│ │ └── models/ # Pydantic schemas
│ ├── config.yaml.example # YAML config template
│ └── pyproject.toml
│
├── docker-compose.yml # Docker services
└── .env.example # Environment template
| Endpoint | Method | Description |
|---|---|---|
/api/v1/health |
GET | Health check |
/api/v1/query |
POST | Unified non-streaming query endpoint |
/api/v1/query/stream |
POST | Unified streaming query endpoint |
/api/v1/tasks |
GET | List tasks |
/api/v1/tasks/research |
POST | Submit research task |
/api/v1/tasks/{task_id} |
GET | Get task status |
/api/v1/tasks/{task_id}/result |
GET | Get completed task result |
The following endpoints were removed and should not be used:
/api/v1/query/status/{task_id}/api/v1/tasks/{task_id}/stream/api/v1/runs/*/api/v1/usage
HyperAgent uses a hybrid YAML + env var configuration system.
- Constructor kwargs (programmatic overrides)
- Nested env vars (
SANDBOX__E2B__API_KEY) — pydantic-settings__delimiter - Flat env vars /
.envfile (E2B_API_KEY) — backward-compatible legacy names - YAML config (
backend/config.yaml) — structured settings - Defaults (defined in code)
# Required: copy .env for secrets
cp backend/.env.example backend/.env
# Optional: copy YAML for structured config
cp backend/config.yaml.example backend/config.yamlSecrets (API keys, passwords) should stay in .env or real environment variables.
Non-secret structured settings (timeouts, feature flags, model names) can go in config.yaml.
Settings can be accessed via both nested and flat (legacy) paths:
from app.config import settings
# Nested (preferred for new code)
settings.sandbox.e2b.api_key
settings.agents.react.max_iterations
settings.llm.tier_models.max_anthropic
# Flat (backward-compatible, still works everywhere)
settings.e2b_api_key
settings.react_max_iterations
settings.tier_max_anthropicBoth flat and nested env var formats work:
# Flat (legacy) — always works
E2B_API_KEY=sk-xxx
# Nested (new) — uses __ delimiter
SANDBOX__E2B__API_KEY=sk-xxx| File | Purpose |
|---|---|
backend/app/config.py |
Root Settings class |
backend/app/config_models.py |
Nested Pydantic sub-models |
backend/app/config_sources.py |
YAML source, flat alias mapping |
backend/config.yaml.example |
Documented YAML config template |
backend/.env.example |
Env var template (secrets) |
| Variable | Description | Required |
|---|---|---|
ANTHROPIC_API_KEY |
Anthropic API key | Yes* |
OPENAI_API_KEY |
OpenAI API key | Yes* |
GEMINI_API_KEY |
Google Gemini API key | Yes* |
DATABASE_URL |
PostgreSQL connection | No |
REDIS_URL |
Redis connection | No |
E2B_API_KEY |
E2B sandbox API key | No |
NEXTAUTH_SECRET |
NextAuth session secret | Yes (if auth enabled) |
*At least one LLM provider key is required.
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_API_URL |
Backend API URL | No |
All commands use the Makefile. Run make help to see all available commands.
make install # Install all dependencies
make install-web # Install frontend dependencies only
make install-backend # Install backend dependencies onlymake dev-web # Start frontend dev server (port 5000)
make dev-backend # Start backend dev server (port 8080)
make dev-worker # Start background worker
make dev-all # Start all services (frontend, backend, worker)make build # Build frontend for production
make build-web # Build frontend onlymake lint # Run all linters
make lint-web # Lint frontend code
make lint-backend # Lint backend code
make format-backend # Format backend codemake test # Run all tests
make test-backend # Run backend testsmake migrate # Apply all pending migrations
make migrate-down # Rollback last migration
make migrate-new msg='description' # Create new migration
make migrate-status # Show migration statusmake clean # Clean build artifacts and caches
make health # Check health of all servicesmake queue-stats # Show job queue statistics
make queue-monitor # Monitor job queue in real-time
make queue-list # List all queued jobs
make queue-clear # Clear all jobs from queue (DESTRUCTIVE)
make queue-health # Check worker and queue health
make queue-test # Submit a test task to verify worker