Lesson 72 — Beginner

Agent Frameworks & Libraries

Primitives (loop, tools, memory, budgets) tumhe aate hain — ab frameworks wahi kaam abstraction ke saath karte hain. Is lesson mein dekhenge graph-style orchestration, Google ADK, CrewAI ki crews aur Flows, Microsoft Agent Framework ki Agents-Teams-Workflows, OpenAI Agents SDK ke handoffs — aur ek comparison frame jisse tum architecture se chuno, popularity se nahi.

⏱ 20 min• Beginner• Agent Reliability, UX & Failure Recovery

Framework landscape — kya karta hai kaun

WHAT

Har framework tumhare agent loop ko ek shape deta hai — graph, crew, ya plain objects. Andar wahi cheezein hoti hain jo tumne likhi hain: model calls, tools, state, control. Farak abstraction level aur control ka hai.

WHEN

Tab jab dhanda badha ho — persistence, team patterns, tracing, deployment ab khud likhna mehnga pad raha ho. Prototype ke liye tumhara own loop bhi kaafi hai.

WHERE

Production agent services, multi-agent products, teams jinke paas framework-level debugging/eval tooling chahiye — aur job interviews mein "framework experience" ke sawaal.

Ek nazar mein: graph runtime (LangGraph jaisa) explicit control deta hai; role-based multi-agent (CrewAI jaisa) teams ke patterns; lightweight SDK (OpenAI Agents SDK jaisa) code-first loop; aur full-stack frameworks (ADK, Microsoft Agent Framework) build-deploy ka poora paket.

Yaad rakho: Framework ke neeche wala layer hamesha wahi hai jo tumne L5.2 mein likha tha. Isliye primitives pehle seekho — phir framework sirf syntax aur tooling lagta hai, jaadu nahi.

Graph orchestration aur Google ADK

framework          | abstractions jo milti hain
-------------------+-------------------------------------------------
graph runtime       | StateGraph, edges, checkpointer, interrupt, resume
Google ADK          | agents, sessions, tools, multi-agent, A2A deploy
CrewAI              | crews (roles), Flows (structured control)
MS Agent Framework  | agents, teams, workflows + production runtime
Agents SDK (OpenAI) | agent, handoffs, sessions, guardrails, tracing

sabke neeche: wahi decide -> act -> observe loop jo tumhe aata hai
Debug habit: Framework mein kaam karta dekhna kaafi nahi — state/logs khol kar verify karo ki wahi raasta gaya jo tumne socha. Pehle plain loop se samjha hua hona isi kaam aata hai.

CrewAI crews/Flows aur Microsoft Agent Framework

Yehi do philosophies hain — autonomy dena (crew) vs path pehle se likhna (graph). Bade products mein dono milte hain: workflow level deterministic, uske andar ek agent crew jo explore karti hai.

Trap: Role-based crew ko "reliable control" samajhna. Backstory se behavior guide hota hai, guarantee nahi — guarantees tumhare validators, budgets aur gates dete hain.

Code-first agents — handoffs ka style

from agents import Agent, Runner

billing = Agent(name="Billing",
                instructions="Sirf billing sawaal handle karo.",
                tools=[lookup_invoice])
support = Agent(name="Support",
                instructions="Sirf technical issues handle karo.",
                tools=[run_diagnostic])

triage = Agent(name="Triage",
               instructions="Sawaal classify karo, phir sahi specialist ko handoff kar do.",
               handoffs=[billing, support])

result = Runner.run(triage, "Mera invoice dobara chahiye")
# yehi philosophy: minimal objects, control flow code mein, handoff ek property

Kaise chunein — comparison dimensions

dimension              | dekhna kya hai
-----------------------+--------------------------------------------------
abstraction level      | kitna tumhara code chhupa hai (kam = zyada control)
control over execution | explicit branches/milestones milte hain ya nahi
state / persistence    | checkpointer, sessions, resume support
multi-agent support    | handoffs, crews, teams, supervisor graphs
tool integrations      | pehle se bane connectors, retry semantics
MCP / A2A support      | standards se kitna juda hai
debugging/observability| traces, state inspector, replay, eval hooks
deployment             | service banane mein kitna kaam
vendor/model flexibility| koi bhi model lag sakta hai ya lock-in
Decision rule: Ek hafta: chhota same agent do shapes mein banao (own loop vs chosen framework). Jo cheez framework ne chhupa di wohi tumhe dekhni hai — abstraction ki keemat yahin samajh aati hai.

Exercise

Question: Explicit graph-style orchestration ke liye course mein kaunsa framework pada? (naam)

Question: Role-based crews aur Flows kis framework ki pehchaan hain? (naam)

Question: Handoffs, guardrails aur tracing wala lightweight code-first SDK kiska hai? (do shabd)

Question: Agents, Teams aur Workflows ke teeno concepts kis framework mein hain? (do shabd)

Common mistakes

Desi example: Har raaste ke liye alag sawari

Cycle (own loop) chhote raaste tez, metro (graph) fixed track aur timing ke saath, cab (SDK) direct door tak, tour bus (crew) group ke saath — sawari situation se chunta hai, fashion se nahi:

text
chhota loop, seedha flow   -> lightweight SDK / own loop
branches, resume, HITL     -> graph runtime (LangGraph)
team ke roles, exploration -> crews / teams
poora build + deploy paket -> ADK / MS Agent Framework
Interview angle — yahan se sawaal aate hain
  • Q: Framework chunte waqt paanch dimensions batao — aur ek ke liye apna threshold bhi.
  • Q: Graph framework aur lightweight SDK ka farak control flow ke angle se samjhao.
  • Q: Role-based multi-agent (crew) kis type ke kaam suit karta hai — aur kahan nahi?
  • Q: "Framework sirf LLM call wrap karta hai" — ADK/Microsoft wale frameworks isse kya extra karte hain?
Lesson complete?

Frameworks ka landscape clear. Ab capstone mein ek production-style agent banayenge jisme level ke saare ideas — loop, tools, MCP, memory, budgets, sandbox, HITL — ek saath honge.

Popular courses: Data Science Course in Lucknow · AI Course in Lucknow · Python Course in Lucknow · Power BI Course · Data Analytics Course