All posts

"A production AI stack in Python: FastAPI and LangGraph patterns that hold up"

Python AI codebases have a characteristic way of rotting: dicts passed between functions, prompts inlined in loops, and a while-loop agent nobody can explain. The fix isn't more discipline — it's structure. Here is the FastAPI and LangGraph stack I run in production, with a public repo you can read.

AI engineering4 min read17 August 2026by Ahmed
"A production AI stack in Python: FastAPI and LangGraph patterns that hold up"

There's a specific way Python AI codebases go bad, and if you've inherited one you'll recognise it immediately: dictionaries passed between functions with keys nobody documented, prompts built by string concatenation inside a while loop, and an "agent" that works most of the time for reasons nobody on the team can fully explain. Python's flexibility makes it the fastest language for AI experiments and, left unchecked, the fastest to produce an unmaintainable AI system.

Have an AI feature stuck between demo and production?

The gap — reliability, evals, cost control, the plumbing that keeps it running unattended — is exactly the work I do. If that sounds familiar, a short conversation is usually enough to point you the right way.

Book a free consultation

© 2026 Ahmed Fareed. All rights reserved.

LOADING