Member-only story
Building Code Agent from scratch using Langgraph
Motivation
Today’s frameworks — like AutoGen, CrewAI, PhiData, Swarm, LangChain, BeeAgent, and many more — provide powerful ways to build AI agents, but they are not the same as code agent frameworks.
Code agents are simple. They use LLMs to craft task-specific code logic that is specifically designed to be the best possible way to express actions and logic for providing answers to user questions dynamically.
Code agents are particularly beneficial for automation tasks requiring flexibility, intelligent decision-making, and adaptability to dynamic environments. However, their suitability should be evaluated based on specific use cases, balancing potential benefits against implementation challenges and limitations.

In comparison, a typical multi-step agent requires the LLM to write an action in text or JSON at each step and then make calls to external tools. Over time, maintaining tool and API parameters in JSON documents becomes increasingly complex when adding or removing them.
The effectiveness of using AI code agents depends on the use case or business workflows. A good example of this approach is smolagents created by Huggingface.