← Projects
LiveRailway · SQLite on a persistent volume · APScheduler

Saint Companion

Daily prayer companion that speaks in the actual voice of St. Josemaría Escrivá and St. Ignatius of Loyola.

PythonTelegram Bot APIClaude Sonnet + HaikuSQLite + FTS5
Public Domain
— The Way, 1

The problem

Generic devotionals are forgettable and generic chatbots have no spiritual voice. There's nothing out there that actually sounds like a specific saint, that cites real passages from their own work, and that remembers what a particular person has been wrestling with over the past month. Prayer apps are mostly content libraries, and chat-with-Jesus apps tend to read as the same upbeat coach in a different costume.

The solution

Saint Companion is a multi-user Telegram bot that delivers three daily touchpoints — morning, midday and evening — in the authentic voice of either St. Josemaría Escrivá or St. Ignatius of Loyola, with a faithful citation discipline running underneath. Each conversation draws on 4,842 indexed passages from five of Escrivá's books, with a 30-day per-user cooldown so the same line never lands twice in the same month. When the bot quotes something real, it cites the book and point number; when it offers general teaching, it frames the line as "I would say..." rather than pretending to have a footnote. A nightly fact-extraction pass quietly builds a per-user memory so the next morning's opening line isn't just generic.

Features

  • Pick a saint to walk with — St. Josemaría or St. Ignatius
  • Three daily touchpoints (morning, midday, evening) delivered in the user's local time
  • Real citations from real books — book name and point number on every quoted line
  • 30-day per-user passage cooldown so the same line never repeats inside a month
  • Per-user memory built quietly from a nightly fact-extraction pass
  • Curated public-domain artwork paired with messages, never repeated for the same user
  • Allow-listed access with a hard cap of 10 users

Architecture

  • Sonnet powers the deeper conversation; Haiku handles the morning and midday opens, the fact extraction, and the RAG theme extraction
  • FTS5 indexes 4,842 passages across The Way, Furrow, The Forge, Friends of God, and Christ Is Passing By
  • Retrieval pipeline: Haiku extracts spiritual themes from the turn, FTS5 retrieves matching passages, a 30-day per-user cooldown filters out anything that's already landed, and five passages get injected per turn
  • APScheduler runs per-user cron jobs with per-user timezones so morning prayer arrives at the right local time
  • An ALLOWED_CHAT_IDS allowlist is enforced at the decorator level with a hard cap of 10 users
  • Token budget of 200K per user per day; actual cost lands around $0.35 per user per day in normal use
  • Thirty curated public-domain artworks pair with messages, with per-user tracking to keep the same image from repeating