惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google Online Security Blog
Google Online Security Blog
D
Docker
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
L
LangChain Blog
月光博客
月光博客
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Recent Announcements
Recent Announcements
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
D
DataBreaches.Net
T
Tailwind CSS Blog
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
B
Blog
G
Google Developers Blog
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
C
Check Point Blog
V
V2EX
爱范儿
爱范儿
Microsoft Azure Blog
Microsoft Azure Blog
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
罗磊的独立博客
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
量子位
博客园 - 司徒正美
博客园 - 叶小钗

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Building Scrollbook: What I Learned Building and Scaling an AI Game Master Platform as a Solo Engineer
Dusty Mumphr · 2026-05-15 · via DEV Community

Most AI demos look impressive when 5 people are using them.

Things get very different when hundreds of people are simultaneously asking your system to:

  • maintain long-running conversational memory
  • coordinate shared game state across multiple players
  • handle real-time Discord interactions
  • retrieve contextual campaign knowledge
  • stream AI responses quickly enough to feel conversational
  • and do all of it without your API bill exploding

Over the last year, I built Scrollbook, an AI-powered tabletop RPG platform designed to act as a persistent AI Game Master inside Discord.

At its peak, Scrollbook organically grew to 867 Discord servers and more than 1,000 active users.

I built the entire system solo.

And eventually, I had to shut it down.

Not because the product failed.

Because the infrastructure and model costs became unsustainable for me to continue operating alone.

That experience completely changed how I think about AI systems engineering.

The hardest part was never prompting Claude.

The hardest part was orchestration.

The Architecture

At a high level, Scrollbook combined:

  • a Discord bot for real-time gameplay
  • a FastAPI backend
  • shared business logic used by both the API and bot
  • PostgreSQL + pgvector for persistent state and semantic retrieval
  • Redis for streaming and event coordination
  • multiple Next.js frontends
  • AWS infrastructure running on ECS Fargate

The bot, API, and frontends all shared a common service layer and repository architecture.

I also recorded a deeper code and architecture walkthrough here for anyone interested in the implementation details:

One thing I learned very quickly:

Naive AI architectures collapse under state complexity.

A normal SaaS app can usually treat requests as isolated events.

AI-driven multiplayer systems cannot.

The Real Problem: Stateful AI

Players do not interact with tabletop games like normal chatbot users.

A single campaign can contain:

  • recurring NPCs
  • evolving world state
  • session history
  • player-specific memory
  • custom rules
  • hidden DM information
  • faction relationships
  • long-running narrative arcs

The AI needs enough context to feel intelligent, but not so much context that:

  1. latency becomes unusable
  2. token costs become catastrophic
  3. responses drift or hallucinate

Very quickly, I stopped thinking like “an LLM app developer” and started thinking more like a distributed systems engineer.

One important architectural decision was that every Discord channel maintained its own shared conversation session.

All players inside that channel contributed to the same narrative thread and campaign memory. Sessions automatically expired after a configurable amount of time and rotated into fresh sessions to prevent runaway context growth.

Conceptually, that sounds simple.

Operationally, it changed everything.

Multiplayer AI Systems Need Real Isolation Boundaries

One subtle but important problem was multiplayer privacy and campaign isolation.

Players could privately DM Cypher outside the public campaign channel.

That immediately created a security and orchestration problem:
the AI should not accidentally:

  • expose hidden campaign information
  • mutate another player’s character
  • leak private narrative details
  • access tools that should only exist in shared sessions

So private DM sessions operated under restricted tool availability.

The API boundary itself enforced:

  • campaign isolation
  • character ownership
  • session scoping
  • allowed mutation operations

Every Discord server effectively acted as an isolated tenant with its own:

  • conversation state
  • campaign memory
  • active narrative context
  • AI session lifecycle

Without those boundaries, the system quickly stopped feeling like a multiplayer tabletop experience and started feeling like a chaotic shared chatbot.

Why the Shared Service Layer Became Critical

One of the best decisions I made early was centralizing business logic into a shared Python library used by both the Discord bot and REST API.

The architecture looked roughly like this:

  • Discord bot receives slash commands
  • API serves frontend requests
  • both call shared services/repositories
  • repositories manage PostgreSQL access
  • services orchestrate AI context building

This let me keep:

  • campaign state consistent
  • rules engines centralized
  • AI orchestration reusable
  • validation logic unified

Without that shared layer, I would have ended up maintaining two separate versions of the product logic.

The AI Only Knows the World Model You Give It

Before every AI interaction, Scrollbook built a structured context object containing:

  • campaign setting and tone
  • current quests
  • active NPCs
  • encounter state
  • party information
  • previously discovered locations
  • the player’s full character sheet
  • inventory, spells, equipment, and HP

All of that was assembled into a typed Pydantic model called AIContext.

That model effectively became the AI’s world model.

One lesson I learned quickly:

LLMs behave much more predictably when they operate against strongly structured context boundaries instead of giant unstructured prompts.

AI Reliability Required Explicit Behavioral Protocols

One thing I underestimated early was how unreliable LLMs become when they are allowed to improvise state mutations.

For example:

When a player drinks a healing potion, the AI cannot simply narrate:

“You regain 10 HP.”

It must:

  1. remove the potion from inventory
  2. wait for database confirmation
  3. update character HP
  4. confirm the mutation succeeded
  5. only then narrate the result

I eventually encoded explicit multi-step behavioral protocols directly into the system prompt.

The prompt literally instructed Claude to:

  • never narrate mutations before tool confirmation
  • wait for successful tool execution
  • sequence actions deterministically
  • avoid leaking private player information
  • respect campaign boundaries

This dramatically improved reliability.

One of the more surprising lessons was that LLMs become far more dependable when treated less like chatbots and more like orchestration engines operating against constrained system contracts.

The “AI Features” Were Actually Infrastructure Problems

The interesting engineering problems were never:

“How do I call Claude?”

They were:

  • how do I avoid context duplication?
  • how do I partition campaign memory?
  • how do I maintain low latency during concurrent interactions?
  • how do I isolate Discord guild data safely?
  • how do I prevent race conditions during combat/session updates?
  • how do I make async orchestration debuggable?

The platform became heavily async very quickly.

Both the Discord bot and API were built around async execution because synchronous request handling would bottleneck almost immediately under concurrent usage.

The AI Was Writing Its Own Knowledge Graph

One of the most interesting systems in Scrollbook ran after the AI responded.

After every generated narrative response, I ran a second AI pass that extracted structured game events from the text:

  • new NPCs introduced
  • quests formed
  • locations discovered
  • faction relationships
  • important campaign events

Only events above a confidence threshold were persisted.

The result was that campaigns gradually built their own structured knowledge graph automatically while players interacted with the world.

Players never needed to manually maintain campaign state, update quest logs, or organize notes.

The AI handled the operational bookkeeping behind the scenes.

Cost Optimization Became Existential

This was ultimately the part that forced me to sunset the platform.

Long-running multiplayer AI systems generate enormous amounts of context.

And AI costs compound frighteningly fast when users expect conversational responsiveness.

At one point I reduced Claude API costs by roughly 90% through aggressive prompt caching and context deduplication strategies.

The biggest gains came from:

  • caching stable system prompts
  • partitioning static vs dynamic context
  • reducing repeated narrative payloads
  • loading only relevant campaign state
  • aggressively trimming conversational history

Even with those optimizations, the economics were still difficult as a solo operator.

That experience forced me to think much more seriously about sustainable AI infrastructure design.

The Production Reality

The production issues ended up being far more educational than the initial implementation.

A few examples:

  • malformed AI responses breaking downstream parsing
  • Discord interaction timing limits
  • async race conditions during simultaneous campaign updates
  • runaway token growth from recursive context loading
  • queue spikes from high-traffic servers
  • retry storms during partial provider failures
  • embedding retrieval returning semantically correct but narratively terrible results

One thing I underestimated was how much operational maturity AI products require once real users show up.

The “prompt engineering” phase ends very quickly.

After that, it becomes:

  • observability
  • retries
  • orchestration
  • failure isolation
  • caching
  • cost control
  • schema discipline
  • defensive engineering
  • and building systems that fail gracefully

What I’d Do Differently

I’m currently rebuilding Scrollbook with many of these lessons in mind.

The platform is now slowly coming back online through a gated public waitlist while I continue refining the architecture and cost model.

If I rebuilt the original system from scratch today, I would:

  • introduce stricter event-driven boundaries earlier
  • formalize observability sooner
  • reduce coupling between orchestration and retrieval layers
  • implement structured AI output contracts from day one
  • invest earlier in replay/debug tooling for AI workflows

I would also spend less time chasing “perfect AI behavior” and more time designing systems that fail gracefully.

Because production AI systems fail constantly.

The goal is not perfection.

The goal is controlled failure.

Final Thoughts

Building Scrollbook fundamentally changed the way I think about AI systems engineering.

The LLM is rarely the hard part.

The hard part is everything around it:

  • state management
  • orchestration
  • memory systems
  • concurrency
  • operational reliability
  • retrieval quality
  • multiplayer isolation
  • and keeping the whole thing economically viable

That’s where the real engineering starts.

Tech Stack

Python, FastAPI, PostgreSQL, pgvector, Redis, Next.js, TypeScript, AWS ECS Fargate, Bedrock, Anthropic Claude, Docker, SQLAlchemy, Discord.py