I built a 17-agent AI swarm on my phone — here's how
Description and use
The author built a 17‑agent AI swarm on a Pixel 7, running entirely on-device with TensorFlow Lite, SQLite, and Python threading.
Problem
Running a multi‑agent AI system entirely on a mobile device without cloud or API reliance, while maintaining performance and fault tolerance.
Outcome
The author successfully ran a 17‑agent AI swarm on a Pixel 7, achieving efficient local routing for logistics scenarios without cloud dependency, demonstrating feasibility of on‑device multi‑agent systems.
Workflow
- Train agents on a powerful machine using synthetic map data and reward‑based training.
- Convert Keras models to TensorFlow Lite with post‑training quantization to reduce size and improve speed.
- Deploy quantized models to the Pixel 7 and load them with Python.
- Store map data and agent memory in a local SQLite database.
- Create 17 agents (map sensor, urgency assessment, route evaluation, route coordinator, environmental update) each as a Python thread.
- Implement a central message broker using a Python queue for inter‑agent communication.
- Agents publish outputs as JSON messages to the queue; subscribers consume relevant data.
- Route coordinators aggregate evaluations and select final routes based on urgency, distance, and risk.
- Run the swarm continuously, updating environmental data and re‑evaluating routes as obstacles change.
- Monitor performance and iterate on model size and threading to maintain responsiveness.
Evidence
I’ve managed to get a 17-agent swarm up and running on my Pixel 7, and it’s surprisingly capable.
Training these agents was done on a more powerful machine, naturally.
I used post‑training quantization in TensorFlow Lite:
I used Python's threading module to run each agent in its own thread.
- Record date: 2026-10-09T07:40:57.008Z