spinny:~/writing $ vim agentic-ai-frameworks-comparison.md
1~2AI agents এখন research demos থেকে production systems-এ চলে এসেছে। 2026 সালের মধ্যে 60%-এর বেশি enterprise AI applications-এ agentic components অন্তর্ভুক্ত হবে বলে আশা করা হচ্ছে। কিন্তু scratch থেকে agents তৈরি করা - tool loops, state, memory, error handling, এবং multi-agent coordination পরিচালনা করা - জটিল। এখানেই frameworks কাজে আসে।3~42026 সালে চারটি framework প্রভাবশালী: **LangGraph**, **CrewAI**, **OpenAI Agents SDK**, এবং **Claude Agent SDK**। প্রতিটি একই সমস্যার জন্য মৌলিকভাবে ভিন্ন পদ্ধতি গ্রহণ করে: LLMs-কে reason, plan, tools ব্যবহার, এবং collaborate করার ক্ষমতা দেওয়া।5~6## এক নজরে7~8| দিক | LangGraph | CrewAI | OpenAI Agents SDK | Claude Agent SDK |9|--------|-----------|--------|-------------------|-----------------|10| **নির্মাতা** | LangChain | CrewAI Inc. | OpenAI | Anthropic |11| **Architecture** | Graph-based | Role-based | Handoff-based | Autonomous loop |12| **দর্শন** | সর্বোচ্চ নিয়ন্ত্রণ | Team collaboration | ন্যূনতম abstraction | Agent-কে computer দিন |13| **ভাষা** | Python, TypeScript | Python | Python | Python, TypeScript |14| **Model support** | যেকোনো (OpenAI, Claude, local) | যেকোনো | যেকোনো (নাম সত্ত্বেও) | শুধু Claude |15| **GitHub stars** | ~29k | ~40k | ~21k | ~6k |16| **সেরা** | Complex stateful workflows | Multi-agent specialization | Routing এবং triage | Coding এবং file-heavy tasks |17~18## LangGraph: The Graph Builder19~20LangGraph agent workflows-কে **directed cyclic graphs** হিসেবে model করে। আপনি nodes (functions যা কাজ করে) এবং edges (তাদের মধ্যে transitions, ঐচ্ছিকভাবে conditional) define করেন। State graph-এর মধ্য দিয়ে প্রবাহিত হয় এবং checkpointing-এর মাধ্যমে persist হয়।21~22এটি সবচেয়ে explicit এবং controllable framework - আপনি প্রতিটি step নিজে wire করেন।23~24```mermaid25graph LR26 Start --> Router[Router Node]27 Router -->|needs research| Research[Research Node]28 Router -->|needs code| Code[Code Node]29 Research --> Synthesize[Synthesize Node]30 Code --> Synthesize31 Synthesize --> End32```33~34### মূল ধারণাসমূহ35~36- **StateGraph**: typed state সহ graph definition37- **Nodes**: Python functions যা state transform করে38- **Edges**: nodes-এর মধ্যে connections, conditional হতে পারে39- **Checkpointing**: long-running workflows-এর জন্য built-in persistence40~41### Code Example42~43```python44from langgraph.graph import StateGraph, MessagesState, START, END45from langchain_openai import ChatOpenAI46~47llm = ChatOpenAI(model="gpt-4o")48~49def call_agent(state: MessagesState):50 response = llm.invoke(state["messages"])51 return {"messages": [response]}52~53def should_continue(state: MessagesState):54 last = state["messages"][-1]55 if last.tool_calls:56 return "tools"57 return END58~59def call_tools(state: MessagesState):60 # Execute tool calls and return results61 results = []62 for tool_call in state["messages"][-1].tool_calls:63 result = execute_tool(tool_call)64 results.append(result)65 return {"messages": results}66~67graph = StateGraph(MessagesState)68graph.add_node("agent", call_agent)69graph.add_node("tools", call_tools)70graph.add_edge(START, "agent")71graph.add_conditional_edges("agent", should_continue, {"tools": "tools", END: END})72graph.add_edge("tools", "agent")73~74app = graph.compile()75result = app.invoke({"messages": [{"role": "user", "content": "What's the weather?"}]})76```77~78### শক্তিসমূহ79~80- প্রতিটি step এবং transition-এ সূক্ষ্ম নিয়ন্ত্রণ81- Built-in checkpointing এবং human-in-the-loop82- সম্পূর্ণ TypeScript parity83- যেকোনো LLM provider-এর সাথে কাজ করে84- Conditional branching এবং loops সহ complex workflows-এর জন্য সেরা85~86### দুর্বলতাসমূহ87~88- শেখার curve খাড়া - graph theory concepts বুঝতে হবে89- সাধারণ use cases-এর জন্য verbose - একটি basic agent-এর জন্য অন্যান্য frameworks-এর তুলনায় বেশি boilerplate প্রয়োজন90- LangSmith ছাড়া graph flows debug করা চ্যালেঞ্জিং হতে পারে91~92### মূল্য নির্ধারণ93~94Open-source (MIT)। LangSmith (managed observability platform)-এ production monitoring-এর জন্য paid tiers আছে।95~96## CrewAI: The Team Assembler97~98CrewAI একটি মানবিক রূপক ব্যবহার করে: আপনি বিশেষজ্ঞ agents-এর একটি **crew** তৈরি করেন, প্রতিটির একটি **role**, **goal**, এবং **backstory** থাকে। Agents **tools** ব্যবহার করে **tasks**-এ collaborate করে, একটি **process** (sequential, hierarchical, বা consensual) দ্বারা সমন্বিত।99~100এটিকে একটি team hire করার মতো ভাবুন যেখানে প্রতিটি সদস্যের একটি নির্দিষ্ট job title এবং specialty আছে।101~102```mermaid103graph TD104 Crew[Crew Manager] --> R[Researcher\nRole: Find data\nTools: WebSearch]105 Crew --> W[Writer\nRole: Write content\nTools: FileWrite]106 Crew --> E[Editor\nRole: Review quality\nTools: FileRead]107 R --> Task1[Research Task]108 W --> Task2[Writing Task]109 E --> Task3[Review Task]110 Task1 --> Task2 --> Task3111```112~113### মূল ধারণাসমূহ114~115- **Agent**: role, goal, backstory, এবং tools সহ একটি persona116- **Task**: description, expected output, এবং assigned agent সহ একটি assignment117- **Crew**: একসাথে কাজ করা agents-এর একটি দল118- **Process**: execution strategy (sequential, hierarchical, consensual)119- **Flow**: একাধিক crews সংযুক্ত করার জন্য event-driven orchestration layer120~121### Code Example122~123```python124from crewai import Agent, Task, Crew, Process125~126researcher = Agent(127 role="Senior Research Analyst",128 goal="Find comprehensive data about the given topic",129 backstory="You have 10 years of experience in technology research. "130 "You are thorough and always verify facts from multiple sources.",131 tools=[web_search_tool],132 verbose=True,133)134~135writer = Agent(136 role="Technical Writer",137 goal="Create clear, engaging technical content",138 backstory="You write for a developer audience. "139 "Your articles are practical and include code examples.",140 tools=[file_tool],141 verbose=True,142)143~144research_task = Task(145 description="Research the latest developments in WebAssembly in 2026. "146 "Focus on WASI, Component Model, and production use cases.",147 expected_output="A structured research document with key findings and sources.",148 agent=researcher,149)150~151writing_task = Task(152 description="Write a blog post based on the research. "153 "Include code examples and Mermaid diagrams.",154 expected_output="A complete blog post in Markdown format.",155 agent=writer,156 context=[research_task], # Writer receives researcher's output157)158~159crew = Crew(160 agents=[researcher, writer],161 tasks=[research_task, writing_task],162 process=Process.sequential,163 verbose=True,164)165~166result = crew.kickoff()167print(result.raw)168```169~170### শক্তিসমূহ171~172- স্বজ্ঞাত role-based abstraction - বুঝতে সহজ173- 100+ built-in tool integrations174- Agents জুড়ে shared memory (short-term, long-term, entity)175- সবচেয়ে বড় community (~40k GitHub stars)176- একটি "manager" agent সহ hierarchical process যা delegate এবং validate করে177~178### দুর্বলতাসমূহ179~180- LangGraph-এর তুলনায় কম সূক্ষ্ম নিয়ন্ত্রণ - আপনি roles define করেন, exact execution paths নয়181- Agents দ্বিমত পোষণ করলে hierarchical process অনির্দেশ্য হতে পারে182- Multi-agent conversations debug করা single-agent flows-এর চেয়ে কঠিন183~184### মূল্য নির্ধারণ185~186Open-source core (free)। CrewAI Platform: $99/month (Teams) থেকে $120k/year (Enterprise)। মূল্য live crews এবং monthly executions-এর উপর ভিত্তি করে।187~188## OpenAI Agents SDK: The Router189~190OpenAI Agents SDK (Swarm-এর spiritual successor) **handoffs**-এ মনোযোগ দেয় - agents conversations অন্যান্য specialized agents-এ transfer করে। এটি সবচেয়ে minimal framework: agents, tools, handoffs, এবং guardrails। এটুকুই।191~192```mermaid193graph LR194 User --> Triage[Triage Agent]195 Triage -->|billing question| Billing[Billing Agent]196 Triage -->|refund request| Refund[Refund Agent]197 Triage -->|technical issue| Support[Support Agent]198 Billing --> Response[Response]199 Refund --> Response200 Support --> Response201```202~203### মূল ধারণাসমূহ204~205- **Agent**: model + instructions + tools + handoffs206- **Handoff**: অন্য agent-এ transfer (LLM যে tool call করতে পারে সেভাবে modeled)207- **Guardrail**: agent-এর সাথে parallel-এ চলা input/output validation208- **Runner**: agent loop execute করে209- **Tracing**: সমস্ত LLM calls, tool invocations, এবং handoffs-এর জন্য built-in observability210~211### Code Example212~213```python214from agents import Agent, Runner, handoff, InputGuardrail, GuardrailFunctionOutput215from pydantic import BaseModel216~217class SafetyCheck(BaseModel):218 is_safe: bool219 reason: str220~221async def content_safety(ctx, agent, input_text):222 result = await Runner.run(223 Agent(name="Safety", instructions="Check if input is safe. No PII."),224 input_text,225 context=ctx,226 )227 output = SafetyCheck.model_validate_json(result.final_output)228 return GuardrailFunctionOutput(229 output_info=output, tripwire_triggered=not output.is_safe230 )231~232billing_agent = Agent(233 name="Billing Agent",234 instructions="You handle billing inquiries. Be precise with numbers.",235 tools=[lookup_invoice, process_payment],236)237~238refund_agent = Agent(239 name="Refund Agent",240 instructions="You process refund requests. Always verify the order first.",241 tools=[lookup_order, issue_refund],242)243~244triage_agent = Agent(245 name="Triage Agent",246 instructions="Route the customer to the right specialist. "247 "Ask clarifying questions if needed.",248 handoffs=[billing_agent, refund_agent],249 input_guardrails=[InputGuardrail(guardrail_function=content_safety)],250)251~252result = await Runner.run(triage_agent, "I need a refund for order #4521")253print(result.final_output)254# The triage agent routes to refund_agent, which processes the refund255```256~257### শক্তিসমূহ258~259- Clean handoff pattern - routing/triage workflows-এর জন্য স্বাভাবিক260- Guardrails execution-এর সাথে parallel-এ চলে (fail-fast, blocking নয়)261- Debugging-এর জন্য built-in tracing dashboard262- নাম সত্ত্বেও, non-OpenAI models support করে263- Minimal abstraction - বুঝতে এবং extend করতে সহজ264~265### দুর্বলতাসমূহ266~267- LangGraph-এর তুলনায় কম mature state management268- কোনো built-in persistence বা checkpointing নেই269- Third-party tools-এর ecosystem ছোট270- Handoff-centric design প্রতিটি architecture-এ নাও মানাতে পারে271~272### মূল্য নির্ধারণ273~274Open-source (MIT)। আপনি যে model ব্যবহার করেন তার জন্য per-token পরিশোধ করুন।275~276## Claude Agent SDK: The Developer277~278Claude Agent SDK একটি ভিন্ন পদ্ধতি নেয়: workflows বা roles define করার পরিবর্তে, আপনি agent-কে **tools-এর একটি set দেন এবং task সম্পন্ন করার উপায় বের করতে দেন**। এটি একই autonomous loop ব্যবহার করে যা Claude Code-কে power করে - read, act, verify, iterate।279~280```mermaid281graph TD282 Prompt[User Prompt] --> Loop[Autonomous Agent Loop]283 Loop --> Reason[Reason about next step]284 Reason --> Act[Execute tool]285 Act --> Verify[Check result]286 Verify -->|not done| Loop287 Verify -->|done| Output[Final output]288```289~290### মূল ধারণাসমূহ291~292- **query()**: agent loop শুরু করার main entry point293- **Built-in tools**: Read, Write, Edit, Bash, Glob, Grep, WebSearch, WebFetch294- **MCP-র মাধ্যমে custom tools**: in-process MCP servers হিসেবে tools define করুন295- **Sub-agents**: বিশেষজ্ঞ agents যাদের কাছে parent delegate করতে পারে296- **Sessions**: একাধিক interactions জুড়ে context বজায় রাখুন297~298### Code Example299~300```typescript301import { tool, createSdkMcpServer, query } from "@anthropic-ai/claude-agent-sdk";302import { z } from "zod";303~304const searchDocs = tool(305 "search_docs",306 "Search the internal documentation for relevant information",307 { query: z.string().describe("Search query") },308 async ({ query }) => {309 const results = await vectorStore.similaritySearch(query, 5);310 return {311 content: [{ type: "text", text: results.map(r => r.pageContent).join("\n\n") }],312 };313 }314);315~316const docsServer = createSdkMcpServer({317 name: "docs",318 version: "1.0.0",319 tools: [searchDocs],320});321~322for await (const message of query({323 prompt: "Find how authentication works in our system and write a summary",324 options: {325 mcpServers: { docs: docsServer },326 allowedTools: ["Read", "Glob", "Grep", "mcp__docs__search_docs"],327 },328})) {329 if (message.type === "result" && message.subtype === "success") {330 console.log(message.result);331 }332}333```334~335### শক্তিসমূহ336~337- First-class MCP integration - যেকোনো MCP server ecosystem-এ সংযুক্ত হন338- File operations, terminal, এবং web access-এর জন্য built-in tools339- বড় codebases-এর জন্য automatic context compaction340- Complex tasks-এর জন্য sub-agent parallelism341- Claude Code-এর মতো একই engine - আসল development workflows-এ battle-tested342~343### দুর্বলতাসমূহ344~345- শুধু Claude models - কোনো multi-provider support নেই346- ছোট community সহ নতুন framework347- Python SDK-র জন্যও Node.js runtime প্রয়োজন348- LangGraph-এর তুলনায় কম explicit workflow control349~350### মূল্য নির্ধারণ351~352Open-source। Standard Claude API token rates। Managed Agents (hosted version): token costs ছাড়াও $0.08 per session-hour।353~354## কখন কোনটি বেছে নেবেন355~356```mermaid357graph TD358 Start{What's your priority?}359 Start -->|Full control over workflow| LG[LangGraph]360 Start -->|Multi-agent collaboration| CA[CrewAI]361 Start -->|Routing and triage| OA[OpenAI Agents SDK]362 Start -->|Coding and file automation| CS[Claude Agent SDK]363~364 LG --> LGU[Complex stateful workflows\nConditional branching\nHuman-in-the-loop]365 CA --> CAU[Team of specialized agents\nResearch + writing pipelines\nContent generation]366 OA --> OAU[Customer service routing\nMulti-step handoffs\nInput validation]367 CS --> CSU[Code generation and review\nFile-heavy automation\nMCP tool ecosystem]368```369~370### LangGraph বেছে নিন যদি:371- আপনার workflow-এর প্রতিটি step-এ সুনির্দিষ্ট নিয়ন্ত্রণ প্রয়োজন হয়372- আপনার use case-এ complex conditional logic এবং loops জড়িত373- আপনার built-in persistence এবং human-in-the-loop checkpoints দরকার374- আপনাকে একই workflow-এ একাধিক LLM providers ব্যবহার করতে হবে375~376### CrewAI বেছে নিন যদি:377- আপনি একটি স্বজ্ঞাত, role-based abstraction চান378- আপনার task-এ আলাদা specialties সহ একাধিক agents জড়িত379- আপনার agents-এর collaborate করা এবং পরস্পরকে context pass করা দরকার380- আপনি সবচেয়ে বড় community এবং সবচেয়ে বেশি built-in integrations চান381~382### OpenAI Agents SDK বেছে নিন যদি:383- আপনার প্রাথমিক pattern হল conversations specialists-এর কাছে route করা384- আপনার guardrails দরকার যা parallel-এ input/output validate করে385- আপনি ন্যূনতম boilerplate সহ সবচেয়ে সরল abstraction চান386- Built-in tracing এবং observability গুরুত্বপূর্ণ387~388### Claude Agent SDK বেছে নিন যদি:389- আপনার agents-কে code read, write, এবং execute করতে হবে390- আপনি first-class MCP server integration চান391- আপনার autonomous agents দরকার যা iterate এবং self-correct করে392- আপনি ইতিমধ্যে Claude ব্যবহার করছেন এবং সবচেয়ে গভীর integration চান393~394## আপনি কি Frameworks Combine করতে পারেন?395~396হ্যাঁ। একটি সাধারণ pattern হল orchestration-এর জন্য একটি framework এবং individual agents-এর জন্য আরেকটি:397~398- **LangGraph** সামগ্রিক workflow graph-এর জন্য399- **CrewAI** একটি নির্দিষ্ট node-এর জন্য যেখানে multi-agent collaboration প্রয়োজন400- **Claude Agent SDK** MCP-র মাধ্যমে coding-related sub-tasks-এর জন্য401- **OpenAI Agents SDK** customer-facing triage এবং routing-এর জন্য402~403এই frameworks পারস্পরিকভাবে বিচ্ছিন্ন নয়। আপনার system-এর প্রতিটি অংশের জন্য যা মানানসই তা ব্যবহার করুন।404~405## উপসংহার406~407প্রতিটি framework একটি স্পষ্ট বাজি ধরে:408~409- **LangGraph** control-এর জন্য optimize করে - আপনি প্রতিটি transition ঠিক করেন410- **CrewAI** collaboration-এর জন্য optimize করে - agents একটি team হিসেবে কাজ করে411- **OpenAI Agents SDK** simplicity-র জন্য optimize করে - minimal abstraction, clean handoffs412- **Claude Agent SDK** autonomy-র জন্য optimize করে - tools দিন এবং কাজ করতে দিন413~414সঠিক পছন্দ আপনার workflow, আপনার team, এবং আপনার বিদ্যমান stack-এর উপর নির্ভর করে। যেটি আপনার primary use case-এর সাথে মেলে সেটি বেছে নিন, ভালোভাবে শিখুন, এবং তাদের sweet spot-এ পৌঁছালে অন্যগুলো টেনে আনুন।415~
NORMAL · agentic-ai-frameworks-comparison.md [readonly]415 lines · :q to close