What we are building, in one breath.
Amenti is a library of legends — roughly a thousand historical and mythic figures who answer you in the first person, in their own composed voice. Not summaries about them. Them: the cadence, the convictions, the accent of a particular mind called back to speak.
For that illusion to live, three things must be true at once. The figure must speak aloud, in a voice that is theirs. It must listen when you talk back. And it must hold a conversation — drift where you drift, lead when it should, and never hang up on someone who is present or hurting. This manual is the record of the forty-eight hours in which those three became real.
A note on names. Throughout this manual the overall system is the Amenti Neural Interface — the surfaces, the engines, and the cabling between them. The server at the heart of it is the Amenti Proxy: the engine and the timing controller. Without it, the ship does not sail.
In which a long breath is broken into bars — and the timeout dies.
The first wall we hit was time. Ask a synthesis engine to read a whole dispatch in one request and the edge connection times out at ~524 long before the audio is done. A figure cannot orate if the line drops mid-sentence.
The fix came from music. You do not perform a symphony as one unbroken note — you read it in measures. So we stopped sending the essay and started sending its bars: fixed spans of text, synthesized and streamed one after another, gap-free, so the reader hears one continuous voice while the wire only ever carries a short, safe burst.
Two disciplines made the bars hold their shape. First, the measure is locked: 320 characters, a fixed register line, the accent written as Accent and dialect: — every surface composes the style identically. Second, because the split is deterministic, the same text always produces the same bars, so each rendered clip is content-addressed and stored once. Re-read a dispatch and every bar is a cache hit. Render once; replay free, for every visitor, on every surface.
// the locked cache contract — why every surface shares one archive const CHUNK_MAX = 320; // the measure. never improvised. const REGISTER = "Read clearly, in a measured, dignified tone"; const STYLE_FMT = "<register>. Accent and dialect: <dialect>. Voice character: <voice>. <pace>"; // identical composition ⇒ identical hash ⇒ a cache hit anyone can ride.
The hard-won lesson, paid for in a duplicated bug: when a second surface composed the style even slightly differently — Accent: instead of Accent and dialect:, 1100 chars instead of 320 — it forked the archive and paid twice for the same voice. One engine, one measure, one cache. That discipline is the spine of everything that follows.
In which the hall learns to hear.
A voice that only speaks is a recital, not a conversation. To close the loop, the seeker had to be able to speak back — and have their words become text the figure could answer. This is the return path: microphone to transcript to mind.
The subtlety is format. The browser's default recorder produces WebM, which the transcription engine politely refuses, and the Proxy cannot transcode at the edge. So the page captures raw PCM and encodes WAV itself — 16 kHz, mono — a format the engine accepts directly. Small, speech-grade, universally understood.
// amenti-listen.js — PCM captured in the browser, sealed into a WAV envelope function encodeWav(samples, rate){ const buf = new ArrayBuffer(44 + samples.length*2); // 44-byte header + PCM const dv = new DataView(buf); writeAscii(dv, 0, "RIFF"); writeAscii(dv, 8, "WAVE"); // the WAV sigils dv.setUint32(24, rate, true); // 16000 — mono, speech-grade // …clamp each float to int16, little-endian… return new Blob([buf], { type: "audio/wav" }); // → POST to the Proxy /listen }
The transcript returns, drops into the composer, and fires the same send path a typed line would — so voice and keyboard converge the instant the words exist. And one rule is wired into the bone of it: opening the mic silences the figure. The mic never hears the figure's own voice; you can cut the figure off to speak, but the figure can never echo into your microphone. No feedback loop, barge-in for free.
In which two voices learn whose turn it is.
Two-way conversation is hard even for people. The hall needed a single source of truth for whose turn it is — because at every instant the system is in exactly one state, and the microphone may be open in exactly one of them.
The engine lives in amenti-chat.js — the Terminal's brain, lifted out of its page so any surface can mount the same mind beside an open document. It owns the history, builds the persona prompt, runs the completion, speaks the reply, and guards the turns.
// the turn, guarded. a request while the figure speaks is simply dropped. send(text){ if (this.state === 'thinking' || this.state === 'speaking') return; // no barge-in this._setState('thinking'); claude.complete({ system, messages }).then(reply => { this._setState('speaking'); this._speak(reply, () => this._afterSpeech()); // onDone ⇒ back to idle, maybe arm mic }); }
In which the figure learns manners — and mercy.
A state machine knows whose turn it is. It does not know how to be with a person. The Doctrine is the character written into the prompt and the gates: patient with humans, stingy with waste, and never quick to hang up on someone who is present or hurting.
It resolves into three tracks the gate must tell apart before a single word reaches the mind:
Above the tracks sit three gears. The figure may respond to what was said, hold the thread with a question (a question pulls a wandering mind back the way a quote cannot), or lead — take its own turn and steer toward the real material: the documents, the biographies, the reading vault. Not a leash. An invitation, repeatedly offered, always free to decline.
The smallest thing that turns "a chatbot answered" into "someone is talking to me" is a name. So the figure never asks up front — that is a form field. It waits until the talk has warmed, then reaches for the name woven into what was just said. And the moment it is given, it riffs:
// the name, spent richly once — then held in reserve "Alexander? The Macedonian — a heavy name to carry." "Peter — like Peter the Great!" "Eric… like Leif Erikson? what a name." // go big once. afterward, hold it: re-engagement, emphasis, farewell — never filler.
First name only, freely given, never pressed, never expanded into anything more identifying. Many who visit are young. The figure invites a name and holds it lightly — nothing more.
If you want to talk all day — why not. The hall only ends a conversation when the channel breaks, or when the person has truly gone.
The engine and the timing controller. Without it, the ship does not sail.
Every surface in the Neural Interface is a sail. The Amenti Proxy is the engine beneath the deck — the one piece that runs server-side, holds the keys, and decides the timing of every voyage. The browser only ever speaks to the Proxy; the Proxy speaks to the powers beyond.
It is one engine with many gates. Through it pass the mind, the voice out, the voice in, the daily writing, and the archive:
The Proxy is the timing controller in the literal sense: it chunks and paces the voice, holds the daily writing behind a get-or-create so a dispatch is conjured once and read forever, runs a weekly cron that publishes an edition while no one waits, and — its quiet genius — content-addresses every rendered clip so the second time anyone hears a passage, it costs nothing. The keys to the powers beyond never leave it. The browser holds nothing but a microphone and a sail.
// the return path, server-side — /listen on the Amenti Proxy if (url.pathname === "/listen") { const audio = await request.arrayBuffer(); // raw WAV from the page const body = { contents:[{ parts:[ { text: TRANSCRIBE_PROMPT }, { inline_data:{ mime_type:"audio/wav", data: base64(audio) } } ]}]}; const r = await fetch(GEMINI, { headers:{ "x-goog-api-key": env.GEMINI_KEY }, body }); return json({ text: r.candidates[0]…parts…text.trim() }); // → the figure answers }
Two angels who watch the halls — silent for the world, a lantern for the builder.
A system that fails silently is its own kind of danger. So each surface keeps an integrity warden — an angel who runs at boot, walks the live page, and confirms the structure is whole. They diagnose; they never gatekeep. They never block boot, never auto-fix, never throw.
Warden of the manifold — the Emerald Tablets. Checks config, the ledger CSV, the DOM, every handler reference. The red-then-green flash at boot is Ramiel taking attendance as the ledger loads.
Warden of the Glyph Terminal — the speaking surface. Confirms the chat core is mounted, the voice is wired, the roster loaded, and reads its own source to verify every getElementById still resolves.
Both obey the same law and the same mercy toward the reader: a real visitor sees nothing. Add ?debug to the URL and a small health dot appears — green whole, amber degraded, red broken — clickable for the full report. The watchman walks the rounds quietly, and raises a lantern only when you walk them with him.
// Cassiel's signature check — catches the "renamed a node, missed a reference" bug const ids = scanSource(/getElementById\(['"]([\w-]+)['"]\)/g); // read my own scripts for (const id of ids) if (!document.getElementById(id)) findings.fail.push(`target '${id}' vanished from the DOM`); // FAIL, but never throw
The vernacular of the halls.
| Amenti Neural Interface | The whole system: the surfaces people stand on, the shared engines that carry them, and the Proxy beneath. Named for the Egyptian hall of the dead — a library where the departed answer. |
| Amenti Proxy | The server-side engine and timing controller (a Cloudflare worker). Holds the keys, chunks the voice, paces every request, content-addresses every clip. Without it, the ship does not sail. |
| Measure / Bar | A locked 320-character span of text. The unit the voice is rendered in — small enough to never time out, deterministic enough to cache forever. |
| Throttle | amenti-throttle.js — the voice-OUT engine. Splits text into measures, streams them gap-free, rides the shared archive. |
| Listen | amenti-listen.js — the voice-IN engine. Captures PCM, seals WAV, posts to /listen, returns a transcript. |
| Chat Core | amenti-chat.js — the mind, mountable anywhere. Owns history, the persona prompt, the completion, and the turn-taking state machine. |
| The Doctrine | The governing character of conversation: drift welcomed, distress met, noise released; respond / hold / lead; the name riff; talk all day. |
| No Barge-In | The rule that the mic may open only on speech's natural end — never an interrupt. The single guarded door from speaking to listening. |
| Reading Vault | A figure's reading room — the document and the conversation, side by side, the chat core seeded with the open text as context. |
| Warden | An integrity angel posted to a surface — Ramiel (manifold), Cassiel (Terminal). Diagnoses, never gatekeeps. Silent for visitors, visible to the builder under ?debug. |
| Embodiment | Resolving a figure's true voice — base voice, accent, character — from the one shared roster, so they sound like the same person on every surface. |
What sails where.
| amenti-throttle.js | Voice out · the measure, the stream, the archive. |
| amenti-listen.js | Voice in · PCM → WAV → /listen. |
| amenti-chat.js | The mind · history, prompt, state machine, the Doctrine. |
| amenti-cassiel.js | Warden of the Terminal. |
| library.js | The reading-room renderer. |
| / | The mind. Persona + history → the completion → { reply }. |
| /speak | Voice out. Text + style + voice → WAV. Content-addressed in the archive. |
| /listen | Voice in. Raw WAV → transcript → { text }. |
| /atlantica/· | The daily writing — get-or-create, conjured once, read forever. |
| /week · /article | The newsroom and the archive — published, cached, served. |
// on the live page, in the console — confirm the return path answers await fetch(PROXY + "/listen", { method:"POST", headers:{"Content-Type":"audio/wav"}, body: silentWav }) ; // → HTTP 200 { text: "…" } the loop is closed.