How A.L.E.X. works (and why it's built this way)
The full walkthrough of PIR's helper: how a question travels, the safety rules that run before any AI, where the knowledge comes from, the helpdesks, the web desk, privacy, hosting and costs, and the helpers around her.
TL;DR: A.L.E.X. answers only from PIR®'s own published pages and shows where every answer came from. Crisis and dosing messages are caught by plain, predictable rules before any AI runs. She keeps no chat logs, turns committee requests into private threads with tracked tickets, and costs PIR® nothing to run today.
A.L.E.X. (Astral Logic Endpoint eXpander, she/they) is the helper in PIR®’s Discord and on the web. She runs on Alexandrina, a small, open engine named for the great Library of Alexandria. Each section below opens on its own, so read what you’re curious about. 🌌 Updated October 9, 2026.
Meet A.L.E.X. and Alexandrina
- A.L.E.X. is PIR®’s helper: a warm, plain-spoken presence who answers questions with sources and opens helpdesk tickets. Her motto: a lantern, not the path. She never gives dosing, medical or legal advice and isn’t a crisis line.
- Alexandrina is the engine underneath: Astral Logic Endpoint eXpander: Automated Neural Distributed Resource Inferring Nexus Architecture (11 words, 11 letters). It’s built so any community can have its own “library”: PIR® is the first, and A.L.E.X. is PIR®’s librarian.
- One engine, many libraries. A new community is a folder of settings (its name, its pages, its crisis text, its desks), not a new program. That keeps the code small enough to read in an afternoon and test on every change.
- Her own window: Alexandrina, including the Oracle for anyone lost on the site.
The life of a question, step by step
- You ask. Type
/askin Discord, tap Ask A.L.E.X. in the 🗨️ask-alex channel, or (soon) just type in that channel. - Safety gate. Before anything else, the message is checked against plain rules for crisis language and for dosing or sourcing questions. If either matches, the answer is fixed text, and no AI ever sees the message (see Safety before AI).
- Search. The question is matched against PIR®’s indexed passages two ways at once: by keywords (a classic search ranking called BM25) and, when available, by meaning (embeddings). The two ranked lists are blended with a method called reciprocal rank fusion, so a passage that both methods like rises to the top.
- Confidence check. If nothing matches well enough, A.L.E.X. says so and offers the closest pages and a ticket, rather than guessing.
- Write. The best passages and the question (never your name or ID) go to a language model with strict instructions: answer only from these passages, cite them by number, stay short and kind.
- Cite. Citations are cleaned up and turned into links to the exact pages used, so you can read the source yourself.
- Reply. In Discord the answer is private to you when you use the chat panel. Tap 👍 / 👎 to say how it did.
A typical answer takes a few seconds; the free models used during the pilot can take up to about fifteen.
Safety before AI
- Crisis first. Words and phrases that suggest someone may be in danger trigger PIR®’s crisis resources right away, copied verbatim from PIR®’s Crisis Resources page (988 in the US, Crisis Text Line, Fireside Project, Samaritans in the UK and more). No AI is involved, so nothing can go wrong in the wording, and it’s instant.
- Dosing and sourcing. Questions about doses, combinations or getting substances get a kind, fixed reply that points to PIR®’s Safety & Ethics page.
- Medical and legal questions are steered to qualified professionals.
- Tested every time. An automated test suite checks that crisis messages always route to resources (100%), that refusals hold, and that private committee material can never appear in a public answer. Nothing ships if they fail.
- In the helpdesks too. If a ticket or web-desk message contains crisis language, the person sees crisis resources immediately instead of a “ticket opened” message.
Where the knowledge comes from
- PIR®’s two websites, archived as readable Markdown on GitHub (the
wordpress-crawlsarchive): every page of psychedelicsinrecovery.org and the service site. - Published literature: the 12 Steps, 12 Traditions, Preamble, Guiding Principles, Safety Guidelines, Integration and a Plan of Action, the FAQ and meeting scripts, from the Literature Committee’s public library.
- The helpdesk how-to guides.
- All of it is split into a few hundred short passages and indexed. A reindex automation rebuilds the index when the sources change.
- What’s never included: unpublished committee manuscripts, private repositories, members’ messages, and anything not already public on PIR®’s sites.
The writers: language models with a fallback chain
- During the pilot, answers are written by open models hosted by NVIDIA on their free tier. Claude Haiku (Anthropic) can be switched on with one setting if the Tech Committee approves a small monthly budget.
- Models are tried in order, each with a time limit. If one is slow or retired, the next takes over.
- If every model fails, A.L.E.X. says so plainly and shows the most relevant pages and a ticket button, so there’s never a made-up answer.
- Lesson learned: free models can be retired without warning. A health page reports which models are active, and a monthly reminder checks for retirements.
The helpdesks: tickets that never get lost
| Desk | For | Ticket IDs |
|---|---|---|
/techcom |
Websites, email, forms, Zoom, calendar | TECH-12 |
/litcom |
Literature requests, corrections, ideas | LIT-12 |
/github |
PIR®’s GitHub repos, Pages and access | GH-12 |
/pr |
Social media, press, brand, De Vine News | PR-12 |
/mod |
Talking to the moderators privately | (Discord only) |
- A short form asks for a subject, details and (optionally) urgency.
- A private thread opens that only you and that committee can see, and the committee is pinged.
- Problems and requests become a GitHub Issue; ideas become a GitHub Discussion, in private desk repositories.
- Committee members press Claim → In progress → Resolved; the labels on GitHub follow automatically.
- Resolved threads are archived; a Reopen button brings them back.
/ticket TECH-12shows status any time. - You’re recorded only as a scrambled tag (a one-way hash), never your Discord ID.
- Volunteering uses the same path: the Serve buttons in 🛠service-opportunities open a desk form prefilled with “I’d like to serve”, so every offer of help reaches a real person.
The 🗨️ask-alex chat and conversation mode
- The chat panel (pinned in 🗨️ask-alex) works with buttons and forms: Ask A.L.E.X., Ask a follow-up (she remembers your last question inside the private message itself, not in a database), and Turn into a ticket, which suggests the right desk and fills in the form for you.
- Conversation mode lets members simply type in 🗨️ask-alex; A.L.E.X. replies in a thread. This is the one place she reads messages, and only in that channel and its threads. It runs on a tiny always-on server, because Discord needs a live connection for typed messages. Nothing is stored, and the privacy policy names this exception.
- Gentle rate limits keep it calm for everyone.
The web helpdesk (no Discord needed)
- At the web desk, anyone can open and follow a ticket.
- Password-free sign-in: you enter your email and get a one-time link that works once, for 15 minutes. No password ever exists to leak, and there’s no account to create.
- Your email address is never stored. Tickets are matched to you by a scrambled tag of your address, the same way Discord tickets use a tag instead of an ID.
- Sign-in emails come from PIR®’s own helpdesk@ mailbox, with a backup sender if it’s ever down. Replies to that email reach a human.
- Committee replies on GitHub show up under My tickets, and your replies go back to the committee’s thread.
Privacy by design
| Kept | Never kept |
|---|---|
| Tickets you choose to open (subject, details, status) in private repositories | Your questions to /ask or the chat panel |
| A scrambled tag linking you to your tickets | Your Discord ID, email address or chat history |
| Counts and timings for health checks (no message text) | Anything from channels other than #ask-alex |
Full details, in plain language: the privacy notice.
Where it runs, what it costs, who owns it
- Vercel (free tier) handles Discord commands, buttons and the web desk.
- GitHub (free) hosts the pages, the tickets and the automations.
- A Google Cloud e2-micro server (free tier) keeps the conversation-mode connection open. Its public internet address costs about $3.65 a month once the trial credit ends in early 2027; a member covers it, and it’s recorded on PIR®’s ledger.
- Accounts belong to PIR®, more than one trusted servant can reach them, and every step is written down, so A.L.E.X. never depends on one person. She can be paused instantly and switched off completely without losing any ticket.
- More: Sustainability.
The helpers around A.L.E.X.
PIR®’s Discord has a small cast, each with a name, a voice and one job:
- ☄️ C.A.T.A.L.Y.S.T. (Collaborative Agents Tending And Lifting Your Service Together): the Tech Committee’s behind-the-scenes helpers (🌿 Alfred, 🌵 Cosmos, ☕ Littlebird) who post announcements, keep channel descriptions tidy and send reminders. They never read members’ messages.
- 🧚 C.A.R.L. (roles), 🛡️ D.Y.N.O. (spam safety), 🗓️ S.E.S.H. (events), 🧵 H.Y.P.H.A. (keeps threads alive) and 🎨 V.I.S.I.O.N. (art).
- Real bots show Discord’s APP badge and never DM you first asking for anything. The full cast: Personas.
Design choices and lessons learned
- Commands and forms first, chat-reading last. Most of A.L.E.X. uses Discord’s “interactions” model: she only receives what you type into her own commands and forms. Reading messages is limited to #ask-alex.
- Built in the open, in PIR®’s own organization. Private working repositories publish filtered public copies automatically, by an allowlist, so private material can’t slip out.
- Firecrawl Alexandria isn’t our database. It’s a catalog of outside data sources; PIR®’s knowledge lives in its own small index. Alexandria may later power a clearly labeled research feature.
- Least privilege. Each app gets only the permissions its job needs, and powerful ones are granted temporarily.
- A person’s edit always wins. Automations that update channel descriptions never overwrite something a person changed by hand.
- Secrets never travel through chat or code. Diagnostics can say “this key works” without ever showing it.
What's next, and how to help
- Next up: conversation mode going live, a private-group request desk, living status boards, a cached FAQ for instant answers, and links that jump straight to the quoted sentence. Later: a testnet Web3 desk preview.
- The full plan: Roadmap.
- Help build it: no coding needed. Tap Serve with TechCom in PIR®’s Discord, or open a
/techcomticket.