Comparing AI Agent Frameworks: Simplicity vs Power in LLM Orchestration

Introduction to Agentic AI Frameworks

On day four, we focus on tools and autonomy, beginning with a discussion on Agentic AI frameworks. These frameworks are designed to provide glue code or abstraction layers that simplify interactions with large language models (LLMs). They offer elegant structures for building agentic solutions, allowing developers to concentrate on the business problems they aim to solve.

There are numerous Agentic AI frameworks available, with new ones emerging frequently, making it challenging to keep up with all developments. This lecture aims to orient you within this landscape and demonstrate how the frameworks covered in this course fit into the broader context.

Levels of Complexity in AI Frameworks

Agentic AI frameworks vary in complexity, each with its own advantages and disadvantages. At the simplest level, the bottom of the complexity hierarchy, is the option to use no framework at all.

Using No Framework

Choosing not to use any AI framework means connecting directly to LLMs through their APIs, as demonstrated in the previous lab. This approach orchestrates interactions among LLMs without additional abstraction layers. This week, we will adopt this direct connection approach, specifically using Anthropic's API.

A blog post titled "Building Effective Agents" makes a compelling case for always using no framework and connecting directly to LLMs. The APIs are relatively simple and straightforward, allowing you to see exactly what is happening under the hood and maintain detailed control over prompts. This approach is quite effective, as you will observe this week.

Model Context Protocol (MCP)

Alongside the no-framework approach, there is the Model Context Protocol (MCP), developed by Anthropic, who advocate for no frameworks. MCP is not a framework but an open-source protocol that enables models to connect to data sources and tools in an agreed and established manner. This protocol allows for elegant and simple stitching together of models and their providers without the need for glue code, as long as the protocol is conformed to.

Because MCP is primarily a protocol with minimal associated code, it is grouped alongside the no-framework approach. Anthropic likely prefers this categorization.

Mid-Level Complexity Frameworks

The next level up in complexity includes two frameworks: OpenAI Agents SDK and Crew.

OpenAI Agents SDK

OpenAI Agents SDK is a lightweight, simple, clean, and flexible framework. It is one of my favorites and will be used next week in this course. It is relatively new; during project development, the API changed shortly after initial implementation, which was unexpected. Despite this, it remains a great tool that I look forward to demonstrating.

Crew

Crew has been around longer and is also easy to use and lightweight. It offers a low-code approach, allowing users to assemble agents primarily through configuration, such as YAML files. This makes it somewhat heavier than OpenAI Agents SDK but still accessible.

High-Level Complexity Frameworks

At the top level of complexity are LangGraph, developed by the creators of LangChain, and Autogen from Microsoft. These frameworks are relatively heavyweight compared to the others and have a steeper learning curve, especially LangGraph, which is quite complex.

With increased complexity comes greater power. LangGraph enables building computational graphs composed of agents and their tools. This capability allows for the construction of sophisticated systems but requires commitment to the ecosystem, including its terminology, concepts, and abstractions.

Using these frameworks means your project becomes deeply integrated with their ecosystems, shifting the focus from a general agentic AI project to a LangGraph or Autogen project. This contrasts with OpenAI Agents SDK and Crew, where you still primarily interact with LLMs without being fully embedded in a larger ecosystem.

Summary and Orientation

This overview is intended to orient you for the upcoming weeks. The frameworks we will cover provide a representative understanding of the landscape, focusing on the most popular options. There are many others, and if time permits, additional frameworks may be introduced to broaden your exposure.

Choosing a framework depends on your use case, as different platforms suit different business objectives. Personal preference also plays a significant role, especially regarding how much you want to rely on existing abstractions.

My personal bias favors frameworks that are lightweight, simple, flexible, and stay out of your way. However, I also appreciate the power offered by more complex frameworks like LangGraph and Autogen, with which I have enjoyed working on projects.

This course will expose you to a spectrum of frameworks, equipping you to select the best fit for your work, skill sets, team capabilities, and the business problems you aim to solve.

Key Takeaways

  • Agentic AI frameworks provide abstraction layers to simplify interaction with large language models (LLMs) and focus on business problems.
  • Choosing no framework and connecting directly to LLM APIs offers simplicity and detailed control over prompts.
  • The Model Context Protocol (MCP) by Anthropic is an open-source protocol enabling elegant connections between models, data, and tools without glue code.
  • Frameworks vary in complexity and power, from lightweight options like OpenAI Agents SDK and Crew to more complex ecosystems like LangGraph and Autogen, each suited to different use cases and preferences.