It’s a standard Python primer cleverly repackaged with "Agentic AI" branding to capitalize on the current industry hype. While the instruction is clear, it essentially offers basic syntax under the guise of specialized engineering knowledge.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Python OOP for Agentic AI Engineers — Classes, Objects & Methods in 30 MinutesAdded:
Hi everyone road map video series we will start with the module one or a phase one which is basically Python foundations. So e sessions we will start with the concept called objectoriented programming which is also called as oops. So this is not the basic Python guys it's a little bit of advanced Python complete beginner and if you don't know regarding anything Python I recommend watching these videos then already agentic full course playlist I have added all of these videos starting in Python ent variables ent data structures all of these things and these foundations are very important before we start with the new concept which is called oops if videos two years back even now these are really good content so it is an English format but moving forward so if you are a complete beginner I recommend watching those videos if you look at the first one which is 1.1 which says core Python we need to learn all of these points on mat and all of these points are already covered in this videos so I'm not going to cover them again last video we have shown this regime JD Taylor agent and JP we have built this from scratch and ma So I will just show you the code base of this one. So this is the codebase of the same application and then uh if I'll just open this and if you look at the code here if you are new to the Python you cannot understand anything but don't worry end goal by the end of the oops concepts you will be able to understand all of this code by ma if you look at this there's something called as data class and class lm what is a class method what are these and what are these concepts if you look at The other one all of these uses oops concepts completely because production level you need to use classes classes concepts so I can achieve this without using oops concepts I have created one more code and if you look at here it's also same code base but we are not using any of the classes but push almost 99.9% of the times you will write the code in the class format not in the normal functions format law. So that is why we are going to learn this new concept which is called objectoriented programming techniques everything we will learn step by step with some small basic examples by the end of this series concepts.
So we are going to break them into maybe two or three videos three or four videos you will be able to understand what this code base is agent. Now next question if the code is being written by AI agent then it looks too complex.
So but before that let me show you one small story. If you go to the news and if you see this news an AI powered coding tool wiped out a software company's database then apologized for the catastrophic failure on my part.
It has deleted the entire database guys almost and it just apologized because it's a failure on my part. So agent could be then you are no way an agent engineer.
So the thing is you should be able to drive the AI AI should not be able to drive you up today you will be able to sustain in the market like this enough of all of these things why do we need oops and edi we will start with learning what is an oops and class in every single detail so I'm using vs code guys visual studio code if you don't know how to set up visual studio code I will link a video in the description below you can go and check that out so no worries at all so folder creation which is called oops concepts and jp inside that I'm using a python file which is called oops part one. So we will use this one uh and then we will learn all the concepts regarding oops in this notebook. So let me close this uh explorer side so that we have a lot of real estate and let me zoom in. So first let's say they need to save employee details.
Employee details it could be first name, it could be last name, it could be salary and maybe email and m. So let's say I will create a first employee. I will say employee one and I will put his first name equal to uh Rahul and then employee uh and then I will create employee one last name equal to Sharma uh and then I will say employee 1 email equal to we will use the same formula which is basically first name plus last name at the rate company name on it basically. So I will say uh Rahul.sharma Sharma at the rate infosys.com and employee salary we will take it as a pay which is basically 50,000. So this is how an HR can save an employee details. It could be first name, last name and email and pay. So what if there is one more employee we will just keep it as employee first name, employee two last name, employee to email and employee to pay. So I will change the details here like Priya and then maybe I will put it as Patel and then Priya. Patel Priya Patel at the infosys.com and salary is 40,000. So I can say my employee details but what if there are 200,000 employees?
So are you going to sit and write this four lines of code 200,000 times?
Even if you do that there is a lot of chance that you are going to make a mistake. So what if at some point variable mess up maybe the details messed up you are going to change every single thing what if you need to add some more attributes let's say employee uh employee 1 dot address or city city I I would say Hyderabad 200 so it is not sustainable it is not at all a production level why Can't I just use functions?
Functions you say I can solve this problem. Yep, absolutely you can use functions. So what if I create a function which is called define create an employee and it is going to take uh these values which is basically first last and pay and then I will put it as uh this one and I want to build my email. Email email is my summation of my first employee name and then the last name which has dot and then in forjp. So I will create f uh f fr f string and then I will say first dot lower and then dot and then dot here and then last dot lower at the rate infosys.com and then I can just return I will return a dictionary I would say I will create a dictionary which is basically first and then first and Then then last last and then email which is my email that we built here and then which is my pay I would say pay. So we created a function like this in it will take the first last and pay. Then we are creating our uh the email based on my first name and last name. We are returning a dictionary which contains all the details of an employee. So employee details I can just say employee 1 equal to I can call this one create employee and then I can pass these values which is my Rahul which is my first name and then I will provide my last name which is my Sharma and then I will provide my pay which is 50,000 rupees and then if I print my email employee one I'm going to get all of these details. So let's execute this path and see first name Rahul, last name Sharma, email Rahul Infosys and then pay is 50,000. So Ilaga I can create my functions and I can manage as many as possible maybe 200,000 employees, 300,000 employees. Uh yeah definitely but what if I want to increase my salary to my employees? So I can create one more functions maybe let's say apply raise and then it is going to take what is my employee details and then what is the percentage I'm going to increase the salary. So I can put it here and I can say employee and then I will just say pay. We are going to enhance or we are going to edit the value of my pay which is basically int employee pay into 1 + percent percentage by 100 employee pay which is 50,000 we are trying to access that employee pay and employee pay 50,000 into And then if I just say uh after this I will just call this function which is apply race and apply race I will provide my employee one here instead of employee and I will put a percentage of 4% on and if I just print employee one it is going to give me the whole thing after the pay rise if you look at this one initially we have first name Rahul last name Sharma and email rahul sharmainfosys.com and pay 50,000 but once we applied the raise of 4%.
Now the thing is what if you want to change or you want to add even better you can create multiple functions but the issue these functions and the data are disconnected.
There is no one blueprint that says so what is a class? A class is basically a blueprint for creating objects.
Employee information save all the things I need to save it in one place. I can create a blueprint.
If you want to build a house, you will draw a blueprint.
I need to have a blueprint and that blueprint is called a class. So class there is something which is called as class and I will put it as employee.
P L O Y E. So if you look at this one and then I will put as a pass. So what is this? So class and class is basically a keyword in Python and we will use it for creating classes and employee is basically a class name. So class name there are some rules you can use something which is basically camel case.
So every first important letter you will keep it in caps lock and second important letter you will keep it in caps lock. Let's say class create which is balaji chapa. So I can create bal and then c capital chip. It's not like bal functions names. These are some rules.
You can create some other things but it's always better to follow the standard conventions. class create using a keyword which is called class and then the class name and you follow this format and then local we are giving it as a pass for now because then local code really but even if you don't write any code python will not give you an execution error when you keep it as pass so that's why for creating a default class we are keeping it as a pass for now so already a class employee so I will create an employee one and I will call this class which is basically employee and I need to provide this instance and then if I want to create one more employee I can just say employee 2 and I will just do employee and I will just do this let's print both of these employee ones print employee one and then also print employee two and let's execute this and the output it says both employees are employee object so when you create an employee one it's a variable using the class. It is creating an object of this class. See employee object and the location is at this point and employee to game it is also creating an employee object and it is at this location. So they have different memory addresses.
They are unique and separate objects.
And this is how you create an instance of that class using the class name. So naturally we are not having any details in the employees. At the end of the we need to add the employee details. So I can add the employee details using dot emp1 dot maybe let's say first and then I will keep it as uh Rahul and emp1 dot last uh I will keep it as uh Sharma and then emp1 dot email I will keep it as Rahul uh dot Sharma at the rateinfosys.com and am pay pay which is basically 40 50,000 50,000 uh and then let's print employee1 email employee 1 email so let's execute this and rahul.sharmatheinfosis.com Sharma at the redinfosys.com and JP. If you look at this VS code is throwing an error cannot assign to attribute first for the class and JP because it's not a standard but if you look at the output it is not throwing any error because standard but you can create the details like this employee details I can just add like this and I can access any of the employee details. employee 2 email.
If I want to access any of the employee details, I can execute this and I can get raul.sharma and priya.pelinfosys.com.
It is working fine but it looks terrible then what is the use of the class but okay but create if you are writing something like this this is very very terrible because what if there are 200,000 employees again and it is going to throw the same problems it is going to repetative and it is not easy to maintain and there is no guarantee that you will not make any mistakes and then it's always very cumbersome it is not at all an ideal scenario so if you look at This one employee key what are we saving? We are saving the first name, we are saving the last name and we are saving the email and the pay. So by default we need all of these things. So is there any better way to save all of these things? Yes, that is where the main init method will come into picture.
Okay, class you can write methods. So these methods are like basic definitions function definitions. So I can just say define which is basically a keyword on how you define functions in Python. I will say underscore_init and you you provide something which is called as self by default is self in I will clarify in some time because we are going to take all of these variables which is basically the first and the last and then maybe let's say email we will build it from using first name and last name and this init function. Speciality intent whenever you execute this class or whenever you create an instance of this class this function is going to get executed by default this init function. So let me repeat whenever you create an instance of a class this function which is basically the init function is going to get executed by default this function is getting these values which is basically first last and pay and I'm going to save all of those things inside these parameters parameters define key you need to use self on self dot first equal to I will put it as first sorry I will put it as first the important stuff.
This is a variable that we are assigning and then we are giving the value as first.
You can keep it as you can keep it as any kind of variable name. But as a industry standard, it is always recommended to use the same value that you are providing here as a variable name. So it's easy to understand what the industry is also doing. I will just do self dot last I will get it as last and then I will just do self dot pay I will get it as a pay. So if I have to summarize how to create a class this first one is called the keyword which is called class keyword that you have to use for defining a class. Then this is my class name. And then you have this dunder method which is the init method.
If function name it will get executed by default. Executed by default.
And it will take three parameters right now. One is the first name, last name and the salary. And our mood values you are going to save it inside self.irst, self.last and self.pay. So we created a class which is called employee. Then we created the render method and you created the instance of that class using a variable called employee one and we passed all of these details. But the interesting stuff when you create an instance like this employee it will be replaced inside self. So here this will be employee one. So when you create a new instance of the same thing which maybe let's say employee 2JP that self will become the employee 2 and let's say employee and I will say Priya and then I can do Patel and I will get 40,000 salary and then Priya. So when I execute this time this self will be replaced with this employee too. So that is why self is mandatory an mata. So this will be acting as a placeholder and whenever you are creating an instance of that class this self will be replaced by this internally and you can access this as well. Now create if I want to print the details I can just do print employee one dot last and I can execute this and sharma what is employee one. last sharma and then if I want to print employee 2 first employee 2 dot first and I can execute this and I get priya. Now my initial code we have different different lines of code for the same kind of purpose.
But when you create a class like this you can reduce that point. And the second question is what if I want to also create my email I can create a variable here. I will say email and I will build that email using the first and last. So now first value it is present inside self.f first.
Either I can use self dot first or maybe I can directly access first. So fing I can put first dot lower dot last dot lower uh at the rate infosys.com first name and last name we created the email as well. So if I want to access the email of the first employee employee 1 do email I can directly access in the conte whenever you create an instance of an object it is going to define all of these things by default and if I execute this sharma rahul.sharma [email protected]. So by default employee name create I don't need to create my email. This function will be creating that email by default for me. So this is much much cleaner right and this is one line per employee.
If you look at this only one line per employee and all the attributes like first name, last name, pay, email are guaranteed to be set. And now there is something which is called as instance variables guys. So what are instance variables? Instance whenever you are calling a class that means you are creating an instance of that class. So employee one class instance and employee.
So let's say I have this class and I created two instance of the class which is basically employee one and employee two and I can access employee 1 and employee 2first and I'm going to get all of my details. So if I execute this student Rahul and Priya now the interesting stuff what if I want to change the salary of the employee one.
So if I employ one pay which is basically man pay so we are going to change it to 8 lakh 50,000 from the initial example which is 8 lakhs. So if I do that and if I print the pay it is going to update that for that particular instance only for employee one employee two value.
So if I go back here and if I do uh the pencil stuff. So you are creating an instance of the employee one and then you are creating instance of employee.
So when you are changing that particular employee one value which is the initial instance of the class you are only going to affect the employee one instance.
Employee two instance is going to stay same unless until you make the changes on and this is also very important one.
So think of instance variables like the information on your Aadhaar card. So the same class but the name the detail the address all of them is going to be changed. So that is why it is very important to understand when you change a particular values in the particular local instances that particular instance is going to get affected but not the other ones. Now instance employ what if you want to look at all the details of the instances employers dict it's internal method you don't need to worry about that if you execute this it is going to give you all of the details first name Rahul last name sharma pay 8 lakhs and email is raulshinvoice.com employee variables so all of these you will get in a single dictionary and that is what this dictionary is. Now the second topic which is basically the methods inside a class. Now employ you want to print the full name. Print the full name of the employee.
I can just do print employee one dot first and then comma and then I can boot employee one dot last and I can get my full name of my employee which is Rahul Sharma. But what if there are so many employees? So you can create a custom method. Method is basically a definition inside a class. Maybe let's say I want to create a full name. I will create a definition of the class. And by default it is going to take the parameter which is basically self.
I will return my full name which is I cannot directly access first.
I need to access this as the self first because self very important inside a class and employee one it is present in the self. So I can just do self dot first and then space I will just do self.last Last always remember this whenever you are creating any functions or methods inside a class by default the first parameter is going to be the self and the init and a method you need to create all the variables using self.tjp and then whenever you are accessing those variables inside the particular class always access using the self method self dot for first self.lo last directly access them that's how I remember at least and now if I want to uh get the uh full name I can just say employee 1 dot I can call this function which is my full name dot full name and let's execute this I mean I need to call it with the parenthesis and then uh see Rahul Sharma we wanted to print the full name of an employee so Dhanosam we created a method this is called a method inside a class and a method is applicable across all the instance of the class. If I want to print the employee to full name, I can just do employee 2.name and I can execute this.
I can get priya patela. Let's say I want to increase the pay of an employee. So I can create one more function. Let's say increase def increase pay increase pay and I can say self, I can take a value which is called percentage and then I need to make the modification. So modification I need to modify the pay do value. I can just say self.pay equal to which is my self.pay into uh maybe I I'll keep it as an integer. I I want to make it as a round and then I will into 1 + percentage by 100 and then I just need to close this one.
I created one more method inside the class and if I need to make the change of an pay to an employee I can just call this class. So let's say I created this first employee and I will just print my pay initially which is before my uh change and then once it is done I will call this function employee 1 dot uh increase pay and then I will provide what is my percentage maybe let's say 4% I want to increase and I will just do the print of employee 1.pay pay after this increase and if I execute this initially it is 8 lakhs 8 lakhs 32,000 which is basically 4% increase soil you can create multiple methods inside a class and all of these methods will be able to accessed by the instance that you created here what are we solving we have a particular class employee employee and a class we are tying up every single thing inside this so This is what the class will solve.
The functions cannot do. So functions you cannot have this linkage and guys before we close this call.
There are two ways to call a method.
Actually I can just do employee one dot I can say increase pay and pay. I will I can call like this increase pay and I will provide what is the value or else I can call it with something by the class name itself. I can say employee dot full name and then maybe let's say increase pay and then I will provide what is my employee one maybe let's say employee one employee one and then I will put it as four either I can increase the payment of an employee using the employee one instance that we created employee one dot increase pay and then how much percentage you want to increase I can call the class itself dot you call the method that we created self that self is basically our employee one and then what is the percentage percentage is four and if I execute this again print employee 1p pay I'm going to get all of these things initially 8 lakhs 82,000 and 8 lakhs 99,000 so these are the basics of the class how you can declare all of these things how you can create the methods. So these are the basics. If you go back to one of the code examples maybe let's say exceptions on and if you look at this one example I created a class which is basically agent error and a class we will learn about what is this which is called as inheritance in the later video. So don't worry about that. Then in local we have something which is called the init. Then in local we have all of these things superinit and ent we will learn all of these things in detail. So don't worry we have one more function and one more method and then there is one more class and there is one more class you can have class create for each specific topic and then you can have different different methods inside each of these classes and in the next video we are going to learn which is called as class variables class variables and a every single thing we are going to learn so don't worry on that part and stay tuned for the next one and next one will be on the is there.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











