WSGI and ASGI WSGI ASGI Creating a simple api Purpose: which returns flats on rent based on filters location type To acheive this lets make little steps Step 1: Create a standard folder structure Figure out what is standard root (project name) Create a repository in github (private) with same name clone the repository into… Continue reading Python Classroom notes 05/Sep/2026
Python Classroom notes 03/Sep/2026
Functions reusable instructions (block ) reverse of a number number = 731 orig = number rev = 0 until number > 0 rev = number % 10 + rev * 10 number = number / 10 say rev To make this function define reverse(number) orig = number rev = 0 until number > 0 rev… Continue reading Python Classroom notes 03/Sep/2026
Gen-AI Developer Classroom notes 03/Sep/2026
Long term memory Refer Here for longterm memory Longterm memory spans across converstaions (sessions) Langchain uses store Lets play with InMemoryStore (ideally longterm ends in persistent store) MemoryStore is a Key Value Storage which is namespaced key is string and value is dictionary Longterm memory by types episodic semantic procedural Refer Here for sample code… Continue reading Gen-AI Developer Classroom notes 03/Sep/2026
Python Classroom notes 02/Sep/2026
Problems Prime number Solution number = 7 start = 2 is_prime = True until start < number if number % start == 0 is_prime = False exit or break start = start + 1 say is_prime optimization number = 7 start = 2 is_prime = True until start <= number / 2 if number %… Continue reading Python Classroom notes 02/Sep/2026
Gen-AI Developer Classroom notes 02/Sep/2026
using agents and init chat models To create a model object just pass the string provider:model in init_chat_model create_agent Memory by scope Scope: current session/chat => short-term (checkpointer) across sessions => long term => store scratch pad (current task) => todo_list Create an agent invoke with interaction 1: tell your name interaction 2: ask your… Continue reading Gen-AI Developer Classroom notes 02/Sep/2026
Python Classroom notes 01/Sep/2026
looping Kid now knows and or not Sample – 1 Sum of all numbers from 1 to 10 result = 0 start = 1 end = 10 until start <= end result = result + start start = start + 1 say result Sample – 2 Factorial of a number number = 5 result =… Continue reading Python Classroom notes 01/Sep/2026
Gen-AI Developer Classroom notes 01/Sep/2026
Prompt Engineering Core Principles => Garbage in and Garbage out In our case we create an agent which has model tools Every request to model will carry tools schema system prompt human message optionally tool responses previous messages or previous messages summary Anatomy of a good prompt Role Action Context Format Constraints Sample prompt You… Continue reading Gen-AI Developer Classroom notes 01/Sep/2026
Python Classroom notes 31/Aug/2026
Conditional flow Generally program executes instructions one by one What kid knows Addition (+) Subtraction (-) Multiplication (*) integer Division Quotient (//) Remainder or modulus (%) Division (/) equals (==) less than (<) less than or equals <= gt (>) ge (‘>=) assignment (=) Scenario – 1 we need to make this kid tell if… Continue reading Python Classroom notes 31/Aug/2026
Gen-AI Developer Classroom notes 31/Aug/2026
Messages in langchain when we are interacting with model we have following options system prompt: This sets the system instructions for a model human prompt: This is users question llm response: This is response from llm tool message: This represents tool response. According to langchain terminology System Prompt => SystemMessage HumanPrompt => HumanMessage LLM Response… Continue reading Gen-AI Developer Classroom notes 31/Aug/2026
Gen-AI Developer Classroom notes 27/Aug/2026
Developer Environment Setup for Agents Python windows winget install –id Python.Python.3.13 mac brew install python@3.13 UV Windows winget install -e –id astral-sh.uv mac brew install uv Visual Studio Code with necessary extensions Windows winget install Microsoft.VisualStudioCode Mac brew install –cask visual-studio-code Google AI Studio API Key Note: For vscode extensions Python (Microsoft) Jupyter (Microsoft) Windows… Continue reading Gen-AI Developer Classroom notes 27/Aug/2026
Python Classroom notes 26/Aug/2026
Execution Kid executes one instruction at a time Add 3, 5 and remember as C C = 3 + 5 A step will have calculations and/or remembering To speak with kid follow the below structure What kid knows Addition (+) Subtraction (-) Multiplication (*) integer Division Quotient (//) Remainder or modulus (%) Division (/) equals… Continue reading Python Classroom notes 26/Aug/2026
Gen-AI Developer Classroom notes 26/Aug/2026
Build a Basic Agent I Want to build a agent which calls tools Agent: Model + Prompt Tool Framework Model (LLM) Where will i get access to a models Hosted by provider Google AI Studio (Free access available) Hosted by Cloud Providers (Enterpirse) Self Hosted In the class when we built the agent these were… Continue reading Gen-AI Developer Classroom notes 26/Aug/2026
Python Classroom notes 25/Aug/2026
Programming To solve repetitive time consuming problems Our approach Generally a program is executed on a system and it executes the instructions one by one Add 3, 3 and remember as result Add result, 3 and remember as result Add result, 3 and remember as result Programs are executed by systems with some OS (operating… Continue reading Python Classroom notes 25/Aug/2026
Gen-AI Developer Classroom notes 25/Aug/2026
Introduction to Agents Usecase – 1: Customer raised a complaint that the product is not delivered Customer care representative: pulls the records * order * shipping * delivery information Options: * Redeliver * Refund Solution * Pick a tool calling model * a tool to read customer complaints * a tool to read the order,… Continue reading Gen-AI Developer Classroom notes 25/Aug/2026
Python Classroom notes 22/Aug/2026
Threads, Thread pool, Concurrency and Async CPU Intensive activities use multiprocessing IO intensive activities: (async) Calls are blocked Lets create a simple python module which demonstrates the async We are supposed to download files from internet we have a python function python def download_file(url:str): pass When we are downloding multiple files (blocking style) for url… Continue reading Python Classroom notes 22/Aug/2026
Python Classroom notes 20/Aug/2026
Adding persistence layer (storing into databases) From python to interact with relational databases we have two apporaches Write sql queries and code around for your business logic. ORM (Object Relational Mapping): we deal with python objects and ORM translates that into SQL Queries depending on db. ORM would require a db driver package Concepts Connection… Continue reading Python Classroom notes 20/Aug/2026
Python Classroom notes 20/Aug/2026
Adding persistence layer (storing into databases) From python to interact with relational databases we have two apporaches Write sql queries and code around for your business logic. ORM (Object Relational Mapping): we deal with python objects and ORM translates that into SQL Queries depending on db. ORM would require a db driver package Concepts Connection… Continue reading Python Classroom notes 20/Aug/2026
Python Classroom notes 20/Aug/2026
Adding persistence layer (storing into databases) From python to interact with relational databases we have two apporaches Write sql queries and code around for your business logic. ORM (Object Relational Mapping): we deal with python objects and ORM translates that into SQL Queries depending on db. ORM would require a db driver package Concepts Connection… Continue reading Python Classroom notes 20/Aug/2026
Python Classroom notes 19/Aug/2026
Dependencies in fast api refer here for dependencies in fast api Packages in python In python file becomes a module and package is a folder with a file called as __init__.py Prompt Explain different ways of creating packages and subpackages and guide me with good practices, examples about relative and absolute imports, Ensure all the… Continue reading Python Classroom notes 19/Aug/2026
Python Classroom notes 18/Aug/2026
Creating a Fastapi Project Structure Step 1: Scaffold uv init learning-api –package –python 3.13 cd learning-api Step 2: Add Dependencies # for project uv add fastapi "uvicorn[standard]" pydantic-settings email-validator # for tests uv add –dev pytest pytest-asyncio pytest-cov httpx ruff mypy debugpy Step 3: Directories mkdir src/learning_api/api mkdir src/learning_api/api/v1 mkdir src/learning_api/core mkdir src/learning_api/schemas mkdir src/learning_api/services… Continue reading Python Classroom notes 18/Aug/2026
