I built a 17-agent AI swarm on my phone — here's how
Description and use
A 17‑agent AI swarm runs entirely on a mid‑range Android phone, showcasing on‑device multi‑agent AI and decentralized behavior without cloud support.
Problem
Run a multi‑agent AI swarm entirely on a mid‑range Android phone without cloud or server support.
Outcome
A functional 17‑agent swarm that forages resources on a mid‑range Android phone, demonstrating feasible on‑device multi‑agent AI with emergent behavior.
Workflow
- 1. Design a lightweight neural network per agent with 4 inputs and 3 outputs.
- 2. Train a master network on a powerful machine and clone weights to 17 agents.
- 3. Apply small random weight mutations (genetic algorithm) for behavioral diversity.
- 4. Convert Keras model to TensorFlow Lite using tf.lite.TFLiteConverter.
- 5. Quantize the model to 8‑bit integers to reduce size and improve inference speed.
- 6. Load the TFLite model in a Kivy app via tflite_runtime.interpreter.
- 7. Transform sensory data to NumPy arrays and feed to the interpreter.
- 8. Run inference every few frames to avoid performance bottlenecks.
- 9. Simplify collision detection with bounding boxes and proximity checks.
- 10. Offload UI updates to separate threads to keep Kivy responsive.
- 11. Observe emergent swarm dynamics in the 2D simulation.
Evidence
I built and deployed a 17‑agent AI swarm that runs entirely on my phone. No cloud connection, no server – just the processing power of a mid‑range Android device.
Training 17 of these networks on the phone was a non‑starter. The Pixel 6a doesn't have the horsepower to handle that.
Key steps included: Model Conversion, Quantization, Interpreter Setup.
Performance Bottlenecks: Running 17 neural networks simultaneously on a phone is resource‑intensive. Quantization helped, but I also implemented a simple frame skipping mechanism.
- Record date: 2026-10-08T20:41:03.874Z