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.
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!
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.
External capabilities jo agent use kar sakta hai � web search, code execution, API calls, databases. Agent ke haath-pair hain tools.
Task objective � agent ko kya achieve karna hai. Clear goal ho toh agent efficient hota hai, goal ho toh confused.
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:
- Khud se decisions le: Har step par human ki zaroorat nahi � woh khud sochta hai ki kya karna hai
- Tools use kare: Web search, calculator, code executor, API calls � jo bhi chahiye woh use karega
- Goals achieve kare: Diya gaya task complete kare bina human ko har detail bataye
TYPES: AI Agents ke 4 types
AI agents alag-alag tarike se kaam karte hain. Har type apni jagah useful hai:
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 haiREAL-WORLD: Aise agents already exist hain
AI agents sirf theory nahi hain � yeh already real world mein kaam kar rahe hain:
- ChatGPT with plugins: Web search, code execution, file operations � plugins add karte hi agent ban jaata hai
- GitHub Copilot: Code likhta hai, suggestions deta hai, bugs fix karta hai � developer ka autonomous assistant
- Self-driving cars: Sensors se environment observe karte hain, AI decisions leta hai, steering/brake pe act karta hai � pure agent loop
- Trading bots: Market data analyze karte hain, predictions banate hain, trades execute karte hain � bina human ke 24/7 kaam
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 seTry 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.
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
- Agents autonomous hain: Yeh khud se decisions lete hain, human ki har step par zaroorat nahi.
- Tools are everything: Agent ka power uske tools mein hai � search, calculate, code, API calls.
- 4 types hain: Simple Reflex (condition), Model-based (state track), Goal-based (goal achieve), Utility-based (best outcome).
- Real-world mein already hain: ChatGPT plugins, Copilot, self-driving cars, trading bots � sab agents hain.
- Program se fark: Program fixed instructions follow karta hai, agent khud se decide karta hai.
Ab Agent Architecture par chalo � samjho ki agents ke andar kya hota hai aur kaise design karte hain.