AI agents are reshaping industries by automating tasks, enhancing decision-making, and personalizing user experiences. Coding is one of the most popular use cases of AI. It showcases AI's ability to learn quickly and scale effectively due to clear rules, vast data, and fast feedback cycles.
If you’re a startup founder or builder looking to harness AI and build agents in other domains, here are five lessons from coding’s success—each describing how coding benefits, how you can apply it, and an example in various verticals.
Let’s dig in to some of the details – and if you like this post, read more of my takes on technology on my Substack.
![](https://cdn.prod.website-files.com/6398d0a6fb2888fead821258/679298b0276116dab7ad2f58_AD_4nXeH0mPmrwgEN4Hsd0M_OSEzrAM61JWzcvB9Nb661Cr9nLgd9Zc11fxZNFqHeCCM_a8gGI646z9jf0jp-AgKjHWMCvkxIIT34KCGDwrHwKsKs34uCeMZMmbe4ZJC5OvjlVQ9mIpT.jpeg)
1. Embrace Structured Frameworks for Clarity and Efficiency
Software development relies on strict syntax rules and well-defined architectures (e.g., object-oriented patterns, module imports). This structure ensures that errors show up quickly, fostering rapid iteration. The clarity of frameworks—whether it’s a language specification or a coding style guide—allows AI to parse, analyze, and improve code with minimal guesswork.
How to apply this principle:
In any domain, define clear operational frameworks that your AI agents can follow. Standardize inputs, expected outputs, and error-handling protocols so the AI knows exactly how to proceed in each scenario. By removing ambiguity, you let the AI focus on optimizing within known boundaries rather than trying to interpret unclear instructions. Fortunately, LLMs themselves are great at data extraction, understanding unstructured data and pulling out structure from them, and so can be used by one agent to pre-process and structure data for another.
Example:
Imagine a SaaS platform using an AI agent to handle customer support tickets for common issues like password resets and billing queries. The company enforces a strict ticket format input for the agent (it can use another LLM/agent to structure the data into the form that this agent requests): every request must specify issue type, severity level, and relevant user details (like subscription tier) before the AI even attempts a solution. By providing these mandatory inputs—similar to how programming languages require proper syntax—the AI knows exactly what data it’s working with and can respond quickly, suggesting self-service solutions or escalating complex cases to a human. This rigid structure removes ambiguity, enabling faster resolution times and a seamless customer experience.
2. Leverage Comprehensive, Curated Data Repositories
Platforms like GitHub and Stack Overflow are treasure troves of knowledge, storing vast, high-quality repositories enriched with revision histories, issue-tracking notes, and detailed documentation. AI agents learn not just from code samples but also from developer discussions, which explain the why behind each change.
How to apply this principle:
In any field—finance, healthcare, e-commerce—invest in building or acquiring annotated datasets that reveal the rationale behind each decision or data point. The deeper and more contextual your data, the more your AI can learn to generalize and handle edge cases effectively. The data can provide the context behind changes in various successful examples, and be used by the AI on new cases to mimic that reasoning ability.
Example:
A legal tech startup trying to mark up contracts can create a database of annotated contracts, where lawyers explain why certain clauses were included or removed. By incorporating this rationale into the context for the AI agent, either by fine-tuning the LLM or just as examples given to the LLM, the system becomes adept at flagging risky clauses or suggesting stronger alternatives. This is akin to how coding agents learn from developer comments.
If you don’t yet receive Tanay's newsletter in your email inbox, please join the 10,000+ subscribers who do:
Subscribe now
3. Implement Rapid, Iterative Feedback Loops
In programming, the feedback cycle is nearly instantaneous—write code, try to compile it (does it?), run tests (does it do as expected?), and see results. AI coding assistants improve by constantly comparing generated code against test suites and benchmarks. This tight loop accelerates their learning curve.
How to apply this principle:
Seek to replicate rapid feedback cycles in domains where real-world outcomes take time or data is limited. One powerful tactic is simulations: create virtual testing environments where the AI agents can safely experiment with different approaches and collect some sense of are they on the right track prior to hitting the “real world”. This lets you gather performance data quickly, refine models, and then deploy to the real world with more confidence. Another powerful tactic is to use some kind of validation or critiquing agent, which looks over the output prior to it hitting the real world and verifies it to make sure that hallucinations don't exist and basic information is correct.
Example
An AI SDR agent that researches accounts and crafts personalized email can first test its emails on “simulated” audiences that mimic its customer persona to compare different tactics and approaches and pick the best one to actually send to customers. In addition, after the personalized email generation step, it can have a validation step which checks the personalized information in the email and verifies whether it is correct.
4. Develop Multi-Persona Systems for Specialized Expertise
![](https://cdn.prod.website-files.com/6398d0a6fb2888fead821258/679298b0b4a422b13303de37_AD_4nXd9-UkuKiBL9qCXg2JX-S-SCLC_MmjKrC9I-wHxLJ-bWmjOm2qgIfraTY-kDXSfisCn4iq92HGpvMYETJ4FkbIZ_0quGGCKG0YJaOZs8nELUCMAWK4Uo8MCmBSfIAppCkeb6QjEMg.jpeg)
Contemporary coding agents often split tasks among specialized sub-modules: one focuses on code generation, another on debugging, a third on writing documentation. This mirrors how human development teams might have front-end engineers, back-end engineers, and QA testers, each excelling in a narrow scope.
How to apply this principle:
Design your AI with multiple specialized “personas” or agents, each responsible for a specific function or part of the process —data analysis, decision-making, user interaction, etc. These personas communicate and collaborate, much like specialized microservices. By distributing complex tasks among experts, you reduce the cognitive load on any single AI component and create a more resilient, scalable system. Each agent may have access to different tools, different context, expect take in different structured inputs and product different outputs, which can then be passed along to the next one.
Example
Consider a fintech platform automating Know Your Business (KYB) checks. Instead of using a single, one-size-fits-all AI, the system leverages multiple specialized personas. A Document Agent scans incorporation papers and IDs using OCR to confirm authenticity, a Compliance Agent cross-references watchlists and regulatory databases to spot potential sanctions, a Risk Agent analyzes transaction histories for suspicious patterns, and a Decision Agent synthesizes these findings to approve or flag the application. By delegating each task to a focused persona—mirroring the modular structure in software teams—the platform ensures thorough, efficient, and scalable KYB processes.
5. Establish Clear, Trackable Performance Metrics
Developers rely on test pass rates, code coverage, and performance benchmarks as clear signals of success or failure, providing AI agents with measurable goals to iterate and improve their performance. AI agents use these signals to iterate toward better outcomes.
How to apply this principle:
Define clear Key Performance Indicators (KPIs)—accuracy, speed, user satisfaction tailored to your agent’s goals that can be used as forms of evals to assess the agent. Where possible, incorporate A/B testing to measure the impact of different AI-driven strategies, and consistently run evals to compare outputs across time or variations in approach. These tests help you pinpoint what’s working, what isn’t, and how to course-correct, creating a virtuous cycle of improvement.
Example
An AI marketing agent that is generating email campaigns and web copy that trying to drive website and email conversions can generate different versions of emails / website copy and images, run A/B tests given its key KPIs of email open rates, email click throughs, down stream conversions both on simulated audiences and then on live audiences to continuously optimize towards a better status quo.
Conclusion
From strict syntax and curated data to rapid feedback loops, specialized AI personas, and measurable metrics, coding offers a blueprint for building robust AI agents that deliver tangible results. By creating structured frameworks, centralizing rich data, running fast (or simulated) feedback cycles, compartmentalizing your AI’s expertise, and rigorously testing performance, you can adapt these lessons to almost any domain to create better agents.
What additional lessons have you picked up on from building these agents? I’d really love to hear them! Email me at tanay@wing.vc.