How to build an Agent, On-Device Edition
August 29, 2025
This post explores how to build an agent using an on-device model such as Phi-4-mini or Gemini Nano (available in Edge or Chrome browsers respectively), all behind a simple flag. This approach lowers the barrier to entry since it requires no external API or service.You can read the original, How to Build an Agent.
I urge you to follow along. The barrier is so low, it’s less than 200 lines of code, just pop open your browser dev tools console and you can follow right along as you read this!
Source: Ryan Seddon | How to build an Agent, On-Device Edition
You might think that developing an agent requires the use of APIs and large amounts of computational power. But here Ryan Seddon shows us how, on our device, in our humble browser, using JavaScript and a less than 200 lines of code, we can write agentic systems ourselves.
Follow along with him as he does so.








