I built a team of AI agents that runs on my 2018 laptop, and asks my phone before doing anything risky

My laptop is an i5-8265U with 16 GB of RAM, a GPU that's slower than its own CPU, and 10 GB free on C:. I wanted a personal AI system on it anyway: something that could research, write, read my email, use the browser, and run on a schedule. I also wanted it to never send, write, or click anything without asking me first.
So I built Control: a self-hosted team of AI agents with a dashboard, an approval queue, and phone notifications. It stays within about 4 GB of RAM.
Repo: https://github.com/Ali-Atif07/control
What it does
- A team of agents: Planner, Researcher, Coder, Writer, an Assistant, and an Operator that drives a real browser and Windows apps.
- Real tools: web search, page reading, files, Python, Gmail (search, draft, send), Google Sheets.
- Hybrid models: a local 3B model through Ollama for cheap work, Claude Code (my existing subscription) for hard work, or any API. You choose per agent.
- Human in the loop: risky actions wait in an approval queue. Agents can ask me a question mid-task and carry on with my answer. Sending email always asks.
- Phone: scan a QR code to open the dashboard, add it to the home screen, and get a push notification when an agent needs me.
- Schedules: "weekdays at 9: summarise my inbox and draft replies".
How it works
The core loop is deliberately boring. Every model, whether it's a 3B local model or Claude, gets the same instruction:
To use a tool, reply with ONLY: {"tool": "<name>", "args": {...}} When done, reply with ONLY: {"final": "<answer>"} The orchestrator parses the reply. If it's a tool call, it checks whether the tool is risky. If it is, it waits for my approval in the database, runs the tool, and feeds the result back to the model. The loop repeats until the model returns final.
I didn't use any vendor's native function calling, because a local model and a CLI agent don't have it. A plain-text protocol works across all of them. The cost is that small models sometimes wrap the JSON in prose, so the parser looks for the first valid JSON object anywhere in the reply.
Agents are rows in a database, not classes. "Researcher" is a system prompt plus a model plus a list of allowed tools. That's why the dashboard can add, edit or delete agents while everything is running.
Five things that surprised me
1. The agent I wrapped was quietly bypassing my safety layer.
I use Claude Code as a "brain" by running claude -p and piping the prompt in. In the first test it answered a web question correctly… using its own built-in web search, not mine. When I asked it to write a file, it tried its own file tool. None of that went through my approval queue or my logs.
The fix was one flag, --tools "", which turns off its built-in tools so it has to use mine. The lesson: when you wrap an agent (not just a model), check what it can do on its own.
2. The GPU was 4× slower than the CPU.
Ollama detected my MX130 and loaded the model onto it. It generated 2.1 tokens/s. CPU-only: 7.8 tokens/s. The GPU did save about 1.4 GB of RAM, so it became an optional "low-RAM mode" instead of the default. Measure before optimising.
3. Prompts can contradict tools.
I added an email_send tool, and the agent kept making drafts instead. Its older system prompt still said "you may create drafts, but never claim an email was sent." When you add a capability, re-read the instructions too.
4. An agent needs a way to ask.
My first real request was to send a client an email saying their website was done. It got stuck. The agent needed the website name and my name, but its only option was to end the task with a question I had nowhere to answer. Adding an ask_user tool fixed it: the question appears in the dashboard and on my phone, I type the answer, and the same task continues.
Making it safe enough to use
- Some tools are risky by default (writing files, running code, clicking in the browser). Some always ask, even in auto-approve mode: sending email can't be undone.
-
email_sendrefuses text that still contains[Your Name]-style placeholders, and catches typo'd domains likegmai.com. That one came from a real typo of mine. - File tools are confined to a workspace folder, so a model asking for
../.envgets an error. - The browser Operator stops before any final Submit/Send/Pay unless told otherwise, and it doesn't try to hide that it's automated.
Running on a small machine
- Only one local model in RAM at a time; it unloads after 2 idle minutes.
- A 4k context, with older tool results shortened as tasks grow.
- No Docker (it would use 1–2 GB by itself). The dashboard is plain HTML plus Alpine.js, with no build step.
- Everything installs inside the project folder.
Tests without models
The test suite uses a scripted fake model: a provider that returns canned replies. It drives the real tool loop, approvals, questions and the email gate with no network and no API keys, so CI runs on GitHub's free Ubuntu and Windows runners.
script(['{"tool": "email_send", "args": {...}}', '{"final": "sent"}']) run_task(client, "email a@example.com", auto_approve=True) assert seen_approvals == ["email_send"] # still asked, despite auto-approve What's next
- Calendar integration and a daily "what's left" summary
- Vision for pages without text labels
- Better long-term memory between tasks
The repo has a build log with one guide per phase, explaining why each piece is built the way it is and which bugs testing caught. If you're learning to build agents, that's probably the most useful part.
Repo: https://github.com/Ali-Atif07/control. Feedback, issues and stars are very welcome. What would you want an agent like this to do on your machine?