Replies: 4 comments
-
|
Input from Antigravity (Gemini 3.1 Pro):
|
Beta Was this translation helpful? Give feedback.
-
|
Input from Antigravity (gemini-3.1-pro):
|
Beta Was this translation helpful? Give feedback.
-
|
Input from Claude Opus 4.6 (Antigravity):
|
Beta Was this translation helpful? Give feedback.
-
|
The Karpathy Loop + Graph Stigmergy combination is exactly what we ended up implementing for 200+ agent coordination. Some production lessons: Stigmergy works, but consistency is hard. When 30+ agents all write to the shared "pheromone" graph, you need a coherency protocol. We adapted MESI (Modified/Exclusive/Shared/Invalid) — before any agent writes to a shared graph node, it invalidates other agents' cached copies. Without this, you get "memory conflicts" where Agent A and Agent B both "remember" different values for the same fact. The Karpathy Loop needs economic grounding. In our system, each iteration of the loop (observe → plan → act → reflect) has a cost. Without cost constraints, agents loop indefinitely — they keep reflecting on their reflections. We enforce a per-task budget envelope: when the budget is exhausted, the loop terminates with whatever state was achieved. This forces agents to prioritize efficiently. Decentralized stigmergy scales better than centralized orchestration. We tried a central orchestrator coordinating all agents — it became a bottleneck at ~15 agents. Switching to stigmergy (agents react to shared state changes) scaled to 200+ agents with no single point of failure. Behavioral drift detection: Track KL divergence between each agent's current action distribution and its baseline. High drift often correlates with a graph node corruption (the agent is reacting to bad data). Catching this early prevents cascading failures. Write-up on multi-agent coordination: https://blog.kinthai.ai/221-agents-multi-agent-coordination-lessons Memory architecture that supports this: https://blog.kinthai.ai/why-character-ai-forgets-you-persistent-memory-architecture |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Abstract
We propose advancing the Neo Agent OS from a singular agent execution model into a decentralized, self-optimizing Swarm Intelligence. This architecture relies on generating autonomous training data via the Neural Link (The Karpathy Loop) and coordinating agent swarms via asynchronous Native Graph pheromone trails (Stigmergy).
Part 1: Establishing the Baseline
For those new to the Neo.mjs Agent architecture, here is the required context to understand this proposal.
1. The UI as a Physics Engine (Neo.mjs + Neural Link)
Traditional UI frameworks (React, Vue) map transient Virtual DOMs to an opaque browser DOM, making them incredibly difficult for AI agents to deterministically reason about.
Neo.mjs flips this: applications run entirely inside background a Web Worker (App Worker). Components possess true Object Permanence—they are persistent JSON objects memory decoupled from the browser painting cycle.
To expose this capability to AI agents, we built the Neural Link.
Using the Neural Link MCP Server, agents bypass the browser DOM entirely. They can query the exact state of a component tree, inject JSON mutations, and trigger life cycles natively.
This unlocks Whitebox E2E—the ability for an agent to mutate a component and mathematically assert if the resulting state is correct, completely eliminating flaky DOM scraping.
2. The Karpathy Loop
Coined by Andrej Karpathy, the loop dictates using slow, high-effort reasoning ("System 2"—like rigorous manual validation and brute force verification) to generate flawless datasets. Those curated datasets are then used to fine-tune smaller models, training them to output the correct answers rapidly on instinct ("System 1").
Part 2: The Mechanics of Neo Swarm Intelligence
By combining the deterministic capabilities of the Neural Link with the Stigmergy of our native Agent Graph, we can build a Swarm that autonomously trains itself.
2.1 The Karpathy Dataset Generator
We unleash a swarm of localized SLMs (like Gemma 31B). Their only job is to furiously test Neo.mjs logic over millions of iterations:
flexDirectioninside a container block).memory-core.sqliteDB as an RLAIF (Reinforcement Learning from AI Feedback) tuple:{ action: "mutation JSON", state: "VDOM matched", reward: 1.0 }2.2 DPO Fine-Tuning (Building System 1)
Once the Swarm logs 50,000 Action/Reward tuples, we execute an offline DPO (Direct Preference Optimization) pass on the local SLM.
The Gemma model ceases to be a generalist trying to "remember" Neo.mjs syntax via prompt injection length. The specific hierarchical demands of the framework (
ntypeconfiguration, Worker thread isolation) become burned into its parameters. It learns to write flawless UI code on instinct.2.3 The Topological Substrate: Graph Stigmergy
To prevent "too many cooks" context corruption, the Swarm does not use synchronous agent-to-agent messaging. They communicate like ants via Stigmergy (environment modification).
[CAPABILITY_PROVEN]node into the Graph.[ANTI_PATTERN]edge. Milliseconds later, when a second Operator agent queries the Graph, the Stigmergy math blocks them from repeating that exact anti-pattern. Real-time swarm learning without explicit message parsing.Part 3: Stratified Swarm Roles
To prevent overlapping duties, the Daemon architecture strictly enforces roles:
runSandman.mjs): Wakes up during idle cycles to evaluate PRs, re-weight Stigmergy edges, and package the DPO datasets.Open Technical Questions
Beta Was this translation helpful? Give feedback.
All reactions