How Priestess is built (v1)
EngineeringDec 4, 2026Updated Dec 6, 202612 min read
Priestess is a Discord agent whose replies are reaction images, GIFs, and short videos. She launched in a friend's Discord server of 500+ members on Nov 8, 2026 and had posted 1,370+ live replies by Dec 4, 2026. Version 1 still misses the quality targets I set for it in September.
1,370+ live replies Nov 8 to Dec 4, 2026
~26% to ~9% offline bad picks 82 held-out picks, Sep 25, 2026
28.2 s median reply time in dual-model mode 481 live turns, Nov 8 to Dec 4, 2026
How this was builtClaude Code and OpenAI Codex wrote the code for the core system and the launch, and Google Antigravity joined in late November 2026. I set the system design, the model and evaluation choices, and the safety and release rules. Tests, offline evals, and reviewer agents that did not write the change check each release, and I approve feature releases. When I am away, my standing rules let the agents ship a narrow fix and report it to me.
Contents13 sections
- A bot that only posts reactions
- The one-day plan did not survive a week
- One reply, start to finish
- Searching with a thought
- Two pickers and a judge, or one cheaper picker
- Rewriting captions cut offline bad picks from ~26% to ~9%
- Where the automated checks get it wrong
- Getting the hidden thought to sound like her
- Shipping with features cut
- Reply time and cost
- Changes from Nov 30 to Dec 3, 2026
- How the work is split
- What version 1 does not do
01A bot that only posts reactions
In the Discord servers I spend time in, people often answer each other with a reaction image, a GIF, or a short video and no words. Priestess is built around that habit. She reads the chat and replies with one piece of media.
The character is Priestess from Arknights, who treats every member as the Doctor, the game's player character. A friend who runs a Discord server of 500+ members asked for her. I took it on to learn agent engineering on something people would use live, beyond a standard RAG (retrieval-augmented generation) project that looks up text.
I wanted her to feel like a mute Neuro-sama, the AI streamer. Posting only media helps. Members never see the text behind a post, so they read it generously. My friend made the same point on Oct 5, 2026: her posts often look better than the thoughts behind them.
From planning to launch
- Jun 8, 2026
Planning starts
The first planning docs were written inside the Mayling Bot project.
- Jul 3, 2026
Engine repository starts
The project gets its own repositories and is built as two separate services.
- Aug 26, 2026
First full reply
67.7 s from message to reply on a private test server, with 27.8 s of that in the engine.
- Sep 25, 2026
Caption rewrite
Offline bad picks fall from ~26% to ~9% on 82 held-out picks.
- Nov 8, 2026
Live launch
Four months and five days after the engine repository started.
02The one-day plan did not survive a week
I told my friend I could build this in one day by handing the whole job to Claude Code. One day did get a prototype that replied, and the replies were bad. After about a week I knew better, and the running joke became that Priestess had been waiting since July.
The first design tried having the model name a feeling with each thought, and the feeling selected a group of images. That hardened into a rigid state machine. She also kept coming back as "amused", so most of the library was never reached.
I dropped the hard feeling filter on Jul 30, 2026. The next day the thought itself became the search query, which was the idea I had started with.
03One reply, start to finish
The runtime is two services. A TypeScript Discord bot runs on Fly.io. A Python engine built with the Google Agent Development Kit (ADK) runs on Google Cloud Platform (GCP) Agent Runtime, with PostgreSQL, Cloudflare R2, and BigQuery behind it.
- DiscordA member's message
- Scrub
- Read media
- Prompt injectionSensitive topicsUser distress
- Thought
- Message plus thoughtVector searchCard descriptionsVector search"Her side" lines
- 20 candidatesPick, fit checkClaude Sonnet 5.5Pick, fit checkGemini 3.8 FlashWhen both picks pass and differGemini 3.8 Flash judge20 candidatesPick, fit checkDeepSeek V4.1 Flash
- PostOne piece of media
- Scrub
- Personal data (PII) is redacted before any model call.
- Read media
- Images and attachments in the message are read so the safety checks can see them.
- Safety checks
- Three checks run in parallel: prompt injection, sensitive topics, and user distress.
- Thought
- The engine writes a private in-character thought and reply line. Members never see them.
- Search
- The message plus the thought is the query for two vector searches over 183 media cards. Rank fusion keeps 20 candidates.
- Pick and check
- A picker chooses a card, and a vision fit check looks at the actual image or video frames.
- Post
- The bot uploads the chosen file from Cloudflare R2. No text is posted.
When a safety check trips, the turn ends silently, with no typing indicator and no reply. If the engine call itself fails, the bot posts one plain line: "I couldn't find any media for that."
The distress check runs on Gemini 3.8 Flash. The other two checks run on Gemini 3.5 Flash-Lite.
Blocking a turn for distress happens here, in the safety checks at the start. During the overnight experiment runs described below, an agent kept pushing distress blocking into later steps. I had the check moved to the start so the picker has one job.
04Searching with a thought
The search query is the hidden thought plus the cleaned message. The thought carries her reaction, and the message keeps the names the thought might drop.
A reply line carries little signal. "how are you doing" says almost nothing about which image fits. The thought behind it might be "you think you are smart, but I will be polite", and a search can match that. The idea is close to HyDE (hypothetical document embeddings), a technique I first saw in an agent course: search with a made-up answer, because it sits closer to the stored text than the question does.
Each card has a full description and four short "her side" lines, which are things she could be saying by posting it. Two in-memory numpy searches score the query against both, using gemini-embedding-2 vectors stored in PostgreSQL. Reciprocal rank fusion merges the two lists into 20 candidates. The last 10 media items posted in the channel are excluded so she does not repeat herself.
As of Dec 4, 2026 the library holds 189 approved cards. 6 are held back, which leaves 183 she can pick from.
Both searches are vector similarity. A keyword-title variant was tested on Sep 25, 2026 and dropped because it did not help.
05Two pickers and a judge, or one cheaper picker
The engine has two picking modes, and I can switch between them at runtime.
Dual-model mode
Claude Sonnet 5.5 and Gemini 3.8 Flash each pick from the 20 candidates in parallel, and each pick gets a vision fit check. When both picks pass and differ, a Gemini 3.8 Flash judge picks the better match.
Single-picker mode
DeepSeek V4.1 Flash writes the thought, picks, runs the fit check, and captions inbound images. Embeddings, safety checks, and unprompted-reply checks stay on Gemini.
In both modes a rejected pick gets another try, and the picker can widen from 20 cards to about 45 when its first tries fail.
Dual-model mode is live as of Dec 4, 2026. I have switched the mode 6 times since launch, each time to trade cost against reply time, to act on a read of reply quality, or to test a release.
06Rewriting captions cut offline bad picks from ~26% to ~9%
Offline, a replay harness runs saved conversations through an old and a new version of the pipeline. A separate model labels each pick good, ok, or bad without knowing which version made it. Each pick gets three labels and the majority wins. Every experiment froze its test set and its pass rule before it ran.
Coding agents ran 75+ of these experiments between September and November 2026, mostly overnight, and I checked samples in the morning.
Early replays kept picking badly even when a good card was in the library. I spent that period on the ranker, the prompts, and steering the runs. Some morning reports recommended giving up on an approach, and I sent them back. One run proposed banning the cards that kept being labelled bad, which does not explain why the search returned them.
The captions were the problem: many described the media vaguely or wrongly. The example I remember is a card described as an upset woman when the file showed her laughing hysterically. Badly described cards were taking slots among the 20 candidates that good cards needed.
Fixing captions is tedious, and I had put it off because the card format was still changing and hand-written text risked being thrown away. I also assumed the answer could not be that simple, and that was a mistake.
On Sep 25, 2026, vision models inspected the actual frames and rewrote 116 of 165 searchable descriptions. Bad picks fell from ~26% to ~9% on 82 held-out picks (41 held-out conversations, each run twice).
| Measure | Target | Best result |
|---|---|---|
| Bad picks | At most 5% | 7.3% |
| Good picks | At least 80% | 53.7% |
A later change on a harder test set (Oct 2, 2026) cut bad picks from 50 to 35 of 360. Good picks did not rise in a meaningful way.
Neither target has been met. These are offline numbers. Live turns are not scored, so I have no measured live pick quality.
The card text live today came from a later vision-model redraft, followed by 173 human edits across 67 cards between Oct 8 and Nov 6, 2026, plus 2 more edits and 1 restore on Nov 22. Most were made by another admin of the server in a web card editor that re-embeds a card when it is saved.
07Where the automated checks get it wrong
The fit check and the AI labellers both misread deadpan jokes and visual gags. These three cases are on record from offline runs.
A member asks her to remember their favourite character
Card: two girls in a cutscene, one turning with a smirk and a hand on her hip. Three AI labellers voted bad, ok, bad. I read it as a fitting tease. (Sep 26, 2026, a real test-channel message, paraphrased.)
"rate his dinner out of 10. the dinner is dry buldak and regret"
Card: a game item icon showing a large 0/9. The fit check rejected it as unrelated game material. Blind labels were 4 of 6 good and 2 ok. (Sep 27, 2026, a synthetic test message.)
A deadpan request to bring a shovel
Card: the caption "time to do chores" over a game attack animation. The fit check rejected it. Blind labels were 3 of 3 good. (Sep 27, 2026, a synthetic test message.)
In the second and third cases the verdict that the card fits comes from blind AI labels, and my own reading agrees. My one formal labelling round, on Oct 1, 2026, matched the AI labels on all 58 cards, so I accepted the AI labels after that.
08Getting the hidden thought to sound like her
The thought drives the search, so its tone shapes both character and retrieval. In testing, flat, polite thoughts retrieved generic reactions. Sharper thoughts improved variety and broke the character.
On Oct 4 and 5, 2026 my friend read her hidden thoughts on a private test server and sent notes: she should sound like someone close teasing you, not "a twitter argument". I argued that members never see the thought. The answer was that the aggression showed in the media she picked. My own summary of that version was "a caricature of an angry Twitter user".
I first asked an agent to rewrite the prompts so she sounded like Priestess. Her thoughts went flat again and the search lost its variety. So I edited the thought prompts by hand in a local workbench that replays a saved conversation through two prompt versions.
A fine-tuned model would probably hold a character better. I ruled it out for version 1 because the design was still changing and each change would have meant another training run. With prompts alone her tone settles into one register, so each turn draws one of six personality leans at random (gremlin, flirt/charmer, hype, roaster, soft, flustered). A "Tease, don't dunk" rule was added on Oct 25, 2026.
After the edits my friend said she sounded like Priestess. I have no measured live improvement from the voice work. Offline, an earlier framing fix on Sep 27, 2026 had cut stiff narrator-style thoughts from 43% to 0% in blind labels.
The workbench also has a scoring view, because asking the picker to explain its choice had produced invented reasons. After a pick is logged, a separate scoring job asks a model to score every candidate from 0 to 100. It runs on test turns only and never changes a pick.
09Shipping with features cut
Ready meant the list my friend wrote of what Priestess needed before release. Two items were cut to ship on Nov 8, 2026: a real memory system, and "chaos events" in which she would interfere with Mayling Bot. I wanted to learn whether people liked her before spending more months on features.
From watching the channel (unmeasured): members first treated her as one more AI chat bot, then her replies to direct pings surprised people. Interest dipped, and her unprompted replies brought it back, though some members find those annoying.
10Reply time and cost
Measured from the member's message to the pick being saved, about 1 to 2 s before the engine finishes. The Discord upload is not included.
The original goal was a reply in under 30 seconds. On this measure, which stops before the Discord upload, dual-model mode is under 30 s at the median and over it at p90. I stopped treating the goal as a requirement. For scale, the first full reply on Aug 26, 2026 took 67.7 s.
Gemini calls are hedged to cut slow tails. If the first request has not answered after 5 s for the thought, or 8 s for media-stage calls, a second copy goes out and the first answer wins.
Model spend for the thought and picker calls averaged $0.0147 per turn in single-picker mode (820 live turns, Nov 8 to 30, 2026). In dual-model mode it was about $0.0442 per turn before the Dec 2 caching release (468 turns, Nov 8 to 25, 2026). That figure includes estimated spend on hedged calls that lost the race, and the logged spend alone was $0.0418. Gemini 3.8 Flash is on introductory pricing until Dec 31, 2026, and its price doubles on Jan 1, 2027.
11Changes from Nov 30 to Dec 3, 2026
She also replies unprompted when a conversation invites it. On Nov 30, 2026, after an audit of live telemetry and offline replays for that path, I had an extra routing model removed from it. That simplified the stack, cut latency, and lowered cost.
A release on Dec 2, 2026 added prompt caching to the thought and picker calls. On Dec 3 I switched the live bot back to dual-model mode to test it.
12How the work is split
I decide the design, the pass rule for each change, and the safety priorities. Coding agents write the implementation and produce proof from the running system (replay evals, live traces, and check results), so review centers on the plan and verification artifacts rather than manual line-by-line code review.
As of Dec 4, 2026 the engine repository has 1,993 test functions across 179 files, and the bot repository has 34 test files. Both suites run on my machine before each release.
A release goes to staging first, in phases. The same archive is then promoted to the live runtime byte for byte. Each phase needs a written review and an independent reviewer's sign-off. I give the final go on feature releases, and my standing rules cover narrow fixes when I am away.
13What version 1 does not do
- It has no long-term memory. Each message opens a new session. She sees the last 15 channel messages and the last 10 media items posted in the channel, and nothing about a member beyond that.
- It has no live quality score. Every quality number in this post is offline.
- Single-picker mode is cheaper and slower than dual-model mode, and the quality difference between them is not measured.