Technical stack, infrastructure layers, backend domain structure, API surface, and database schema for the Hermes Max platform.
Click any layer to expand/collapse its components. All layers are deployed per-user on isolated JustAVPS VMs. Shared infrastructure (auth, billing, routing) runs on the main Helium platform.
hermes/provisioning
VM lifecycle: create, resize, snapshot, terminate, health-check via JustAVPS API
hermes/messaging
Platform bot management, message routing, streaming bridge, webhook handlers
hermes/integrations
Composio OAuth flows, MCP tool registration, token refresh, connection status
hermes/billing
Stripe subscription management, usage metering, invoice line items, webhook processing
hermes/monitoring
Fleet health aggregation, alerting rules, auto-restart triggers, incident logging
hermes/updates
Ansible playbook execution, canary rollout management, rollback triggers
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/api/hermes/instance |
GET |
Bearer | Get current user's VM status, uptime, resource usage |
/api/hermes/subscribe |
POST |
Bearer | Create subscription + provision VM. Body: {plan: "light"|"heavy"} |
/api/hermes/chat |
POST |
Bearer | Send message to agent. Returns SSE stream of response chunks |
/api/hermes/connections |
GET |
Bearer | List all service connections and their OAuth status |
/api/hermes/connections/:service |
POST |
Bearer | Initiate OAuth flow for a service. Returns auth_url |
/api/hermes/connections/:service |
DELETE |
Bearer | Revoke OAuth token and disconnect service |
/api/hermes/cron |
GET/POST/DELETE |
Bearer | CRUD for scheduled jobs. POST body: {cron, prompt, enabled} |
/api/hermes/settings |
GET/PATCH |
Bearer | Agent settings: model, personality, tool toggles, memory config |
/api/hermes/usage |
GET |
Bearer | Token usage, tool calls, uptime for current billing period |
/webhooks/stripe/hermes |
POST |
Stripe-Sig | Stripe webhook: payment events → VM lifecycle actions |
/webhooks/telegram |
POST |
Bot-Token | Telegram update webhook → message router |
/webhooks/discord |
POST |
Discord-Sig | Discord interaction webhook → message router |
Two databases: (1) Central PostgreSQL on Helium platform — fleet management, billing, user-to-VM mapping. (2) Per-user SQLite on VM EBS volume — conversations, memory, skills, cron jobs.
| Column | Type | Notes |
|---|---|---|
| id | UUID | Primary key |
| user_id | UUID | FK → helium.users.id |
| plan | ENUM | 'light' | 'heavy' |
| vm_id | VARCHAR | JustAVPS VM identifier |
| vm_ip | INET | Internal IP (not exposed) |
| proxy_token | VARCHAR | Short-lived access token (6h TTL) |
| status | ENUM | 'provisioning' | 'running' | 'suspended' | 'terminated' |
| stripe_subscription_id | VARCHAR | Stripe subscription reference |
| created_at | TIMESTAMPTZ | Provisioning timestamp |
| last_heartbeat | TIMESTAMPTZ | Updated every 30s by health monitor |
| Column | Type | Notes |
|---|---|---|
| id | UUID | Primary key |
| instance_id | UUID | FK → hermes_instances.id |
| service | VARCHAR | 'google' | 'notion' | 'github' | etc. |
| access_token | TEXT | Encrypted at rest (AES-256) |
| refresh_token | TEXT | Encrypted at rest |
| scopes | TEXT[] | Granted OAuth scopes |
| expires_at | TIMESTAMPTZ | Token expiry for auto-refresh |
| connected_at | TIMESTAMPTZ | Initial connection timestamp |
| Column | Type | Notes |
|---|---|---|
| id | INTEGER | Auto-increment PK |
| platform | TEXT | 'web' | 'telegram' | 'discord' | 'slack' | 'whatsapp' |
| role | TEXT | 'user' | 'assistant' | 'tool' |
| content | TEXT | Message content (FTS5 indexed) |
| tool_calls | JSON | Tool invocations and results |
| tokens_used | INTEGER | Token count for billing |
| created_at | INTEGER | Unix timestamp |
| Column | Type | Notes |
|---|---|---|
| id | INTEGER | Auto-increment PK |
| name | TEXT | Skill identifier (FTS5 indexed) |
| description | TEXT | What this skill does |
| steps | JSON | Ordered list of tool calls and prompts |
| trigger_patterns | TEXT | Regex/keyword patterns that activate this skill |
| use_count | INTEGER | Times successfully executed |
| created_at | INTEGER | Unix timestamp |