Agent Frameworks
When building AI agents, developers can choose between writing everything in pure code or leveraging emerging frameworks like LangGraph and LlamaIndex Workflows, which offer structure, tooling, and integrations. Each approach has trade-offs—frameworks simplify setup and scalability but can become limiting as agent complexity grows. While our team currently favors code for advanced use cases, we recognize frameworks are improving rapidly and may soon be viable for even the most complex systems.
Choosing an Agent Development Framework
If you’re building an AI agent today, you’re not just choosing a model or defining a use case—you also need to decide how to build it. New frameworks are emerging all the time to help developers go beyond simple RAG flows into more autonomous, multi-step AI systems.
From writing emails to querying databases or analyzing telemetry data, agents are becoming increasingly capable—and complex. That complexity makes framework choice more important than ever. Should you start from scratch? Use a proven structure? Or build around tools you’re already using?
Here are three common approaches:
- Pure Code: Build the entire agent yourself using Python. This gives you maximum flexibility and visibility, but you’ll need to handle everything manually—routing, memory, tool execution, and debugging.
- LangGraph: A graph-based framework built on LangChain that uses nodes, edges, and loops to define agent workflows. It provides a clear structure ideal for collaboration or more complex flows, but it comes with a learning curve and tight coupling to LangChain components.
- LlamaIndex Workflows: A newer, event-driven framework that supports asynchronous execution. It’s lightweight, easier to customize, and works especially well if you’re already using LlamaIndex in your stack.
Comparing Agent Frameworks
Each framework takes a different approach to agent development:
- Pure Code gives you full control and transparency but requires significant effort to maintain structure and manage complexity as your agent grows.
- LangGraph enforces strong architectural patterns, which can be helpful for scaling and team collaboration—but you’ll need to fully adopt its ecosystem to get the most out of it.
- Workflows hit a middle ground: less opinionated than LangGraph, but still structured enough to make building robust agents faster—particularly if you’re already using LlamaIndex tools and data interfaces.
Ultimately, your choice may come down to a few key questions:
- Are you already using LangChain or LlamaIndex in your application?
- Do you prefer flexibility or framework-enforced structure?
- Are you looking to build something brand new, or leverage community-built examples?
Choosing the right framework will set the tone for how you scale, debug, and collaborate on agents going forward.
Benefits and Drawbacks of Agent Frameworks
There are many popular agent frameworks, with new entrants launching every week. This frameworks usually obfuscate some of the more complex aspects of building an agent, including state, routing, and skill descriptions.
Each framework is unique in some way, but comes with similar benefits:
- Ease of set up for basic use cases
- Documented examples – especially true of popular frameworks, it’s often easier to find example projects using a framework than ones using none.
- Connection to existing orchestration libraries – popular orchestration libraries like Langchain and LlamaIndex have their own agent frameworks. If you’re already using one of these libraries, extending to use their agent modules is a natural approach.
The main drawback to using a framework is that, once your agent gets complicated enough, you’ll begin fighting with the framework itself to do what you want.
Should You Use a Framework to Develop your Agent?
Regardless of the framework you use, the additional structure provided by these tools can be extremely helpful especially in building out agent applications. The question of whether using one of these frameworks is beneficial when creating larger, more complicated applications is a bit more interesting.
We have a fairly strong opinion in this area because we’ve built an assistant ourselves. Our assistant uses a complex, multi-layer router architecture with branches and steps that echo some of the abstractions of the current frameworks. We started building our assistant long before most frameworks were stable and it exists at a complexity level beyond anything that we’ve seen built with the current frameworks. We constantly ask ourselves, if we were starting from scratch, would we use the current framework abstractions? Are they up to the task?
The current answer from us is not yet. There is just too much complexity in the overall system that doesn’t lend itself to a Pregel-based architecture. If you squint at our assistant, you can map it to nodes and edges but the software abstraction for us would get in the way. As it stands, our team tends to prefer code over frameworks.
We do however, see the value in the agent framework approaches. Namely it does force an architecture that has some best practices and good tooling. We also do think they are getting better constantly, expanding where they are useful and what you can do with them. It is very likely that our answer may change in the near future as these frameworks improve.
Multi-Agent Frameworks
Multi-agent frameworks provide the infrastructure for developing, deploying, and managing systems where multiple agents interact. These frameworks offer tools and protocols to facilitate communication, coordination, and collaboration among agents. Notable frameworks include:
- CrewAI: A framework built on top of LangGraph that allows developers to build multi-agent automations from scratch, with tools for both coding and no-code environments.
- Autogen: An open-source framework, similar to CrewAI, that allows for individual agents to be defined and structured in different collaborative workflows.
- OpenAI Swarm: An open-source, experimental framework designed for lightweight multi-agent orchestration, supporting seamless handoff of tasks between agents.
Common Agent Collaboration Approaches
Effective collaboration among agents is crucial for achieving complex objectives. Several organizational strategies are commonly employed:
Two-Agent Chat
In this approach, two agents collaborate in a paired conversation, continuously exchanging information and refining their outputs based on each other’s responses. This structure is effective when two specialized areas of expertise need to be integrated dynamically.

- Example: In a legal document review system, one agent specializes in summarizing contracts, while the second agent evaluates legal risks. The summarization agent first condenses the text, then the legal risk agent assesses and highlights potential issues. The two agents iterate on refining the final output based on their combined insights.
- Benefits: Provides a balanced, iterative approach where each agent complements the other. Works well for scenarios requiring deep interaction between two areas of expertise.
- Challenges: Can become inefficient if the agents get stuck in excessive back-and-forth refinements without a clear stopping criterion. Ensuring that each agent contributes meaningful value to the other’s work is crucial.
This setup is particularly useful when one agent’s task directly benefits from iterative refinement by another agent, such as creative writing (idea generation + editing) or code generation (writing + debugging).
Group Chat
In this approach, all agents communicate in a shared environment, exchanging information and coordinating actions collectively. This method is particularly effective when tasks require ongoing collaboration and shared context among agents.
- Example: In a customer support scenario, agents specialized in different areas (e.g., technical issues, billing, product inquiries) operate in a shared “chat room.” A query from a customer is visible to all agents, who can collaborate in real time to resolve complex questions without missing critical details.
- Benefits: High transparency and fluid communication; all agents are aware of the broader context, which helps avoid redundant work.
- Challenges: As the number of agents grows, communication noise can increase, making it harder to maintain focus.
Managed Group Chats
A designated agent acts as a “manager” or coordinator within the group chat. This agent oversees the conversation, directing queries to the most appropriate agents and synthesizing responses. The manager ensures efficiency and avoids redundant efforts.

- Example: In a database chat application, a virtual “manager” agent might coordinate between specialized agents for data querying and analysis. The manager ensures that each agent contributes only when needed and consolidates their inputs into a cohesive response for the user.
- Benefits: Reduces communication noise and enhances coordination. Ensures the right agent handles the right task.
- Challenges: The manager agent becomes a critical component and can introduce a bottleneck if poorly designed.
Sequential
Agents operate in a predefined order, with the output of one agent serving as the input for the next. This ensures a structured flow of information and avoids conflicting actions.

- Example: Consider a social media content system to distribute blogs. The first agent proof reads and edits a supplied blog, and a second agent writes social media copy to promote the piece. Finally, a third agent handles the API calls to publish the resulting piece on different platforms.
- Benefits: Well-suited for workflows where steps must follow a logical progression.
- Challenges: Errors made by an upstream agent can cascade downstream, so ensuring quality control at each step is critical.
Hierarchical
Agents are organized in a tiered structure, with higher-level agents supervising and delegating tasks to subordinate agents. This structure is particularly effective for solving complex, multi-faceted problems requiring different levels of abstraction.

- Example: In an e-commerce personalization system, a top-level “strategy agent” decides the overall marketing approach. It delegates tasks like creating personalized product recommendations, generating discount codes, or crafting marketing copy to specialized lower-level agents.
- Benefits: Allows for clear division of labor and decision-making across different levels of expertise. Higher-level agents can maintain a broad perspective while delegating specialized tasks.
- Challenges: Requires careful coordination to ensure subordinate agents’ outputs align with high-level goals. Miscommunication or misalignment at any level can impact results.
When to Use a Multi-Agent Approach Over a Single-Agent Approach
Choosing between a multi-agent and a single-agent approach depends on the complexity and nature of the task:
- Complexity: Tasks involving multiple facets or requiring diverse expertise benefit from specialized agents handling different components.
- Scalability: Multi-agent systems can distribute workloads, enhancing performance in large-scale applications.
- Adaptability: In dynamic environments, multiple agents can independently adapt to changes, maintaining overall system robustness.
- Redundancy and Reliability: Multiple agents can provide redundancy, increasing fault tolerance and reliability.
Conversely, for straightforward tasks with limited scope, a single-agent approach may suffice, offering simplicity and reduced resource consumption.