Video summary
Foundations of Agentic AI + AI Workflows | AICTE | BharatCares | Masterclass 5
Main summary
Key takeaways
Session overview
- This was the final “Masterclass 5” in a course covering agentic AI foundations and AI workflows, with a strong focus on building AI agents using code.
- The trainer uses Google Colab (with optional VS Code) and builds a “hospital agent” using LangGraph (Python) and an LLM via Groq.
- A recurring theme is: agents must be reliable, not just automated.
Key concepts taught (agent design + reliability)
1) Router-based vs. fully autonomous agents
- Router-based agent: the LLM (or classifier) decides which route to take, but the workflow steps/graph are predefined.
- Fully autonomous agent: the LLM decides “what to do next” without predefined steps.
Tradeoff noted by the instructor:
- More AI control → lower reliability
- Less AI control → higher reliability, but more manual maintenance
2) “Reliability vs control” and why LangGraph is used
The “sweet spot” is achieved with LangGraph:
- Higher control of flow while improving reliability
- Intended to avoid problems seen in simpler drag-and-drop / black-box agent setups
3) Problems with plain (drag-and-drop) agents
- One-shot reasoning (no iterative refinement/looping)
- Hard to debug because nodes act like a black box
- No good state/memory and limited loop control
LangGraph fundamentals (core framework components)
- LangGraph: a Python library (free; MIT students; used professionally in industry)
- Key primitives:
- Node: a function/step in the workflow (e.g., “summarize”, “send email”)
- Edge: connects nodes; can include an LLM-based conditional decision
- Graph state (shared memory): a shared dictionary accessible across nodes
- Events/triggers: signals for moving to the next step
Flow structure discussed:
- Start → Nodes → Conditional edges → End
Difference vs LangChain:
- LangChain is described as more linear (chain), with fewer/less natural looping patterns.
- LangGraph supports graph structures and loops more naturally.
The hospital agent tutorial (end-to-end)
Problem statement (why this agent)
Hospitals face high volume of repetitive but high-risk routing/in-take requests. Traditional intake is manual and causes:
- Overcrowding/queue
- Inconsistent routing
- Bottlenecks at peak hours
- No auditable decision trail
Proposed solution:
- Replace receptionist bottlenecks with a kiosk-like intake screen
- Use an AI receptionist for ward routing + doctor assignment
Agent flow built in the code
-
Intake node
- Collects patient name, age, and symptom/query
-
Router node (LLM classification)
- Classifies symptoms into exactly one of:
- emergency
- mental health
- general
- Uses LLM prompt rules and sets temperature = 0 to reduce creativity and enforce classification behavior.
- Hard safety nets / keyword overrides:
- If emergency/crisis keywords appear (e.g., chest pain, cannot breathe, unconsciousness, suicide/self-harm), routing is forced regardless of LLM output.
- Normalizes user input by lowercasing to match keywords.
- Sends minimal info to the LLM for privacy (e.g., not sending patient name in the LLM prompt).
- Classifies symptoms into exactly one of:
-
Ward nodes
- Separate nodes for emergency, general, and mental health (basic placeholders for ward-specific actions)
-
Doctor availability node
- Loads a doctors.csv file with fields such as:
- doctor name
- ward type
- status (active)
- next slot time and slot minutes
- Chooses an available doctor for the selected ward and marks them busy (updates assignment logic)
- Loads a doctors.csv file with fields such as:
-
End
- Outputs assigned ward/doctor and appointment slot
Demonstrated behavior
Example inputs show:
- “high fever” → emergency, doctor assigned (e.g., Dr. Khan), updated “busy” state
- “fever + cough” → general ward, different doctor assigned
- “accident” → emergency
- “can’t think clearly / mental distress” → mental health ward
Setup + tooling steps included
Development environment
- Primary coding in Google Colab
- Mentions VS Code as an alternative (for library/version control convenience)
LLM provider: Groq
- Uses Groq API via ChatGroq
- Teaches:
- Creating a Groq free API key
- Storing secrets safely (using environment variables / secrets)
- Warning against exposing API keys (others could spend available credits)
Libraries installed
- langgraph
- langchain-groq / langchain core messaging
- pandas (for reading doctors.csv)
Data files
- Uses a provided doctors.csv uploaded to Colab:
- doctor list + ward + availability indicators (next slot, slot minutes)
Hosting/deployment guidance (productization)
After building the graph, the instructor explains deploying a full app:
- Front-end: deployed to Vercel (React/Next-like stack; mentions ReactJS)
- Back-end: built with Python FastAPI, deployed to Render
Workflow:
- Push code to GitHub
- Deploy front-end on Vercel
- Deploy back-end on Render
- Configure environment variables (especially GROQ API key) and update the front-end API URL to point to Render (not localhost)
Notes:
- Must solve CORS by configuring API URL / allowed origins appropriately
- Mentions an optional approach: use an AI tool to generate front-end/back-end scaffolding and deploy it
Tutorial output & checks
Includes:
- Instructions to print the graph
- Instructions to invoke/run the graph (interactive CLI-like input for patient data)
Encourages testing multiple patient scenarios to verify routing and doctor assignment.
Review / guide / learning guidance (course mechanics)
Learners are asked to:
- Complete their learning plan and submit the required certificate
- Attend a scheduled non-technical Q&A session (tomorrow) for offer letter/dashboard issues
It also mentions most queries were already addressed, with remaining questions handled via posting or the next session.
Main speakers / sources
- Speaker/trainer: Mr. Amit Tari
- Course/host mentions: program organizers including Nandini, and “Amits/Amitsur” (referenced for internship/project prompts)
- Technologies/sources used in the tutorial:
- LangGraph (MIT students’ framework)
- Groq (LLM API via ChatGroq)
- LangChain messaging components (system/human messages)
- FastAPI, Vercel, Render, ReactJS (deployment stack)