Generative AIby Dhruv Narang

Syllabus

Start Here: GenAI Basics

  1. What is GenAI? – Definition, Google vs ChatGPT, traditional AI vs GenAI
  2. GenAI in Action – What GenAI creates and what AI engineers build
  3. What is an LLM? – How an LLM predicts, parameters and tokens
  4. Prompt to Response – Prompt to response, apps vs code, and how the API works
  5. Virtual Environment & uv – What a virtual environment is, pip and uv, installing uv, requirements.txt, and the three setup commands
  6. API Keys and Limits – What an API key is, the .env file, the default key names, free plan limits, and the three common key errors
  7. Calling Your First LLM – Package and API key for each company, then call Gemini, Groq and Mistral

Build with LangChain

  1. What's the Issue? – Switch company and every line changes. We need something better
  2. What is LangChain? – What LangChain is, and the toolbox of building blocks it gives you
  3. Your First LangChain Call – Install a package, then create the model with a class or init_chat_model
  4. Temperature & Max Tokens – How random the answer is, and how long it can be
  5. What is a Prompt? – What a prompt is, the three message types and the system prompt
  6. Writing Messages – The four roles, three ways to write messages, personalities and role mistakes
  7. Prompt Templates – The f-string problem, prompt templates, and templates with many blanks
  8. Your First Chatbot – What a chatbot is, the loop, a first chatbot in a few lines, and what each line does
  9. Chat History – Why LLMs forget, resending the history, the context window and MessagesPlaceholder
  10. Output Parsers – What output parsers are and the string, list, JSON and Pydantic parsers
  11. Structured Output – Structured output with a Pydantic schema: PydanticOutputParser and with_structured_output
  12. The Story of Chains – Old chains, the 3 repeated steps, deprecation
  13. Pipe & Runnables – The pipe operator and the Runnable standard
  14. Common Runnables – The common runnables: your own function as a step (RunnableLambda), RunnableParallel and RunnablePassthrough, and a pointer to more
  15. Why Tools? – Why LLMs cannot know live data, and how a tool lets them ask for it
  16. Tool Calling in Code – Make a tool with @tool, attach tools with bind_tools, the five-step tool-calling flow, and Tavily web search
  17. Crypto Price Project – A small project: a tool that calls a free price API for any coin, and a model that uses it
  18. Web Search with Tavily

Chat with Your Data (RAG)

  1. What is RAG? – Why LLMs need your data, what RAG is, and the whole pipeline in one picture
  2. What Is an Embedding Vector? – What an embedding vector is, a movie example, why we need it, and which models make it
  3. From Chunk to Vector – A chunk to a vector: the ready-made model, its table, attention, average and normalize
  4. Store and Search – What a vector database stores, the two jobs (store and search), how one question is searched, and top-k
  5. Measuring Similarity – Cosine similarity, dot product and Euclidean distance with tables, and where you set the choice in Chroma, Pinecone and Qdrant
  6. Fast Search (ANN) – Why brute force is slow, what ANN is, its five families, and IVF, HNSW and PQ explained
  7. Document Loaders – What a Document is and how to use it, what a loader is, the types of loaders, and how PyPDFLoader works
  8. Web Loaders – BeautifulSoup, WebBaseLoader, RecursiveUrlLoader and PlaywrightURLLoader: what each does, the headless browser, and what to install
  9. Text Chunking – What chunking is and why, chunk_size and chunk_overlap, the four kinds of text splitters, the recursive splitter, split_text and split_documents
  10. Build a RAG App – The two parts of a RAG app, load and split, embed and store, first and next run, retrieve, augment and generate, and other models and stores
  11. Chat with History (RAG) – Multi-turn chat that retrieves

Agents with LangGraph

  1. Why LangGraph? – Why a chain is not enough, the four levels of AI apps, and what state, node and edge mean
  2. Six Workflows – The six workflows we build in this unit, and which job needs which shape
  3. Chains vs Graphs – Linear chains vs cyclic graphs
  4. What Is State? – Why steps share data, what the state is, and why a node returns only what it changes
  5. State Types & Reducers – The four ways to write the state, and reducers: overwrite or merge
  6. Building a Graph – Why we describe the flow, then add_node, add_edge with START and END, and compile and invoke
  7. Conditional Edges – Conditional edges: a router function that picks the next node, for a loop and for many paths
  8. The Pipeline Idea – Why one big prompt fails, the assembly-line idea, and the three nodes with their roles
  9. Build and Run – The full graph, running it, an example result, and why a pipeline beats one prompt
  10. Fan-Out and Fan-In – Why run independent checks together, fan-out and fan-in, and the three checks
  11. Merging with Reducers – Three nodes writing one key, the merge reducer, running it, and other reducers
  12. Write, Review, Rewrite – Why one try is not enough, reflection, the writer and reviewer nodes, and the stop rule
  13. Run It, Then Add Tools – Running the loop, adding a search tool, and two loops in one graph
  14. Memory – Persisting state across turns
  15. Human-in-the-Loop – Pausing for human approval
  16. Conditional RAG – Adaptive routing between RAG paths