Everyone Talks About Picking the Right Model. The Real Work Is Everything Else.

The tutorials lie to you. Not maliciously. They just stop at the part that looks clean and skip everything that actually takes months. They show you the API call. They show you the response. They do not show you the six weeks you spend debugging why your data pipeline returns stale results, or why your agent forgets everything the moment the session ends, or why the third-party API you planned your entire architecture around quietly rate-limits you into uselessness.

One developer built an AI agent from scratch, spent 18 months in the trenches, and wrote down the five things nobody told him upfront. Here’s what he found.

The Model Is the Last Thing You Should Worry About

Most people spend weeks debating GPT-4 vs Claude vs Gemini. They read benchmarks. They run evals on toy problems. Then they start building and discover that data tooling is 80% of the actual work. Not prompting. Not model selection. Getting clean, fast, correct data into the model. Most projects underestimate this by 10x.

Think about what “clean data” actually means in practice. It means handling encoding errors, timeouts, pagination, schema changes that happen without warning, and sources that return subtly wrong results without throwing an error. It means building retry logic, validation layers, and fallback paths. A model that gets bad data will produce bad outputs no matter how capable it is. You can swap in a better model and get the same garbage out, just with more confidence.

Old way: pick the best model, wire it up, ship it.
New way: fix the data pipeline first. The model is the easy part.

🔧 The Five Lessons (In Order of How Much They’ll Surprise You)

  • Data tooling is 80% of the work. Clean, reliable data beats a fancier model every time. Budget months for this, not days. This means proper caching, normalization, deduplication, and monitoring for when sources change format on you. A well-fed average model consistently outperforms a brilliant model choking on dirty inputs.
  • Memory is harder than reasoning. 🧠 Models look brilliant for one session. After that? Total amnesia. Persistent context across sessions changes the agent completely. Without it, you’re building a demo, not a product. You need to decide what gets stored, how it gets indexed, and how the agent retrieves relevant context without blowing through its context window. Vector databases help, but they introduce their own complexity around embeddings, chunking strategies, and retrieval tuning.
  • Browser automation beats APIs you don’t have. Half the data you actually need has no public API. A browser controlled by your agent unlocks more than another integration ever will. This is not a workaround. It is a legitimate architectural choice. When the alternative is waiting for a vendor to build an API that may never come, a headless browser gives you access today.
  • Local-first is a constraint, not an aesthetic. 🔐 Your agent needs your real sessions, real keys, real preferences. Cloud-only solutions force you to upload secrets you shouldn’t be uploading. Beyond security, local-first means lower latency, offline capability, and the ability to integrate with tools that simply cannot expose an external endpoint.
  • Composable beats monolithic. Ten small components that each do one thing well beats one framework that promises everything. When one piece breaks, the rest keep working. More importantly, composable systems let you swap out pieces as better options emerge without rebuilding from scratch. The agent ecosystem is moving fast. Locking into a monolith means you pay the migration tax every time the landscape shifts.

How to Apply This Before You Write a Single Line of Agent Code

  1. Map your data sources first. Where does the data live? Is it clean? How fast can you pull it? Write this down before you write code. If you cannot answer these questions concretely, the architecture you build will be wrong and you will know it three months in.
  2. Design your memory architecture on day one. Not as an afterthought. The agent behaves completely differently with and without persistent context. Decide early whether you need short-term session memory, long-term user memory, or both. Each has different storage and retrieval requirements.
  3. Check whether public APIs exist for what you need. If they don’t, budget time for browser automation. Factor in the maintenance cost too. Scrapers break when UIs change, so build monitoring that alerts you when a source goes silent.
  4. Keep secrets local from the start. Design around this constraint, not against it six months in. Retrofitting a local credential store into a cloud-first architecture is painful. Starting local and selectively moving things to the cloud is manageable.
  5. Build small, composable pieces. Resist the one-framework-to-rule-them-all instinct. Resilience comes from modularity. Each component should be testable in isolation, replaceable without cascading changes, and small enough that you fully understand what it does.

These lessons took 18 months to learn. You just read them in three minutes.

The question is whether you’ll actually believe them before you run into each one yourself. Most people won’t. They’ll spend the first six months on model selection and prompt engineering, hit the data wall, and then circle back to this list with a different kind of attention. If you’re reading this before you start building, you have a real head start. Use it. Drop the lesson you’d add in the comments.

5 things I learned building my own AI agent that nobody tells you upfront.
by u/LeRaviole in PromptEngineering

Scroll to Top