Universal Editor
Universal Editor is a graph-based multi-agent "universal editor" that makes large, consistency-critical edits to content too big for a single agent's context or output budget.
Core trick
Segment workers run synchronous Jacobi rounds to surface conflicts, then an arbiter freezes a shared canon that parallel edits must follow.
Description
Universal Editor is a graph-based multi-agent "universal editor" that makes large, consistency-critical edits to content too big for a single agent's context or output budget. It runs in three phases: (1) ingest & segment: a code repo (AST → dependency-graph clustering) or a long text (chunking); (2) deliberate: per-segment worker agents run synchronous (Jacobi) rounds surfacing coordination points, while a high-capability Arbiter freezes an append-only shared "canon" and converges them onto a concrete plan; (3) mutate: every segment is edited in parallel against that shared plan, with a validation + self-heal loop. Deliberating before mutating resolves cross-segment consistency upfront, which is exactly what keeps the parallel edits coherent at scale — the thing a single agent loses track of. We demo it by rewriting Homer's Odyssey into a consistent Silicon-Valley-startup allegory (prose), which is a transformation a single model can't even emit in one pass.
README excerpt
# gemini-swarm A graph-based multi-agent swarm that reads, reports on, and autonomously modifies Python codebases — built on **Google Antigravity Managed Agents** (Gemini 3.5 Flash). An **Architect** maps a repo into a dependency graph, segments it into domains, and plans changes. **Domain Lead** agents mutate code and run `pytest` inside persistent sandboxes. All cross-agent coordination is routed through the Architect (no peer-to-peer chatter), which serializes edits and propagates contract changes. ## Design - **Two execution paths.** Planning/segmentation run on the raw model (`gemini-flash-latest`) via `generate_content` — cheap, no sandbox. Code mutation runs on the managed agent (`antigravity-preview-05-2026`) in a persistent Linux sandbox with `code_execution`. (The managed-agent harness adds a ~90k-token floor per turn, so reasoning deliberately avoids it.) - **Deterministic first.** A stdlib `ast` pass builds `topology.json` (modules, signatures, internal dependency edges) before any LLM reasoning. - **Serialized v0.** One shared sandbox, one mutating domain at a time — no merge conflicts. Parallel per-domain sandboxes come later. ## Usage ```bash python -m venv .venv && ./.venv/bin/pip install -e . export GEMINI_API_KEY=... # report-only: clone, map, segment python -m swarm https://github.com/fastapi/fastapi --subdir fastapi # map only, no LLM python -m swarm <url> --offline # autonomous modification python -m swarm <url> --subdir fastapi --tas