AI Agent Frameworks (original) (raw)

Last Updated : 15 Apr, 2026

AI agent frameworks are tools and platforms that help developers build intelligent agents capable of performing tasks autonomously, making decisions and interacting with users or systems. These frameworks simplify the development of agent‑based applications by providing components for reasoning, memory and tool integration.

AI-Agent-Framework

AI Agent Framework

1. LangGraph

LangGraph is a framework used to build advanced AI agents that handle complex, stateful workflows. It uses graph-based execution, enabling step-by-step and branching logic for better control over agent behavior.

**Use Case: Automating support ticket where agent receives input, gathers context and autonomously routes and resolves queries, escalating only when necessary.

Implementation:

This example shows how to build a simple LangGraph workflow using LangChain and an LLM to generate a motivational quote.

!pip install -q langgraph langchain langchain-openai

from langchain_openai import ChatOpenAI from langgraph.graph import StateGraph

def ask_question(state): llm = ChatOpenAI(model="gpt-4o-mini", api_key="your_api_key_here") response = llm.invoke("Give me one motivational quote.") return {"output": response.content}

graph = StateGraph(dict) graph.add_node("ask", ask_question) graph.set_entry_point("ask") graph.set_finish_point("ask")

app = graph.compile() result = app.invoke({}) print(result["output"])

`

**Output:

langgraph

LangGraph Output

2. AutoGen

AutoGen is a Microsoft-backed framework for building multi-agent systems where AI agents collaborate with each other and humans to automate complex tasks through dynamic conversations.

**Use Case: AI agents automatically research and draft a technical report with one gathering data, another summarizing and a human reviewer finalizing the content for accuracy and clarity.

Implementation:

This example shows how to create a simple multi agent interaction using AutoGen with an assistant and a user agent.

!pip install git+https://github.com/microsoft/autogen.git@v0.2.25

from autogen import AssistantAgent, UserProxyAgent import autogen import os os.environ["OPENAI_API_KEY"] = "your_api_key"

config_list = [ { "model": "gpt-3.5-turbo", "api_key": os.environ["OPENAI_API_KEY"], }, ]

assistant = AssistantAgent(name="assistant", llm_config={ "config_list": config_list}) user_proxy = UserProxyAgent(name="user_proxy", human_input_mode="NEVER")

user_proxy.initiate_chat( assistant, message="Say 'Hello, world!' and tell me the meaning of life.", max_turns=2, )

`

**Output:

autogen

AutoGen output

3. CrewAI

CrewAI is an open-source framework for building teams of AI agents that collaborate with defined roles to solve complex, multi-step tasks such as research, content creation and business workflows.

**Use Case: Multi-agent systems for generating, vetting and publishing marketing content one agent drafts, another edits, a third handles distribution.

Implementation:

Let's see a code example to understand better:

!pip install crewai openai litellm import os from crewai import Crew, Agent, Task

os.environ["OPENAI_API_KEY"] = "your_api_key"

assistant = Agent( role="Python Assistant", goal="Print 'Hello, world!' in Python.", backstory="You help users write and run basic Python code.", verbose=True )

philosopher = Agent( role="Philosopher", goal="Share the meaning of life from literature.", backstory="You are inspired by 'The Hitchhiker's Guide to the Galaxy'.", verbose=True )

task1 = Task( description="Print 'Hello, world!' in Python.", agent=assistant, expected_output="Hello, world!" )

task2 = Task( description="Tell me the meaning of life according to popular culture.", agent=philosopher, expected_output="42" )

crew = Crew( agents=[assistant, philosopher], tasks=[task1, task2], verbose=True )

result = crew.kickoff() print(result)

`

**Output:

4. Semantic Kernel

Semantic Kernel is an open-source SDK by Microsoft that integrates large language models into existing applications, enabling structured orchestration of AI, code and external services.

**Use Case: AI automatically summarizes customer feedback, integrates with business tools and alerts human staff for key issues, all in one workflow.

Implementation:

Let's see a code example to understand better:

import os from google.colab import userdata import textwrap import semantic_kernel as sk from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion

os.environ["OPENAI_API_KEY"] = "your_api_key"

def wrap_text(text, width=70): return "\n".join(textwrap.wrap(text, width))

async def main(): kernel = sk.Kernel()

openai_client = OpenAIChatCompletion(
    ai_model_id="gpt-3.5-turbo",
    api_key=os.environ["OPENAI_API_KEY"]
)

kernel.add_service(openai_client)
kernel.select_ai_service(openai_client.service_id)

prompt_text = "Tell me about Semantic Kernel."

result = await kernel.invoke_prompt(prompt_text)

if hasattr(result, "get_response"):
    output_text = result.get_response()
elif hasattr(result, "content"):
    output_text = result.content
else:
    output_text = str(result)

print(wrap_text(output_text))

await main()

`

**Output:

semantic-kernel

Semantic Kernel output

5. LangChain

LangChain is an open source framework that simplifies building applications using large language models by connecting prompts, data, memory and tools into structured workflows.

**Use Case: An AI customer support agent uses LangChain to fetch FAQs from a database, answer user queries with an LLM, log interactions for future context and escalate unresolved issues to a human agent, all in a single automated workflow.

Implementation:

Let's see a code example to understand better,

!pip install -q langchain langchain-openai langchain-community openai

from langchain_openai import ChatOpenAI from langchain.prompts import PromptTemplate from langchain_core.output_parsers import StrOutputParser

llm = ChatOpenAI(model="gpt-4o-mini", temperature=0) prompt = PromptTemplate.from_template("What is a fun fact about {topic}?") chain = prompt | llm | StrOutputParser()

result = chain.invoke({"topic": "cats"}) print(result)

`

**Output:

lang

LangChain output

6. No-Code AI Agent Platforms

No-code and visual AI platforms allow users to build AI agents and workflows using simple drag and drop interfaces, making development faster and accessible without coding.

1. n8n

n8n is a workflow automation tool that combines AI with app integrations using a visual interface.

For its implementation you can refer to n8n project: Automated Email Classifier Project in n8n.

2. Langflow

Langflow is a visual, drag and drop framework for building and testing AI workflows, including multi agent systems and RAG based applications.

Choosing the Right Framework

Choosing-Right-Framework

Choosing Right Framework

**1. Task Complexity

**2. Integration Needs

**3. Customizability and Scalability

**4. Privacy and Data Security