AI & Automation|16 min read

7 Lessons Learnt Building AI Agents

The past two years have been the most exhilarating β€” and humbling β€” of my career. Building AI agents through this period of jaw-dropping advancement has taught me things no textbook could. Here's what actually works when you're building in the middle of a revolution.

Johan Eriksson

Johan Eriksson

December 2025

Two years ago, I thought I understood what AI could do. I'd built chatbots, implemented machine learning models, and automated plenty of workflows. Then GPT-4 arrived, and everything changed. Suddenly, the theoretical became practical. The "maybe someday" became "let's ship it next week."

Since then, I've been knee-deep in building agentic solutions β€” AI systems that don't just respond to prompts but actually reason, plan, and take action. I've watched capabilities that seemed like science fiction become table stakes. I've seen models go from struggling with basic arithmetic to writing production code, from hallucinating constantly to citing sources with precision. The pace has been relentless, exhilarating, and occasionally terrifying.

We're living through a creative chaos unlike anything our industry has seen. New models drop monthly, each one rewriting what's possible. Frameworks emerge, mature, and get replaced in the span of weeks. Best practices from six months ago are now anti-patterns. In this environment, how do you build AI agents that actually deliver value? After dozens of projects β€” some spectacular successes, some humbling failures β€” here are the seven lessons that have shaped how I approach this work today.

1

The Business Problem Still Comes First

This might seem obvious, but in the gold rush of AI capability, it's the lesson most often forgotten. I've sat in meetings where executives said, "We need an AI agent" with the same tone they'd use to order office supplies. When I ask what problem they're solving, the room goes quiet.

The technology is seductive. When you see an AI agent handle a complex customer inquiry flawlessly, or watch it synthesize information from a dozen sources in seconds, you want to deploy it everywhere. But AI agents without clear business objectives become expensive toys β€” impressive demos that never make it to production, or production systems that nobody actually uses.

The projects that have delivered the most value for our clients started with painful specificity. Not "improve customer service" but "reduce average resolution time for billing inquiries from 8 minutes to under 2 minutes." Not "automate document processing" but "extract these 15 specific fields from supplier invoices with 99% accuracy so our AP team stops doing manual data entry."

When you start with the business problem, you can measure success. You can calculate ROI. You can explain to skeptical stakeholders why this matters. And critically, you can decide when the agent is good enough to deploy versus when you're chasing perfection that doesn't move the needle.

2

Embrace the Chaos, But Build for Stability

Here's the paradox of building AI agents in 2025: the underlying technology changes faster than any software stack in history, yet businesses need systems that work reliably for years. How do you reconcile these realities?

The answer I've found is aggressive abstraction. Every AI agent we build has clean separation between business logic and AI capabilities. The prompts, the model selection, the orchestration patterns β€” all of these are configurable, swappable, upgradeable without touching the core application. When a new model releases that's faster, cheaper, or more capable, we can swap it in without rewriting the entire system.

This isn't just theoretical future-proofing. In the past year alone, we've migrated agents from GPT-4 to GPT-4 Turbo to Claude 4 to GPT-4o to Claude 4.5 Sonnet β€” each time gaining performance, reducing costs, or both. Clients who locked themselves into specific model architectures are now facing expensive rewrites.

But abstraction has limits. You can't abstract away everything β€” at some point, you need to commit to approaches and ship. The art is knowing what to make flexible and what to make stable. User interfaces, data models, and business rules should be stable. Model selection, prompt strategies, and orchestration patterns should be flexible.

3

Trust, But Verify β€” Always

Modern AI models are astonishingly capable. They can reason through complex problems, write elegant code, and synthesize information in ways that genuinely surprise me. But they also make mistakes β€” confidently, convincingly, and sometimes catastrophically.

The mistake I see teams make is treating AI agents like deterministic software. They build systems assuming the agent will always produce correct outputs, then act shocked when it hallucinates a policy that doesn't exist or misinterprets a customer request in an embarrassing way.

Every production AI agent needs verification layers. For customer-facing agents, this might mean confidence scoring and automatic escalation when certainty drops below a threshold. For data processing agents, it might mean validation rules that catch impossible values. For decision-making agents, it might mean human review for high-stakes choices.

The good news is that models have gotten dramatically better at knowing what they don't know. Modern agents can express uncertainty, ask clarifying questions, and decline to act when they're out of their depth. But you have to design for this. Build agents that are rewarded for saying "I'm not sure" rather than penalized for it. The agent that confidently gives wrong answers is far more dangerous than the one that asks for help.

4

Start Narrow, Then Expand

There's a temptation, especially when you see how capable these models are, to build the everything agent β€” a system that can handle any query, perform any task, access any system. I've learned the hard way that this path leads to mediocrity at best and disaster at worst.

The most successful AI agents I've built are specialists. They do one thing exceptionally well. A customer support agent that only handles billing questions can be tuned to perfection β€” it knows every billing scenario, every edge case, every exception to the rules. It can achieve accuracy levels that a generalist agent never could.

This doesn't mean you can't have broad coverage. It means you architect for it differently. Instead of one agent that tries to do everything, you build a network of specialist agents with intelligent routing. The orchestration layer figures out which specialist should handle each request, and escalates to humans when no specialist fits.

There's another benefit to starting narrow: you learn faster. A focused agent deployed to production teaches you more in a week than a comprehensive agent stuck in development limbo for months. Ship something narrow, learn from real usage, expand based on actual demand. The agents that try to boil the ocean rarely make it to shore.

5

Context Is Everything

The difference between an AI agent that impresses in a demo and one that succeeds in production often comes down to context. Not the context window β€” those have gotten huge β€” but the right context. Knowing what information the agent needs, when it needs it, and how to present it.

I worked on a customer service agent that had access to every piece of data about every customer. In theory, this was perfect β€” the agent could reference anything. In practice, it was a disaster. The agent would surface irrelevant historical details, get confused by contradictory information from different time periods, and sometimes violate privacy by referencing data the customer hadn't shared in the current interaction.

The rebuilt version was surgical about context. It retrieved only the information relevant to the current query. It understood temporal relationships β€” recent data matters more than old data. It respected information boundaries β€” just because you can access something doesn't mean you should use it.

Retrieval-augmented generation (RAG) has become standard practice, but RAG done badly is worse than no RAG at all. Invest in your retrieval pipeline. Chunk your documents intelligently. Build relevance scoring that actually reflects what's useful. The agent can only be as good as the context it receives.

6

Human-AI Collaboration Beats Full Automation

There's a narrative in the AI space that the goal is full automation β€” remove humans from the loop entirely. I've found the opposite to be true for most business applications. The best AI agents augment human capabilities rather than replace human judgment.

Consider the spectrum of autonomy. At one end, AI handles everything automatically. At the other, AI just provides recommendations for human decision-making. The sweet spot for most enterprise applications is somewhere in the middle β€” AI handles routine cases autonomously, flags edge cases for review, and learns from human corrections.

This isn't just about risk mitigation, though that matters. It's about building trust. Organizations adopting AI agents need to trust them, and trust is built incrementally. An agent that starts by suggesting actions and graduates to taking actions as it proves reliability will ultimately achieve more autonomy than one that demands full control from day one.

Design your agents with collaboration in mind. Make it easy for humans to review agent decisions. Create feedback mechanisms so human corrections improve future performance. Build dashboards that give transparency into what the agent is doing and why. The goal isn't to hide the AI β€” it's to make it a trusted teammate.

7

Ship Early, Learn Continuously

The companies getting the most value from AI agents aren't the ones with the most sophisticated technology β€” they're the ones who've been in production longest. Every week an agent spends handling real interactions teaches you more than months of development in isolation.

I've seen teams spend six months perfecting an agent before launch, trying to handle every possible scenario. Meanwhile, competitors launched something basic in month one, iterated based on real usage, and by month six had something far more capable because they'd learned from thousands of actual interactions.

This doesn't mean shipping garbage. There's a minimum viable quality for AI agents that's probably higher than for traditional software β€” an agent that gives wrong answers damages trust in ways that are hard to recover from. But within the space of "good enough to not embarrass yourself," launch as soon as possible.

Build robust observability from day one. Log every interaction. Track success metrics. Create feedback loops so you know what's working and what isn't. The data from production usage is gold β€” it tells you exactly where to focus your improvement efforts. Synthetic test cases and staging environments can only take you so far.

Making Sense of the Revolution

We're living through something unprecedented. The capabilities available to us today would have seemed like magic two years ago, and what we'll have in another two years will probably make today's agents look primitive. It's chaotic, it's exciting, and it can be overwhelming.

But here's what I've come to believe: the fundamentals still matter. Start with business problems, not technology solutions. Build for reliability even as capabilities evolve. Maintain healthy skepticism about AI outputs while embracing what AI makes possible. Ship early, learn continuously, and iterate relentlessly.

The opportunities are genuinely enormous. I've seen AI agents transform customer service operations, eliminate soul-crushing manual work, and unlock insights that were impossible to extract before. These aren't future possibilities β€” they're happening right now, in production, delivering real value to real businesses.

The companies that will thrive in this new landscape are the ones building now β€” not waiting for the technology to stabilize (it won't, not for years), not waiting for someone else to figure out best practices (you'll be too late), but diving in, learning by doing, and accumulating the organizational knowledge that only comes from real-world experience. The revolution is here. The question is whether you're participating in it or watching from the sidelines.

Ready to Build Your AI Agent?

We've built AI agents across industries β€” customer service, document processing, data analysis, and more. Let's discuss how intelligent automation could transform your operations.

Let's Talk AI