Lesson 01 � Foundation

AI AGENTS:
AUTONOMOUS SYSTEMS JO KHUD SE KAAM KAREIN.

AI agents future hain � autonomous systems jo khud se decisions lete hain, tools use karte hain, aur goals achieve karte hain. Self-driving cars se lekar AI assistants tak, sab agents hain. Pehle samjho yeh hain kya aur kaise kaam karte hain.

? 18 min✓ Beginner✓ No prerequisite

WHY: AI Agents kyun zaroori hain?

Normal programs fixed instructions follow karte hain � "yeh karo, woh karo". Lekin agents khud se sochte hain. Yeh observe karte hain, plan banate hain, aur act karte hain. Imagine karo: aapne bola "mera portfolio optimize karo" � agent khud se market data lega, analysis karega, aur trades execute karega. No human intervention!

AGENT

Autonomous entity jo apne environment mein khud se decisions leta hai. Observe, think, act � yeh cycle tab tak chalta hai jab tak goal na achieve ho jaye.

TOOLS

External capabilities jo agent use kar sakta hai � web search, code execution, API calls, databases. Agent ke haath-pair hain tools.

GOAL

Task objective � agent ko kya achieve karna hai. Clear goal ho toh agent efficient hota hai, goal ho toh confused.

ENVIRONMENT

World context jismein agent kaam karta hai � files, APIs, user inputs, sensors. Agent environment se observe karta hai aur uspar act karta hai.

WHAT: AI Agent kya hai?

AI Agent ek aisi system hai jo:

Mental model: Agent ek intelligent worker hai. Aap usse bolo "kaam kya hai", woh khud figure out karega kaise karna hai � kaunse tools use karne hain, pehle kya karna hai, phir kya. Jaise ek real assistant!

TYPES: AI Agents ke 4 types

AI agents alag-alag tarike se kaam karte hain. Har type apni jagah useful hai:

types
1. Simple Reflex Agent
 ✓ Condition-based: "agar yeh ho, toh woh karo"
 ✓ Example: Thermostat � garmi hai toh AC on, thandi hai toh heater on
 ✓ Simple hai, lekin past yaad nahi rakhta

2. Model-based Agent
 ✓ State track kare � world ka internal model banaye
 ✓ Example: Self-driving car � road, traffic, pedestrians sab track karta hai
 ✓ Past aur present dono yaad rakhta hai

3. Goal-based Agent
 ✓ Goal achieve kare � final destination clear ho
 ✓ Example: GPS navigation � "mujhe jaana hai Point B", agent raasta dhoondta hai
 ✓ Future bhi plan karta hai

4. Utility-based Agent
 ✓ Best outcome dhoonde � sabse zyada benefit wala option choose kare
 ✓ Example: Trading bot � sirf profit nahi, risk-adjusted return maximize kare
 ✓ Multiple goals ka balance rakhta hai
Key insight: Real-world agents kaafi complex hote hain � yeh multiple types ko combine karte hain. Self-driving car model-based hai (environment track karta hai), goal-based hai (destination tak pahunchna), aur utility-based hai (safest aur fastest route choose karta hai).

REAL-WORLD: Aise agents already exist hain

AI agents sirf theory nahi hain � yeh already real world mein kaam kar rahe hain:

comparison
Program vs Agent:

 Normal Program:
 ✓ Fixed instructions follow karta hai
 ? "Input do, output milega"
 ✓ Har step pre-defined hai
 ✓ Example: Calculator � 2+2 always 4

 AI Agent:
 ✓ Khud se decide karta hai kya karna hai
 ? "Goal do, woh figure out karega kaise"
 ✓ Steps dynamically badal sakte hain
 ✓ Example: Chess AI � har move situation ke hisaab se

Try it: Build a Simple Agent

Neeche ek simple agent class banao aur dekho woh kaise kaam karta hai. Tools add karo, task do, aur dekho agent kaise sochta hai aur act karta hai.

Agent BuilderApna khud ka agent banayein
Run Python dabayein

Exercise: Test Your Knowledge

Quick check

"AI Agent aur normal program mein kya fark hai?"

Socho: normal program kya karta hai aur agent kya karta hai✓ Kya agent khud se decide kar sakta hai?

Key Takeaways

Introduction complete?

Ab Agent Architecture par chalo � samjho ki agents ke andar kya hota hai aur kaise design karte hain.