Marty

AI chatbot for Dungeon Books. Recommends books and chats with customers via SMS and Discord.

Full docs in marty/docs/ and marty/README.md.

Character

Martinus Trismegistus — immortal wizard, former software engineer, burnt-out tech worker who now works at the bookstore. Lowercase, casual texting style (u, ur, bc, tbh). 1–3 sentences per message. Confident recommendations without overselling.

Architecture

SMS (Sinch) → FastAPI → Claude API → response
Discord      →            ↕
                    Hardcover API (book data)
                    PostgreSQL (conversations, customers)
                    Redis (rate limiting, caching)

Key Integrations

ServicePurpose
Claude APIConversation and recommendation engine
Hardcover APIBook search and metadata (GraphQL)
SinchSMS sending/receiving via webhooks
Discord.pyDiscord bot with thread management
Bookshop.orgAffiliate links for recommended books

Status

Core infrastructure complete. SMS fully functional. Discord bot implemented, needs token setup for production.

Future: Square API integration for in-chat purchases, analytics.

Dev Commands

just dev          # Dev server with hot reload
just test         # Run tests
just test-all     # Full integration tests (Docker)
just chat         # Interactive chat testing