In this talk I walked through the process of building a production-ready RAG (Retrieval-Augmented Generation) system from the ground up, using Hexagonal Architecture (also known as Ports and Adapters) to keep the codebase maintainable and testable.
The session covered how to structure AI-powered applications so that the core domain logic remains independent of LLM providers, vector databases, and other infrastructure — making it easy to swap components, write unit tests, and evolve the system over time.
Setting up a new web service can feel overwhelming with all the tooling and best practices to consider. In this article, I’ll walk you through creating a simple FastAPI service from scratch, implementing essential development tools that ensure code quality, reliability, and maintainability from the start. By the end, you’ll have a production-ready setup that includes unit testing, code formatting, type checking, and automated pre-commit hooks.
Before diving into the implementation, let’s understand why each tool in our stack is crucial:
Have you ever started a new job only to discover the codebase is a complete disaster? You’re not alone. This guide will help you navigate through the chaos and emerge with clean, maintainable code.
What Constitutes a Python Disaster? Picture this: It’s your first day at a new job. You’re completely new to the codebase. The previous developer just quit, and your manager drops this bomb: “Production is on fire. Here’s the Git repo.