AI Coding Platform
An AI-powered coding platform inspired by Lovable, with isolated Kubernetes workspaces, an agent loop driven by LLM tool calling, real-time streaming, live previews, and sub-agent orchestration for focused work.
Key engineering decisions
Isolated Kubernetes workspace per conversation
Each conversation gets its own Kubernetes pod with a shared PVC, keeping generated project state isolated while allowing the pod to be recreated independently of its lifecycle.
Asynchronous agent execution
User messages are persisted first and agent work is queued through Redis, so a long-running coding task isn't tied to the HTTP request or browser connection.
Separate agent and app-runner processes
The agent is responsible for reasoning and editing files; a dedicated app-runner container owns dependency installation and the development server. Both operate on the same shared workspace.
Persistent state outside the workspace
Conversation history lives in Postgres and chat history is backed up to S3-compatible storage, allowing the system to recreate a failed pod without losing the conversation.
Sub-agents work in isolated Git worktrees
Sub-agents can work in parallel without modifying the primary workspace directly. Their changes are returned as diff artifacts that the main agent can selectively apply.
Technical deep dive4 sections
Architecture
A user message is persisted by the backend and pushed onto a Redis queue. An agent worker picks up the job, loads the conversation from Postgres, and executes the agent loop inside the conversation's Kubernetes workspace.
The workspace contains separate agent and app-runner containers sharing a PVC. The agent edits the project while the app-runner owns the development server and exposes the generated application through Kubernetes Service and Ingress. Progress flows through Redis Pub/Sub → backend → WebSocket → browser.
Reliability & Recovery
The system persists the conversation before agent execution begins, so a failed agent run doesn't lose the user's request.
Conversation state is stored in Postgres rather than process memory, while chat history is also backed up to S3-compatible storage. If a workspace pod fails, it can be recreated and the conversation restored from persistent state rather than relying on the previous pod surviving.
Performance & Scalability
Long-running agent work is asynchronous, allowing the API and WebSocket layers to remain independent of the execution time of a coding task.
The app-runner is separated from the agent so generated applications can restart independently when files change. Sub-agents can also work on isolated Git worktrees, allowing focused tasks to execute without competing over the primary workspace.
Trade-offs
A dedicated Kubernetes workspace per conversation provides strong isolation but introduces significant resource overhead.
The shared PVC simplifies communication between the agent and app-runner, but also means workspace lifecycle and storage have to be managed separately from pod lifecycle.
The architecture also deliberately keeps some production concerns open: authorization, secrets management, autoscaling, resource limits, retry/dead-letter handling, and multi-replica WebSocket scaling remain production-readiness work.