If you're building an AI agent, you've probably hit this wall:
User A needs their own files. User B needs their own database. User C needs their own compute. And none of them should see each other's data.
So you start building. S3 for storage. A database per user. Docker containers. Isolation logic. Scaling. Pause/resume when users go idle.
Suddenly it's three months later and you haven't written any agent logic.
I hit this exact wall building my AI coding agent (100k users). Built the infra. Took months. Then I realized every AI agent startup builds the same thing.
So I turned it into a product: https://oncell.ai
What you get
One API call. Each user gets their own isolated environment with:
- File storage — read, write, list, delete. Persistent across sessions.
- Database — key-value store. Instant.
- Search — text search across all files in the environment.
- Shell — run any command.
- Live URL — {id}.cells.oncell.ai serves files from the environment.
- Observability — workflow journal, logs, metrics. Built in.
Install
npm install @oncell/sdk
*Step 1: Create an environment with your agent code
*
import { OnCell } from "@oncell/sdk";
const oncell = new OnCell({ apiKey: process.env.ONCELL_API_KEY });
const cell = await oncell.cells.create({
customerId: "user-123",
tier: "starter",
agent: `
module.exports = {
async generate(ctx, params) {
// This runs INSIDE the user's environment
// Search existing files for context (local — 0ms)
const context = ctx.search.query(params.instruction);
// Call your LLM (only network call)
const res = await fetch("https://openrouter.ai/api/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "google/gemini-2.5-flash",
messages: [{ role: "user", content: params.instruction }],
}),
});
const data = await res.json();
const code = data.choices[0].message.content;
// Write to storage (local — 0ms)
ctx.store.write("index.html", code);
// Save to database (local — 0ms)
const history = ctx.db.get("history") || [];
history.push({ instruction: params.instruction, ts: Date.now() });
ctx.db.set("history", history);
// Log the action
ctx.journal.step("generate", "Wrote index.html");
return { code, files: ctx.store.list() };
}
};
`,
secrets: {
API_KEY: process.env.OPENROUTER_KEY,
},
});
console.log(cell.previewUrl);
// https://dev-abc--user-123.cells.oncell.ai
That's it. The environment is live. The agent code is loaded. Secrets are injected as process.env — never written to disk, never visible in file listings.
*Step 2: Send requests to the agent
*
const result = await oncell.cells.agentRequest("user-123", "generate", {
instruction: "Build a pricing page with 3 tiers"
});
console.log(result.code); // full HTML
console.log(result.files); // ["index.html"]
The agent ran inside the user's environment. It searched existing files, called the LLM, wrote the result to storage, saved conversation history to the
database. All locally — no network round-trips for file or database operations.
Step 3: View the result
Open cell.previewUrl in a browser. The environment serves index.html automatically.
Every user gets their own URL. User A's files never touch User B's environment.
Step 4: Follow-up requests
const result2 = await oncell.cells.agentRequest("user-123", "generate", {
instruction: "Make it dark mode with purple accents"
});
The agent reads the existing code from storage, gets conversation history from the database, and applies the edit. State persists across requests.
What the agent has access to
Your agent code receives a ctx object:
ctx.store.write(path, content) // file storage
ctx.store.read(path) // read file
ctx.store.list() // list all files
ctx.db.get(key) // read from database
ctx.db.set(key, value) // write to database
ctx.search.query(text) // search files
ctx.shell(cmd) // run shell command
ctx.journal.step(type, msg) // log workflow step
ctx.stream(data) // SSE streaming to client
All local to the environment. Zero latency for storage, database, and search operations.
What about idle users?
Environments pause automatically after 15 minutes of inactivity:
- Active: your tier rate ($0.10 - $0.50/hr)
- Paused: $0.003/hr (just storage)
- Resume: 200ms (data cached on NVMe)
You don't manage this. It just happens.
What about security?
- Each environment runs in its own process with resource limits
- Secrets injected as environment variables, never on disk
- File listings never expose agent code
- Users can't see each other's environments
What you stop building
I replaced this:
├── Dockerfile
├── docker-compose.yml
├── terraform/
│ ├── ecs.tf
│ ├── efs.tf
│ ├── dynamodb.tf
│ ├── s3.tf
│ ├── iam.tf
│ ├── security-groups.tf
│ └── ...
├── src/
│ ├── isolation/
│ ├── storage/
│ ├── database/
│ ├── scaling/
│ └── pause-resume/
└── 3 months of your life
With this:
npm install @oncell/sdk
Try it
- Sign up at https://oncell.ai
- Create an API key
- Add credits ($5 minimum)
- npm install @oncell/sdk
- Create your first environment
Docs: https://oncell.ai/docs
GitHub: https://github.com/oncellai
SDK: https://www.npmjs.com/package/@oncell/sdk
Launching on https://www.producthunt.com/products/oncell-ai?launch=oncell-ai. Would love your feedback.
Top comments (0)