I built a 17-agent AI swarm on my phone — here's how
Описание и применение
Создана 17‑агентная AI‑сверстка, работающая полностью на Android‑устройстве без облачных API, используя WebAssembly для ускорения вычислений и Flutter для доступа к датчикам. Система демонстрирует эмергентное распознавание активности и жестов.
Задача
Run a multi-agent AI swarm entirely on an Android phone without cloud APIs, achieving real-time interaction, privacy, and low latency.
Результат
The swarm processes sensor data in real-time on-device, achieving activity and gesture recognition without cloud APIs, demonstrating emergent behaviour from simple agents.
Рабочий процесс
- 1. Choose TypeScript for type safety and native web worker execution.
- 2. Use vanilla JavaScript with gl-matrix for vector math.
- 3. Compile performance-critical C++ code (smoothing, pattern recognition) to WebAssembly via Emscripten.
- 4. Load WASM modules into the JavaScript environment.
- 5. Build a Flutter Android app to host a headless webview, access sensors, and display UI.
- 6. Implement a simple in-memory message broker for agent communication.
- 7. Create 17 agents: 3 sensor input, 4 pattern recognition, 3 spatial mapping, 2 navigation, 3 action selection, 2 event logger.
- 8. Each agent processes data, publishes/subscribes via the broker.
- 9. Run the swarm, observe emergent behaviour (activity, gesture, environmental awareness).
Доказательства
I built a 17-agent AI swarm that runs entirely on my Android phone. Not through cloud APIs (mostly), but actual on-device processing.
The biggest bottleneck was processing the sensor data. JavaScript, while improved, isn't ideal for number-crunching. That's where WASM came in.
This made a massive difference. The WASM-compiled code runs several times faster than the equivalent JavaScript, allowing the swarm to process sensor data in real-time without draining the battery.
The swarm can reliably detect when I’m walking, running, or sitting still, based solely on the sensor data.
- Дата записи: 2026-10-09T00:40:51.635Z