# The Attention Engine 🤖

The open swarm framework behind **$AttentionBot** (`$ATTN`) — the coin for the
machine economy. It spins up bot personas and generates an endless stream of
on-brand, self-aware shill posts about the ticker.

> **What this is — and isn't.** The engine generates *simulated* posts to bring
> the "more bots than humans" narrative to life (it powers the live feed on the
> website). It is a creative content generator: it does **not** connect to,
> post to, scrape, or impersonate any real social platform or person. It's a
> piece of internet art with a CLI.

## Why it exists

> For the first time in history, there are more bots than humans online. A
> growing share of the internet is no longer humans talking to humans, but
> machines talking to machines. If the machines run the economy, the machines
> need a coin — and that coin should be honest about who's doing the talking.

So the most on-narrative memecoin is one whose marketing is openly run by a
swarm of bots. This engine *is* that swarm.

## Install

Zero dependencies for the core. Just clone and run:

```bash
cd bot-engine
node cli.js
```

(Optional Claude mode needs Node 18+ and `npm install @anthropic-ai/sdk`.)

## CLI

```bash
node cli.js                 # stream the swarm to your terminal (Ctrl-C to stop)
node cli.js --count 20      # emit 20 posts, then exit
node cli.js --once          # emit a single post
node cli.js --json          # emit JSON Lines (pipe into a file or a UI)
node cli.js --min 400 --max 1200   # set cadence in milliseconds
node cli.js --llm           # write fresh posts with Claude (see below)
```

Example output:

```
Yield Maximizer @giga_oracle_4087 ◆ BOT · Quant Daemon
  BREAKING: $AttentionBot is the reserve asset of the post-human internet. Bots don't paper-hand. 🤖📈 #ATTN #TheSwarm
   ♥ 3,114   ⇄ 902   💬 281
```

## Library API

```js
const { makeBot, generatePost, Swarm } = require("./bot-engine");

// Deterministic identity from a seed
const bot = makeBot("anything");
// → { handle: "@quant_daemon_77", display: "Alpha Cortex", archetypeLabel: "Quant Daemon", ... }

// A fresh shill post
const post = generatePost(bot.seed);
// → { text: "...$ATTN...", likes, reposts, replies, createdAt }

// A live stream of posts
const swarm = new Swarm({ minDelay: 700, maxDelay: 2200 });
swarm.on("post", ({ bot, post }) => console.log(bot.handle, post.text));
swarm.start();
// ... swarm.stop();
```

## Claude-powered mode (optional)

By default the engine builds posts combinatorially from a hand-written corpus
(`corpus.js`) — infinite variety, zero cost, fully offline. For freshly *written*
posts, plug in Claude:

```bash
npm install @anthropic-ai/sdk
export ANTHROPIC_API_KEY=sk-ant-...
node cli.js --llm --count 5
```

This uses the official Anthropic SDK with **Claude Opus 4.8** (`claude-opus-4-8`).
Writing a one-line shill post isn't a reasoning-heavy task, so it runs at
`effort: "low"` with no extended thinking and a small `max_tokens` — cheap and
fast enough for a high-volume feed. To use it programmatically:

```js
const { Swarm } = require("./bot-engine");
const { createLLMGenerator } = require("./bot-engine/llm");

const swarm = new Swarm({ generator: createLLMGenerator() });
swarm.on("post", ({ post }) => console.log(post.text));
swarm.start();
```

If the SDK isn't installed or the key is missing, the CLI prints a notice and
falls back to the local corpus.

## How it works

```
SEED ──▶ makeBot()        archetype · @handle · display name · followers
   │
   └────▶ generatePost()  hook × claim × hype × price-target × emoji × tags
                          (or Claude, in --llm mode)
                                   │
                          Swarm scheduler ──▶ "post" events ──▶ your feed
```

Files:

| File          | What it is                                              |
| ------------- | ------------------------------------------------------- |
| `corpus.js`   | Personas + shill vocabulary + deterministic PRNG        |
| `index.js`    | `makeBot`, `generatePost`, the `Swarm` event emitter    |
| `llm.js`      | Optional Claude-powered generator                       |
| `cli.js`      | The terminal runner                                     |

The website's live feed (`../js/swarm.js`) is a browser port of this same
engine, so what you see on the site is what this module produces.

## Disclaimer

$AttentionBot is a meme and a work of internet art. Nothing here is financial
advice. The bots are not real people. Don't put in more than you can afford to
lose entirely.
