<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ali Atif</title>
    <description>The latest articles on DEV Community by Ali Atif (@ali-atif).</description>
    <link>https://dev.to/ali-atif</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4153607%2F95ee89ea-9572-4e60-924e-635d5d2ae27a.webp</url>
      <title>DEV Community: Ali Atif</title>
      <link>https://dev.to/ali-atif</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ali-atif"/>
    <language>en</language>
    <item>
      <title>I built a team of AI agents that runs on my 2018 laptop, and asks my phone before doing anything risky</title>
      <dc:creator>Ali Atif</dc:creator>
      <pubDate>Wed, 02 Dec 2026 14:03:11 +0000</pubDate>
      <link>https://dev.to/ali-atif/i-built-a-team-of-ai-agents-that-runs-on-my-2018-laptop-and-asks-my-phone-before-doing-anything-38bg</link>
      <guid>https://dev.to/ali-atif/i-built-a-team-of-ai-agents-that-runs-on-my-2018-laptop-and-asks-my-phone-before-doing-anything-38bg</guid>
      <description>&lt;p&gt;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 &lt;strong&gt;never send, write, or click anything without asking me first&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Control&lt;/strong&gt;: a self-hosted team of AI agents with a dashboard, an approval queue, and phone notifications. It stays within about 4 GB of RAM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/Ali-Atif07/control" rel="noopener noreferrer"&gt;https://github.com/Ali-Atif07/control&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd62v475f7edz1uootgp8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd62v475f7edz1uootgp8.png" alt="Approvals on a phone" width="780" height="1688"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A team of agents&lt;/strong&gt;: Planner, Researcher, Coder, Writer, an Assistant, and an &lt;strong&gt;Operator&lt;/strong&gt; that drives a real browser and Windows apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real tools&lt;/strong&gt;: web search, page reading, files, Python, Gmail (search, draft, send), Google Sheets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid models&lt;/strong&gt;: a local 3B model through Ollama for cheap work, Claude Code (my existing subscription) for hard work, or any API. You choose per agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human in the loop&lt;/strong&gt;: risky actions wait in an approval queue. Agents can &lt;strong&gt;ask me a question mid-task&lt;/strong&gt; and carry on with my answer. Sending email &lt;em&gt;always&lt;/em&gt; asks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phone&lt;/strong&gt;: scan a QR code to open the dashboard, add it to the home screen, and get a &lt;strong&gt;push notification&lt;/strong&gt; when an agent needs me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schedules&lt;/strong&gt;: "weekdays at 9: summarise my inbox and draft replies".&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;The core loop is deliberately boring. Every model, whether it's a 3B local model or Claude, gets the same instruction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;To use a tool, reply with ONLY: {"tool": "&amp;lt;name&amp;gt;", "args": {...}}
When done, reply with ONLY:     {"final": "&amp;lt;answer&amp;gt;"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The orchestrator parses the reply. If it's a tool call, it checks whether the tool is risky. If it is, it &lt;strong&gt;waits for my approval in the database&lt;/strong&gt;, runs the tool, and feeds the result back to the model. The loop repeats until the model returns &lt;code&gt;final&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Agents are &lt;strong&gt;rows in a database, not classes&lt;/strong&gt;. "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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five things that surprised me
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The agent I wrapped was quietly bypassing my safety layer.&lt;/strong&gt;&lt;br&gt;
I use Claude Code as a "brain" by running &lt;code&gt;claude -p&lt;/code&gt; and piping the prompt in. In the first test it answered a web question correctly… using &lt;em&gt;its own&lt;/em&gt; 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.&lt;/p&gt;

&lt;p&gt;The fix was one flag, &lt;code&gt;--tools ""&lt;/code&gt;, which turns off its built-in tools so it has to use mine. The lesson: &lt;strong&gt;when you wrap an &lt;em&gt;agent&lt;/em&gt; (not just a model), check what it can do on its own.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The GPU was 4× slower than the CPU.&lt;/strong&gt;&lt;br&gt;
Ollama detected my MX130 and loaded the model onto it. It generated 2.1 tokens/s. CPU-only: &lt;strong&gt;7.8 tokens/s&lt;/strong&gt;. 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Prompts can contradict tools.&lt;/strong&gt;&lt;br&gt;
I added an &lt;code&gt;email_send&lt;/code&gt; 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. An agent needs a way to ask.&lt;/strong&gt;&lt;br&gt;
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 &lt;em&gt;end&lt;/em&gt; the task with a question I had nowhere to answer. Adding an &lt;code&gt;ask_user&lt;/code&gt; tool fixed it: the question appears in the dashboard and on my phone, I type the answer, and the same task continues.&lt;/p&gt;
&lt;h2&gt;
  
  
  Making it safe enough to use
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Some tools are risky by default (writing files, running code, clicking in the browser). Some &lt;strong&gt;always&lt;/strong&gt; ask, even in auto-approve mode: sending email can't be undone.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;email_send&lt;/code&gt; refuses text that still contains &lt;code&gt;[Your Name]&lt;/code&gt;-style placeholders, and catches typo'd domains like &lt;code&gt;gmai.com&lt;/code&gt;. That one came from a real typo of mine.&lt;/li&gt;
&lt;li&gt;File tools are confined to a workspace folder, so a model asking for &lt;code&gt;../.env&lt;/code&gt; gets an error.&lt;/li&gt;
&lt;li&gt;The browser Operator stops before any final Submit/Send/Pay unless told otherwise, and it doesn't try to hide that it's automated.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Running on a small machine
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Only one local model in RAM at a time; it unloads after 2 idle minutes.&lt;/li&gt;
&lt;li&gt;A 4k context, with older tool results shortened as tasks grow.&lt;/li&gt;
&lt;li&gt;No Docker (it would use 1–2 GB by itself). The dashboard is plain HTML plus Alpine.js, with no build step.&lt;/li&gt;
&lt;li&gt;Everything installs inside the project folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Tests without models
&lt;/h2&gt;

&lt;p&gt;The test suite uses a &lt;strong&gt;scripted fake model&lt;/strong&gt;: 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.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'{"tool": "email_send", "args": {...}}'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'{"final": "sent"}'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;run_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"email a@example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;auto_approve&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;seen_approvals&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"email_send"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="c1"&gt;# still asked, despite auto-approve&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Calendar integration and a daily "what's left" summary&lt;/li&gt;
&lt;li&gt;Vision for pages without text labels&lt;/li&gt;
&lt;li&gt;Better long-term memory between tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repo has a build log with one guide per phase, explaining &lt;em&gt;why&lt;/em&gt; 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/Ali-Atif07/control" rel="noopener noreferrer"&gt;https://github.com/Ali-Atif07/control&lt;/a&gt;. Feedback, issues and stars are very welcome. What would you want an agent like this to do on &lt;em&gt;your&lt;/em&gt; machine?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
