TNS
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
NEW! Try Stackie AI
AI Engineering / Developer tools / Large Language Models

Make the Most of AI Agents: Tips and Tricks for Developers

We talk with several AI agent tool providers and developers to get their take on how AI agents provide new capabilities to developers.
Oct 17th, 2024 1:00pm by
Featued image for: Make the Most of AI Agents: Tips and Tricks for Developers
Image via Unsplash+. 

The arrival of AI agents has provided software developers with a new method of working with AI. We spoke with several AI agent tool providers and developers to get their take on how AI agents provide new capabilities for devs and what to do to get started.

If you’re a bit fuzzy on how AI agents differ from existing LLM-based AI tools, The New Stack contributor Janakiram MSV explains that AI agents are an outgrowth of existing AI platforms and technologies. “An agent is an autonomous software entity that leverages the language processing capabilities of LLMs to perform a wide range of tasks beyond simple text generation and comprehension,” writes Janakiram. “These agents extend the functionality of LLMs by incorporating mechanisms to interact with digital environments, make decisions and execute actions based on the language understanding derived from the LLM.”

“…agents perform the same ‘development loop’ as your typical software engineer.”
– Robert Brennan, co-founder and CEO at All Hands AI

Robert Brennan, co-founder and CEO at All Hands AI, told me that AI agents can offer a powerful set of capabilities for programmers . “[Agents] can hunt through the codebase for the right spot to edit, and they can make multiple edits across many files. Even better, they can then run the code to see if it works properly, google an error message that comes back, add some debug logs, and modify the code until it’s working correctly,” said Brennan. “In other words, agents perform the same ‘development loop’ as your typical software engineer. So they’re capable of tackling entire issues end-to-end, often starting from an existing Jira ticket or bug description.”

Brennan’s colleague and All Hands AI co-founder and chief scientist Graham Neubig has also written an in-depth blog post that does an excellent job explaining the differences between tools like Github Copilot and AI agents, for developers interested in more information on the topic.

Luis Héctor Chávez, the CTO of Replit, echoes the potential of AI agents to serve as virtual programming assistants. “An AI agent is similar to a virtual coworker that can help you build and maintain a project,” said Chávez. “Everything from choosing a good stack for your project, learning about it, creating the basic project structure, starting a basic prototype, iterating, adding features and functionality all the way to publishing to production. And once it’s in production, you can still ask the agent to fix bugs or add more features later down the line.”

Pros and Cons of ‘Rolling Your Own’ AI Agents

While AI agents show promise for development use, everyone I talked to cautioned that the technology is still early. There are pros and cons to approaches to AI agent creation and use, and as the technology is still relatively new, there is lots of room for improvement.

“With a little up-front work, custom agents — ‘microagents’ — can be much more accurate than a generalist agent.”
– Grayson Adkins, senior engineer, P-1 AI

Grayson Adkins, a senior engineer for generative AI at P-1 AI, suggests that developers creating their own AI agents allows for greater customization, observability, and experimentation. Developers get to define an agent’s role, backstory, task, and tools, while also getting the opportunity to “…monitor an agent’s actions and troubleshoot issues.” Adkins also said that because agent best practices haven’t yet been firmly established, developers who build their own agents have more freedom to experiment with new development strategies.

A current drawback for programmers looking to build their own agents is that the creation of what Brennan calls “generalist agents” can be difficult, and this is one of the reasons why Brennan and his colleagues launched a company around it.

“It can be great to extend existing generalist agents to specialize them, giving them guidance about how you or your organization like to work or about how your codebase is organized,” says Brennan. “With a little up-front work, custom agents (what we call ‘microagents’) can be much more accurate than a generalist agent, at least within a particular context.”

Benefits of Creating and Using Dedicated AI Agents

For many developers, using AI agents that have been developed by others might be the preferred route, allowing them to focus on their primary job functions rather than building bespoke AI agents.

“Agents are great at tackling ‘toil’ — all the little annoying tasks that make up a developer’s day-to-day work.”
– Robert Brennan, All Hands AI

Brennan suggests that using AI agents can provide a productivity and efficiency boost for developers who adopt them. “Using an AI agent can be a huge productivity boost,” said Brennan. “Agents are great at tackling ‘toil’ — all the little annoying tasks that make up a developer’s day-to-day work — and this opens up more time for developers to focus on creative problem solving, rather than little chores.”

Yet even for developers who are eager to adopt the use of AI agents to help them with their programming tasks, it’s undeniable that the technology still needs an extended period of development and maturation to reach wider adoption.

“One current disadvantage is that the agent is much better at building for certain languages: Python and JavaScript are much better represented in its training set because they are way more popular,” said Chávez. “And even within those languages, certain stacks are currently easier for the agent to manage: React with components needs bigger context windows than more monolithic applications, for example.”

Tips and Advice for AI Agent Use by Developers

So, if you’re a developer interested in exploring the use of AI agents for development tasks, how can you get started? All of the experts I chatted with provided some tips and advice that most developers should find useful.

“When creating agents, think like a manager delegating tasks.”
– Grayson Adkins, P-1 AI

“Understand that the technology is very new and likely to mislead you or fail,” said Adkins. “Agents are rapidly getting better, but in many cases, they’re still not there. [And] when creating agents, think like a manager delegating tasks. Who should perform a given task? What are the characteristics of that person? What tools will they need to perform it? Who else should help improve the quality of the solution? Clearly define the tasks and responsibilities. Then leverage frameworks like crewAI to model those agents and tasks, while leveraging the framework’s strengths — like built-in tools, task delegation, and error handling.”

Adkins also suggests AI agent early adopters design for fault tolerance. “Refusals, errors, tool failures, timeouts, infinite loops, etc. are common among agentic systems…should consider these when designing,” said Adkins. “For example, try using try-catch blocks and handling errors. Most of the leading agent frameworks now simplify this process.”

Experiment and Experience: Learn Before You Leap

Having a healthy attitude towards exploring AI agents for development use is something all the experts I spoke with encourage. “Start experimenting!” suggests Brennan. “The technology is still early, but it’s going to completely change how software developers work. Understanding how to use agents effectively is going to be a crucial skill for developers going forward.”

“Any limitations that you may see with the current generation of agents might go away in a matter of months or even weeks.”
– Luis Héctor Chávez, CTO of Replit

Chávez agrees. “Odds are that you’ll end up with an application that does 80% of what you want with 20% (or less) effort,” said Chávez. “And AI agents are so new and still evolving, so we’re still discovering the full extent of their capabilities. AI agents are in their very early days. Any limitations that you may see with the current generation of agents might go away in a matter of months or even weeks.”

Embrace the Horseless Carriage

As with the arrival of any new, potentially disruptive technology, developers of all stripes would be wise to heed the timeworn advice about getting up to speed with new technologies rather than avoiding them.

As a colorful aside, developers would be wise to read this 1930 Saturday Evening Post article by Alexander Winton — the impressively mustachioed founder of his namesake Winton Motor Carriage Company, one of the first American manufacturers of automobiles — that outlines the skepticism, ridicule, and resistance he initially faced when producing a horseless carriage.

“You must remember that every invention of this kind which is made adds to the general wealth by introducing a new system of greater economy of force,” wrote Winston. “A great invention which facilitates commerce, enriches a country just as much as the discovery of vast hoards of gold.”

Group Created with Sketch.
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.