goblintown

A local-first desktop AI app. Start with simple chat, pick the API or local model that powers it, then summon full rites when the work needs memory, tools, debate, critique, and saved artifacts.

download github

# background

In April 2026, OpenAI published Where the goblins came from, explaining how a reward signal trained for a "Nerdy" personality leaked across all of GPT-5.5's outputs and produced a noticeable surge in creature metaphors. Codex shipped with a hardcoded ban list — goblins, gremlins, raccoons, trolls, ogres, pigeons.

This project takes that ban list as a roster.

# roster

CreatureJob
GoblinWorker. Cheap, high-temperature, dispatched in packs. Each pack member gets a different personality; an optional debate round lets them revise after seeing each other's proposals.
GremlinAdversarial. Per-goblin chaos pass — finds edge cases, off-by-ones, prompt-injection vectors.
RaccoonScavenger. Returns only the facts a task actually needs. Also loads relevant prior Artifacts when memory is enabled.
TrollReviewer. Default-rejects. JSON verdict. May invoke verifier tools (json.parse, regex.match, http.head, and enabled add-on tools) before scoring.
OgreHeavyweight. Last resort — only summoned if the pack and the Specialists both fail.
PigeonCarrier and Scribe. Routes artifacts between Warrens (federation) and distills every completed rite into a typed Artifact (memory).
SpecialistGoblin variant. Spawned when the pack fails Troll review — each one targets a single dominant failure mode identified by clustering the gremlin's critiques.

A unit test pins the roster to the OpenAI ban list, so it can't drift quietly. The Specialist is a Goblin variant — same kind, focused system prompt — so the ban-list invariant still holds.

   ▄█▄        ▄█▄
   ███        ███
    ▀████████████▀
     █  ▀▄  ▄▀  █
     █   ●  ●   █
     █    ▾▾    █
     █▄▄▄▄▄▄▄▄▄▄█
      █▌ █  █ ▐█
      ▀▀ ▀  ▀ ▀▀
Goblin
   ▀▄ ▄▀ ▀▄ ▄▀
     ▀█▄▄█▄▄█▀
      █████████
      █ ◉   ◉ █
      █   ╳   █
      █ ╲╱╲╱╲ █
       ▀█████▀
         █ █
        ▀▀ ▀▀
Gremlin
    ▄█▄          ▄█▄
    ███          ███
     ▀████████████▀
     █▌ ●▔     ▔● ▐█
     █      ▾      █
     █▄▄▄▄▄▄▄▄▄▄▄▄█
     █▌█        █▐█
     ▀▀▀        ▀▀▀
Raccoon
       ▄ ▄    ▄ ▄
       █ █    █ █
     ▄████████████▄
     █  ●        ●  █
     █     ▾▾▾▾    █
     █  ──────────  █
     ████████████████
    █▌                ▐█
    █▌                ▐█
    ████          ████
Troll
        ▄▄▄▄▄▄▄▄▄▄
       ████████████
      ██  ▀▀    ▀▀  ██
      █     ●    ●    █
      █        ▽       █
      █▄  ▼▼▼▼▼▼▼▼  ▄█
       ████████████
      ██████████████
      ██          ██
      ██          ██
Ogre
       ▄██▄
      ██  ●█
      █▌    █▶▶▶
      ██████████
      █▀▀▀▀▀▀▀▀█
       ████████
          █ █
          █ █
         ▀▀ ▀▀
Pigeon

# the rite

The full pipeline. Every step writes a Loot drop to the Hoard with parent links to its inputs — a Rite is fully reconstructible from the Hoard alone. The Pigeon-Scribe also emits a typed Artifact (claims, evidence, open questions, next steps) that future rites can cite.

  optional ─────────────────────────────────────────────────────
  ┌──────────┐                                                 │
  │ Planner  │ DAG of sub-rites; recursive replan on failure   │
  └────┬─────┘                                                 │
       ▼                                                       │
  ┌──────────┐  facts +   ┌────────────┐  N parallel ┌──────────┐
  │ Raccoon  │  prior    ▶│  Goblin    │═════════════▶│ Goblins  │
  │ + memory │  artifacts │  pack      │  per-goblin  │  output  │
  └──────────┘            │            │  personality └────┬─────┘
                          └────────────┘                   │
                                  optional debate          │
                                  (peers see peers,        │
                                   revise) ◀───────────────┘
                                          │
                                          ▼
                                  ┌─────────────┐
                                  │   Gremlin   │  per-goblin
                                  │ chaos pass  │  attack
                                  └──────┬──────┘
                                         ▼
                                  ┌─────────────┐  optional
                                  │    Troll    │  verifier tool-use
                                  │   review    │  (json/regex/http)
                                  └──────┬──────┘
                                         │
                              any pass ──┴── all fail
                                  │              │
                                  │              ▼
                                  │      ┌───────────────┐
                                  │      │ Cluster fails │
                                  │      │ (1 LLM call)  │
                                  │      └───────┬───────┘
                                  │              ▼
                                  │      ┌───────────────┐
                                  │      │ Specialists   │  1-3 focused
                                  │      │ + re-judge    │  recovery workers
                                  │      └───────┬───────┘
                                  │              │
                                  │      passed/improved over seed
                                  │              ▼
                                  │      ┌────────────┐
                                  │      │   Ogre     │  last resort
                                  │      │  fallback  │  (heavyweight)
                                  │      └─────┬──────┘
                                  │            │
                                  ▼            ▼
                                 winner ◀──────┘
                                    │
                                    ▼
                              ┌─────────────┐
                              │  Pigeon —   │  distills the rite into
                              │   Scribe    │  a typed Artifact (memory)
                              └─────────────┘

# concepts

Loot

One agent invocation, content-addressed by sha256(model || prompt || output).

Quest

Lightweight: Goblin pack + Troll arbitration.

Rite

Full pipeline: Raccoon → pack → (debate?) → Gremlin → Troll → Specialists → Ogre fallback → Scribe.

Plan

A DAG of sub-rites the Planner emits for complex tasks. Topologically executed, parent artifacts feed into dependent nodes, recursive replan on node failure.

Artifact

Typed JSON summary of a completed Rite: claims, evidence, open questions, next steps, parent-artifact links. Future rites cite or auto-load relevant artifacts.

FailureCluster

A dominant failure mode (e.g. null-handling, off-by-one) identified by a clustering LLM call. Each cluster spawns one focused Specialist Goblin.

Hoard

File-backed store under .goblintown/hoard/. Loot, rites, quests, artifacts, inbox, outbox. Every drop is auditable.

Warren

Per-project root, found by walking up from cwd.

Shinies

Reward = troll score − cross-creature drift penalty + pass bonus, clamped 0..1. Override with .goblintown/reward.mjs.

Drift

Cross-creature word frequency. A Goblin output mentioning raccoons unprompted is the signal we measure.

Trace

Full run history, exportable to the academic LLM-MAS Orchestration Trace schema for compatibility with research tooling.

Federation

Pigeons route artifacts to other Warrens — file or HTTP, signed, optional HMAC.

# download

The desktop app opens directly into chat, asks which API or local model should power Goblintown, and keeps setup to a few guided clicks. One-click installers, no build step.

macOS: open the DMG, drag Goblintown to Applications. Windows: run the installer. Linux: mark the AppImage executable and run it. Every asset and SHA256SUMS.txt lives on the v0.7.0-beta.1 release. These beta builds aren't code-signed yet, so macOS may need right-click → Open and Windows may show a SmartScreen "More info → Run anyway" prompt.

Prefer the command line? Install from npm:

npm install -g goblintown
goblintown serve        # opens the GUI at http://localhost:7777/

# using goblintown

The app opens into Goblin Mode: one prompt and a Single Goblin / Goblintown switch. Single Goblin is one worker and one answer — fast chat. Goblintown turns the prompt into a planner DAG with the full pack, memory, and self-correction, streaming progress as it runs.

Flip on the Tank for the live diorama: each creature has a home, tokens stream into per-creature thinking bubbles, the DAG panel lights up node-by-node, and the result panel slides up with the winning output.

Everything else lives behind Settings — API provider and per-creature model routing, voice, imported context, group chats and country collaboration, mail, add-ons, onchain lookup, sentiment sources, cloud sign-in, and reset. An interrupted run resumes from the Tank's recovery prompt after a restart.

The package still ships a CLI for development and automation (goblintown serve, rite, plan, thesis, context, …). It is no longer the primary surface — run goblintown --help for the full list.

# what's in the box

Planner + DAG executor

Decompose complex tasks into a DAG of sub-rites with dynamic spawning (planner picks pack size and personality per node). Recursive replan on node failure, max depth 2.

Per-goblin personalities

Each goblin in a pack draws a different personality from {nerdy, cynical, chipper, stoic, feral, goblin_mode} — a real debate team, not three copies of the same worker.

Inter-agent debate

Optional round where each goblin sees its peers' outputs and may revise. Closes the O3 communication gap from the LLM-MAS-RL survey. Training-free.

Adversarial review

Every output gets attacked by a gremlin before review. Edge cases, off-by-ones, prompt injection.

Verifier-as-reward tools

Optional troll tool-use round: json.parse, regex.match, http.head, and enabled add-on tools. Real ground-truth signals beyond LLM-as-judge.

Specialist recovery

When the pack all-fails, cluster failure modes (1 LLM call) and spawn focused Specialist Goblins that surgically fix one mode each. Wins on pass OR improvement over seed; only escalates to Ogre if specialists also fail.

Ogre fallback

Heavyweight last-resort. Synthesizes from the best parts of the failed pack. Only summoned when nothing else holds.

Typed Artifact memory

Pigeon-Scribe distills every rite into a typed JSON Artifact (claims, evidence, open questions, next steps). Future rites cite or auto-load relevant artifacts. Local context ingestion imports old conversations and project folders as file-backed Artifacts. Chat Hoard Import Mode scans Codex sessions and ChatGPT exports, stores root/chunk DAG artifacts, and keeps chat memory pre-vectorized when embeddings are configured. AI summaries are opt-in.

Context-folding

As the Hoard accumulates, goblintown fold merges related older artifacts into higher-level summaries. Recursive abstraction.

Token streaming

Ogre, every goblin, and every specialist stream tokens. Live "thinking" bubbles in the tank UI show what each creature is producing as it produces it.

Goblin Mode GUI

A one-prompt surface at / with Single Goblin and Goblintown modes, slash commands, and a Tank checkbox for planner runs. The desktop app opens here by default.

Tank UI

A tamagotchi-style live diorama at /tank: default creature sprites, a centered wordmark, village tiers, DAG progress, resumable run views, Onchain lookup, the Tank Sentiment tool, and first-run API plus Local Only / Goblintown Cloud choices.

Settings menu

Country, Mail, Add-ons, Onchain, Settings Sentiment Sources, API Provider, Account cloud mode, and Reset are gathered into one scrollable menu. Reset buries Asteroid Mode behind an extra step before local or cloud data can be destroyed.

Solana add-on

Enable read-only onchain investigator tools for address profiles, activity, parsed transactions, token mint/account data, SOL balances, account metadata, SPL token accounts, recent signatures, and RPC health. The Tank Onchain panel and goblintown addon solana <address> can turn a lookup into a Goblintown analysis rite. No keys, signing, swaps, or transaction submission.

Thesis engine

Build project-quality memos about a team, product, protocol, repository, or decision. It weighs quality and advantages, evidence gaps, risks, and invalidation triggers, can scan repo files, and labels missing evidence Unknown / Unverified. It is not buyability or a buy/sell recommendation.

Sentiment sources

Free/no-key Alternative.me and GDELT baselines ship by default. Project checks keep query-specific signals separate from broad market context. Optional CoinGecko, Dune, Neynar, Santiment, CryptoPanic, and LunarCrush keys can be saved locally in .goblintown/secrets.json or supplied with env vars like COINGECKO_API_KEY and NEYNAR_API_KEY.

Goblintown Cloud

Run local-only by default, or sign in with the bundled Firebase project for SSO, friend codes, discovery, mail, and country metadata. Forks can override Firebase env vars without making every user bring their own keys.

Provider menu

Choose OpenAI, OpenRouter, Ollama, LM Studio, Groq, Together, Mistral, DeepSeek, Anthropic, Gemini, or a custom OpenAI-compatible endpoint from Settings. Keys stay local.

Forced output formats

Answer-producing calls can be constrained to Markdown or a single JSON object. JSON output is locally validated and repaired once if malformed.

Trace export

Export any run to the academic LLM-MAS Orchestration Trace schema (10 event types, 8 edge types, topology classification).

Content-addressed Hoard

Every Loot drop is keyed by hash. Full causal graph of who-produced-what is recoverable. Audit + graph commands traverse artifact lineage across rites.

Drift telemetry

Goblintown measures cross-creature word frequency. High drift = your reward signal is leaking.

Budget + concurrency

Per-rite token budgets, per-call max-output, in-process semaphore for in-flight API calls. SDK retries 429/5xx automatically.

Federation

Pigeons deliver compressed artifacts between Warrens, over filesystem or HTTP. Signed bodies, optional HMAC.

Pluggable rewards

Drop a .goblintown/reward.mjs to override the default scoring.

Reroll, export, compare, ancestry

Re-run a rite with same params; export to markdown; diff two rites; print artifact lineage.

318 tests

Pure-function coverage on every protocol invariant: drift, reward, hoard hashing, federation HMAC, audit, graph, planner DAG validation, debate prompt construction, tool dispatch, add-on registry, Solana read-only RPC shaping, address profiles, activity, transactions, token summaries, thesis prompt/evidence construction, Goblin Mode shell wiring, Tank thesis wiring, sentiment sources, query-specific project sentiment, market context separation, source failure normalization, local context ingestion, previous chat import, pre-vectorized chat memory, and Tank/Settings wiring, embeddings ranking math, provider routing, cloud mode, Settings reset flows, sprite assets, output formatting, fold clustering, trace-export schema mapping. No OpenAI calls during testing.

# reward plugins

Drop a .goblintown/reward.mjs in your Warren to override the default scoring.

// .goblintown/reward.mjs
export default function (loot, verdict) {
  return verdict.passed
    ? 0.8 + (1 - loot.drift.driftRate) * 0.2
    : verdict.score * 0.5;
}

Result is clamped to [0, 1].

# research foundations

Goblintown is an engineering project, not a research paper, but the design of its later phases is opinionated by what's working in current LLM-multi-agent-systems work. We deliberately stay in the prompted, training-free slice of the literature so everything runs with just an OpenAI-compatible API key — no GPUs, no fine-tuning, no RL infra.

  1. OpenAI, Where the goblins came from (April 2026). The roster (goblin / gremlin / raccoon / troll / ogre / pigeon) is the OpenAI ban list from this postmortem.
  2. Nielsen, S. et al., Learning to Orchestrate Agents in Natural Language with the Conductor (arXiv:2512.04388). Conductor is RL-trained; we steal its dynamic topology and recursive-self-as-worker ideas as prompted heuristics inside the Planner and the recursive replan loop.
  3. Zhou & Chan, ADEMA: Knowledge-State Orchestration for Long-Horizon Synthesis (arXiv:2604.25849). Goblintown's typed Artifact is a direct adaptation of ADEMA's epistemic bookkeeping.
  4. Saeidi et al., FAMA: Failure-Aware Meta-Agentic Framework (arXiv:2604.25135). The Specialist re-rite layer follows FAMA's pattern: analyze the failure trajectory and spawn a minimal specialist that targets the dominant error.
  5. Parmar, MCP Workflow Engine: Separating Intelligence from Execution (arXiv:2605.00827). Plan-then-execute split — one LLM emits a declarative DAG, a deterministic engine walks it.
  6. Zou, J. et al., Latent Collaboration in Multi-Agent Systems (arXiv:2511.20639). The only training-free debate paper in our survey that reported a meaningful gain. Our debate round is its explicit, prompted-exchange counterpart.
  7. Peng, Z. et al., CriticLean: Critic-Guided Reinforcement Learning for Mathematical Formalization (arXiv:2507.06181). The verifier-as-reward pattern in the troll's tool-use round.
  8. Awesome LLM-MAS RL (May 2026). The survey's five orchestration sub-decisions (spawn / delegate / communicate / aggregate / stop) was the diagnostic that surfaced our biggest gap — agents weren't communicating — and motivated the debate round. The repo's JSON Schema for orchestration traces is adopted as goblintown's export-trace output format.

The bulk of the LLM-MAS-RL literature uses post-training methods (MAGRPO, MARFT, MAPoRL, Dr. MAS, SHARP, DEPART, MarsRL, MALT, MARSHAL, SPIRAL, …). These produce stronger orchestrators in benchmark settings but require GPUs, datasets, and RL infra. Goblintown is built for engineers shipping multi-agent features on existing API endpoints.