The Anti-Serverless AI Dashboard: Inside aims-v2
How a Next.js application rejected the cloud to enable real-time, optimistic co-editing between humans and autonomous agents.
- aims-v2 solves the human-AI co-editing collision by using content-hash-based optimistic locking to prevent simultaneous overwrites.
- The architecture explicitly rejects serverless environments like Vercel in favor of a persistent Node.js server to maintain continuous filesystem watchers.
- By storing agent memory entirely in Markdown and YAML, the system ensures complete portability of the AI's identity across environments.
The Co-Editing Collision
When an OpenClaw AI agent is thinking, it writes its internal state and memory directly to a local file. When a human owner wants to intervene or correct the agent, they use the aims-v2 dashboard to edit that exact same file. If both hit save at once, data is corrupted.
This introduces a radical shift in how we view AI. The agent is not a stateless chat window waiting for a prompt. It is a live, autonomous process that the human is auditing in real time. Building a user interface for this requires solving edge cases that standard AI wrappers simply ignore.
Cryptographic Optimism
To solve the concurrency problem, the system uses Content-Hash-based Optimistic Locking. When the client loads a file, it receives a SHA-256 hash representing the current state of that document.
If the AI changes the file in the background, the server's hash immediately changes. When the human tries to save, the hashes mismatch. This triggers a 409 Conflict and forces a manual diff-merge in the UI, ensuring neither side loses their train of thought.
The Anti-Serverless Mandate
The project's internal planning documents explicitly state that the application must not be deployed to Vercel. To make the UI update instantly when the AI thinks, the system requires a singleton EventEmitter and a persistent chokidar filesystem watcher pushing Server-Sent Events.
Serverless functions spin down and lose memory state, making this architecture impossible. aims-v2 forces Next.js back into acting like a traditional, stateful Node.js server.
| Feature | Standard AI Wrappers | aims-v2 Architecture |
|---|---|---|
| Hosting | Ephemeral Serverless | Persistent VPS / Local Node.js |
| State | Cloud Database | Local Filesystem (Markdown + SQLite) |
| Updates | Polling (REST) | Push (Chokidar + Server-Sent Events) |
| Concurrency | Last-write-wins | SHA-256 Optimistic Locking |
Markdown as a Portable Soul
Instead of a complex Postgres database, the agent's identity, prompts, and current context are stored entirely as plain text Markdown files with YAML frontmatter. This means the AI is perfectly portable.
The dashboard is simply a beautiful UI sitting on top of a directory of text files. It is an exercise in treating the local filesystem as the ultimate source of truth for machine intelligence.