This book teaches backend engineering from the first terminal command to production AI systems. You will build one evolving product with Python, FastAPI, PostgreSQL, and carefully chosen Redis, then add retrieval, tools, agents, evaluation, security, observability, deployment, and recovery. No previous programming or backend knowledge is assumed.
By the final capstone, you will be able to:
An AI-native backend treats uncertain model behavior as a normal systems concern. Prompts, schemas, retrieval, tool permissions, evaluation datasets, token budgets, and human approvals are versioned parts of the product—not mysterious strings hidden inside route handlers.
The model never owns the architecture. Application code owns permissions, data, state transitions, timeouts, budgets, and audit records. The model proposes structured decisions inside those boundaries.
SupportDesk AI is a multi-tenant support platform. Its first version has one health endpoint. Its final version can ingest approved knowledge, retrieve tenant-scoped evidence, draft cited responses, call bounded tools with approval, stream progress, recover from failures, and prove its quality through evaluations.
The same vocabulary stays with you:
Follow the chapters in order through the first capstone. Type every command instead of pasting blindly. After each exercise, explain what changed, how you verified it, and how you would undo it. If your explanation is unclear, repeat the smallest experiment.
Use this learning loop:
Start with the book map, then use these tracks:
Do not skip chapters because their tools look familiar. The production sections focus on boundaries and failure behavior, not syntax.
PostgreSQL is the source of truth for users, permissions, tickets, approvals, and audit history. Redis is optional infrastructure for short-lived cache entries, quotas, rate limits, coordination, streams, and job queues. If losing the value would corrupt the business, it does not belong only in Redis.
Decision rule: Start with FastAPI and PostgreSQL. Add Redis only when a measured requirement needs shared, expiring, low-latency state.
Use AI to shorten feedback loops, not to replace understanding. Give it the current file, contract, constraints, and required tests. Ask it to explain risks and alternatives. Review every dependency, command, migration, permission, and failure path before running code.
Never paste secrets, private customer data, production logs, or proprietary code into a model without authorization. Generated code is a hypothesis until types, tests, security review, and runtime evidence verify it.
Reading is not completion. A chapter is complete when you can produce the artifact, run the verification, pass the exercise acceptance criteria, answer the knowledge check without looking, and explain one tradeoff to another person.
Create a private learning log:
Write a one-paragraph product boundary for SupportDesk AI. Include its users, durable business records, one AI capability, one action the AI must never perform without approval, and one measurable success signal.
Acceptance criteria: another person can identify the system of record, the AI boundary, and the human decision from your paragraph.