| Component | Description |
|---|---|
frontend/ |
React UI with Supabase auth, task submission, and task history |
services/gateway/ |
FastAPI gateway, task intake, Supabase sync, health monitoring |
services/agent/ |
Graph-of-Thought reasoning agent with web crawling and RAG |
services/shared/ |
Shared connectors, models, storage helpers, message contracts |
services/metrics/ |
CloudWatch queue-depth publisher for autoscaling |
services/lambda_autoscaling/ |
Lambda-based ECS autoscaler (deployment only) |
The agent uses a Graph-of-Thought (GoT) execution model:
- Tasks decompose into 2–5 parallel subproblems via LLM expansion.
- Each subproblem executes an action:
search,visit,save, orthink. - Results merge upward through the DAG into a final deliverable.
- Dynamic beam width, deduplication, and pruning optimize exploration.
- Bot-protected sites are handled by an
undetected-chromedriverfallback.
Two execution modes: graph (parallel, 90.6% pass rate) and sequential (depth-first baseline, 46.9% pass rate).
See Agent Architecture for full details.
- Client submission: Frontend submits task to
gateway /taskswith Supabase JWT - Auth & quota: Gateway validates JWT, checks per-user daily quota in Supabase
- Task queuing: Gateway inserts task in Supabase as
in_queue, publishesTaskEnvelopeto RabbitMQ queueagent.mandates - Task consumption: Agent worker consumes task from RabbitMQ, updates status to
in_progress - Status updates: Agent emits status updates to RabbitMQ
agent.statusqueue and writes to Redis - Status sync: Gateway periodically syncs Redis task statuses into Supabase and clears terminal tasks from Redis
- Frontend polling: Frontend reads tasks from Supabase and system info/worker counts from gateway
/systemendpoint - Metrics: Metrics service publishes QueueDepth to CloudWatch (deployment only)
- Autoscaling: Lambda autoscaler reads QueueDepth and adjusts agent ECS desired count (deployment only)
| Store | Purpose | Data |
|---|---|---|
| RabbitMQ | Task queue and status updates | agent.mandates (task envelopes), agent.status (status updates) |
| Redis | Ephemeral task status and worker state | Task status cache, worker presence (TTL-based), worker state (free/working/waiting), versions |
| ChromaDB | Long-term context storage | Observations, internal thoughts, discovered links (chunked and embedded) |
| Supabase | Persistent task history and auth | Task records, user profiles, daily usage quotas, JWT authentication |
in_queue: Task submitted, waiting for agent workerin_progress: Agent is processing the taskcompleted: Task finished successfullyerror: Task failed with error
free: Worker idle, ready for tasksworking: Worker actively processing a taskwaiting: Worker finished task, waiting for new work (prevents immediate scale-in)
The waiting window keeps workers alive for short bursts before scaling in, improving responsiveness to bursty workloads.
- QueueDepth metric: CloudWatch metric published by metrics service drives desired count
- Scale-in protection: Worker state in Redis blocks scale-in for
workingorwaitingworkers - Capacity rules: Minimum worker count and target-per-worker rules enforce baseline capacity
- Lambda function: Reads QueueDepth from CloudWatch and adjusts ECS service desired count
Local development: No autoscaling; fixed number of agent containers via Docker Compose.
- Connector readiness: Pre-flight checks verify LLM, search, and ChromaDB connectivity before consuming tasks
- Retry logic: Automatic retries for transient failures in HTTP requests and external API calls
- Browser fallback: Automatic fallback to
undetected-chromedriverwhen HTTP requests return 403/401 (bot detection) - Graceful shutdown: Agents and connectors handle SIGTERM gracefully, finishing current tasks before exit
- Error propagation: Task errors are captured, logged, and stored in Supabase with error messages
- Health checks: Gateway and agent expose health endpoints for monitoring and load balancer checks