Why Senior Engineers Are Ditching LangChain for Plain Python


While everyone rushes to adopt the latest AI agent frameworks, the most successful AI companies are doing the opposite. They’re writing plain Python. No LangChain. No complex abstractions. Just clean, maintainable code that actually works.

The Framework Trap

Anthropic recently shared something revealing: most successful AI companies don’t use frameworks for their agents. This isn’t just theoretical advice. Octomind, after 12 months of using LangChain in production, made the decision to drop it entirely. The result? Simpler code that costs less to run.

The problem with frameworks isn’t that they don’t work. It’s that they’re costly abstractions that obscure what’s actually happening. They teach you the wrong mental model of how AI agents really work. When something breaks in production, you’re debugging layers of abstraction instead of understanding the core mechanics.

What You’re Really Building

Here’s what catches most engineers off guard: LLMs don’t execute anything. They output text. That’s it. When you build an AI agent, you’re not giving the LLM access to your calendar API or your database. You’re writing Python code that interprets the LLM’s text output and decides whether to execute those actions.

The “agentic loop” everyone talks about is just a for loop. Your Python code calls the LLM. The LLM suggests tools to use, formatted as JSON. Your Python code validates those suggestions, executes the appropriate functions, and passes the results back. That’s the entire pattern.

When you use tool calling, the LLM outputs structured parameters for functions you’ve defined. It doesn’t call those functions. Your code does. You validate the inputs, handle errors, and control what actually executes. This distinction matters when you’re responsible for production systems.

The Phase Approach

Building agents without frameworks means thinking in phases. First, let the LLM analyze the input and select relevant tools. Second, execute those tools in your Python code with proper validation. Third, have the LLM generate a summary of what happened.

This phase approach gives you control points. You can inspect what tools the LLM wants to use before executing them. You can implement rate limiting, access controls, and error handling at the Python level. You can test each phase independently. Try doing that cleanly when everything’s wrapped in framework abstractions.

The video demonstrates this with a transcript processing application that creates calendar invites, decision records, or incident reports based on meeting transcripts. Multiple tool calls in a single response. Validation at every step. Clear separation between what the LLM suggests and what your code executes.

Why Python Skills Matter More

If you’re good at Python, you can write much safer AI applications than if you rely on frameworks. You understand exactly where data flows. You control error handling. You can implement proper tool integration patterns without fighting a framework’s opinions.

Frameworks abstract away understanding. They make simple things look complex and complex things look magical. Neither helps you build reliable systems. When you write plain Python, you’re forced to understand the actual mechanics. That understanding makes you better at designing production-ready AI applications.

The Real Cost

The cost of frameworks isn’t just runtime performance or vendor lock-in. It’s the mental overhead of learning someone else’s abstractions instead of understanding the fundamentals. It’s the debugging sessions where you’re reading framework source code instead of fixing your actual problem. It’s the rewrites when the framework’s opinions no longer match your requirements.

Through implementing dozens of AI agents, the pattern becomes clear: the simpler your foundation, the easier everything else becomes. A for loop, some JSON parsing, proper error handling, and clear separation of concerns beats any framework’s magic.

Want to see exactly how to build AI agents with plain Python? Watch the full implementation walkthrough where I break down the agentic loop, tool calling mechanics, and phase-based approach with working code examples.

Watch: Building AI Agents Without Frameworks

Ready to build production-grade AI systems with other senior engineers? Join our community where we share real implementation patterns and production lessons.

Zen van Riel - Senior AI Engineer

Zen van Riel - Senior AI Engineer

Senior AI Engineer & Teacher

As an expert in Artificial Intelligence, specializing in LLMs, I love to teach others AI engineering best practices. With real experience in the field working at big tech, I aim to teach you how to be successful with AI from concept to production. My blog posts are generated from my own video content on YouTube.

Blog last updated