[00:07] some of the most important technologies for building modern AI application. But during interviews, companies don't just ask definition. They test you whether you understand how these framework work in real world AI systems. In this [00:19] tutorial, we will cover the most commonly asked langchain and LAN graph interview question. starting from the fundamentals and moving toward advanced concepts like rag embeddings vector database agent multi- aent system and [00:32] workflow orchestration whether you're preparing for an AI engineer generative AI or LLM application developer role these question will help you build a strong understanding of lang chain and LAN graph concepts now agenda for [00:44] beginner level covering the fundamental of lang chain and langraph including LLMs prompt templates chain lce and basic concepts then we'll move to intermediate level we'll understand practical concepts like rag embeddings [00:57] vector database retrievers tools agent and lang then finally we'll move to advanced level exploring advanced AI workflow concept including land graph multi- aent system human in the loop checkpointing and building reliable AI [01:10] applications but before we begin just a quick info guys if you are looking to build advanced skill in generative AI machine learning and AI powered automation you can check out simply's professional certificate in genen AI [01:22] machine learning and intelligent control system in collaboration with IITM Parvatuk. The six-month live online program covers key areas like genai, machine learning, deep learning, envelops, NLP, agentic AI and [01:35] hands-on experience through 18 plus industry aligned projects, 25 plus AI tool and live workshops along with a two-day campus immersion at IIT Madras research park. The program also includes AI powered career support expertled [01:50] session and certificates from IITM Parvatuk Technologies Foundation and Microsoft. Now before we move on, here's a quiz to test your knowledge. What is the primary purpose of lang? Option A to train new large language models from [02:03] scratch. Option B to build LLM powered application by connecting models with tools, data and workflow. Option C to replace databases with AI models. or is it option D to create only front-end interfaces for AI applications? At the [02:18] end, we'll have a quick MCQ quiz to test your understanding. So without any interview questions. Starting with the very first question, which is what is lang? Open-source framework designed to help developers build application [02:30] powered by large language model which is also called LMS. It provides a structured way to connect LLMs with external data sources, APIs, databases, tools, memory system and workflow. Now instead of only using an LLM for [02:43] developer to create complete AI applications such as chatbot, rag based system and autonomous agents by combining different components together. do we need lang chain when we already have LLM APIs. Now your answer should be [02:59] like LLM APIs provide access to powerful language model but they only handle the interaction between the application and the model. Langin help developer build complete AI workflow by connecting uh LLM with additional components such as [03:12] documents, databases, APIs, retrieval system and external tool. It simplifies the development process you know by providing reusable pins and help create scalable application. What are the main components of lang? Now the main [03:25] components of lang chain include model, prompt, template, chains, retrievers, tools, agents, memories and output parcels. Model allow application to interact with different LLM providers while prompt template help create [03:38] reusable prompt with dynamic inputs. Chain connect multiple steps into information from data sources. Tools allow model to interact with external systems. Agent enabled decision- making. Memory stores conversation history and [03:53] output passer help convert model responses into structured format. Coming prompt template? Now a prompt template is a reusable structure for creating prompts with dynamic various. Now instead of manually writing separate [04:07] prompt for every request, developers can create one template and insert different value whenever is required. For example, a template like explain and then topic in simple terms can generate responses for different topics by replacing [04:20] variable. Prom template improve consistency, reduce repeated code and make LLM application easier to maintain and scale. Uh coming to the next question which is what is chain in lang chain. A chain in lang chain is a [04:33] sequence of connected step where the output of one components becomes the input for the next component. Chain help developer create structured workflow by combining prompts, model retrievers and other components. For example, a [04:46] document summarization chain can take a document as input, process the content, send it to LLM and generate a summary as a output. Now, chain are useful when the workflow is predictable and follows a fixed execution path. Moving on to the [05:00] next question, which is what is L? Now, LCAL stands for lang chain expression language which is a syntax used to create lang chain workflow by connecting components together using a simple pipe operator. Now it allows developer to [05:13] combine elements such as prompt templates, model and output parser in a clean and readable way. For example, a workflow can be written as prompt model where the prompt prepares the input. The model generates a response and the [05:27] parser formulates the final output. LCEL improve flexibility, streaming support, debugging and production deployment. Moving on to the next question which is explain rag architecture in LA. Now, rag or retrieval argumented generation is an [05:41] architecture that combine information retrieval with an LLM to generate more accurate and context aware responses. Now, instead of only on knowledge stored inside the model, RAD retrieves relevant information from external sources such [05:55] as document, databases or vector stores and provide that information as context to the LLM. In langchain, the typical rag workflow includes loading document, splitting them into chunks, creating embedding, storing them in a vector [06:09] database, retrieving relevant content, and passing it to the LLM for response generation. Now, rag helps reduce hen and allow organization to build AI I'll check whether the camera is on or not. Moving on to the next question, [06:24] which is how does document loading work in lang. Now document loaders in lang chain are used to import data from different sources such as PDFs, websites, CSV files, text files and databases. These loaders convert [06:36] external data into lang document objects that contain the actual content along with the media data such as file name, page number, source information. Once processed further through techniques like splitting, embedding, generation [06:51] and retrieval for building rag applications. Moving to our next documents? Now document splitting is required because large document cannot always be directly processed by LLMs due to token limitation and increased [07:05] processing cost. Langin divides large documents into smaller chunks so that relevant section can be retrieved and provided to the model during question answering. Now proper chunking improve retrieval accuracy, reduce unnecessary [07:19] information, lowest token uses and helps the LLM generate more relevant responses. Let us move to our next question which is what is an embedding? Now an embedding is a numerical representation of text whether words, [07:33] sequence or documents are converted into vector that capture their semantic meaning. Now similar concepts are represented by vector that are close together allowing system to perform semantic searches instead of only [07:46] keyword matching. In langchain application embeddings are commonly used in rag system where documents are converted into vectors and are stored in vector databases for efficient retrieval. Moving on to the next [07:59] question which is what is a vector data? Now a vector database is a specialized database designed to store and search vector embeddings generated from text, images or other data. It allows application to find information based on [08:12] semantic similarity rather than exact keyword matches. In langin vector databases store document embeddings and retrieve the most relevant information when a user ask a question. Popular vector databases include pine cone, [08:25] vector databases include pine cone, chroma, fa, vivid and vivid and milbus. They are commonly used in rag application to quickly search large context to an element. Now moving to some intermediate level interview [08:39] questions which is what are agents in lang chain? Now agents are useful for building intelligent application that require decision making and automation. what is the difference between chain and agent. Now a chain follows a predefined [08:53] sequence of step where the workflow execution path is fixed. For example, a retrieval chain always follows the process of retrieving documents, sending context to LLM and generating an answer. An agent on the other hand dynamically [09:05] decide which action or tools to use based on the situation. Chain provide more control and predictability while agent offer flexibility and are suitable for complex task where the required step are not always known in advance. Moving [09:20] the difference between a retriever and now retriever and an LLM perform different roles in an AI application. A relevant information from a knowledge source such as vector database, document [09:34] store or search system. It focuses on retrieving accurate context related to the user's query and LLM uses that retrieved information along with its language understanding capabilities to generate the final response. In a rat [09:48] system, the retrieval provides the knowledge while the LLM process that knowledge and creates a meaningful answer. Moving on to our next question. What is a hybrid search? Now, hybrid search is a retrieval technique that [10:00] combines traditional keyword based search with semantic vector search to improve the quality of results. Keyword search methods like DM25 are effective when exact terms are important, while vector search understands the meaning [10:12] and context behind the queries. By combining both approaches, hybrid search can retrieve more relevant information, especially in enterprise application meaning match. Moving on to our next question, which is how would you [10:27] optimize a rag application? Now, a rag application can be optimized by improving different stages of retrieval and generation process. This include creating better document chunks using high quality embeddings, implementing [10:39] implementing hybrid search, adding reranking models, applying metadata filtering, optimizing prompt and selecting appropriate LLM models. Now additional improvement include caching frequently asked questions, reducing [10:53] unnecessary context, monitoring performance and continuously evaluating retrieval accuracy and and lower operational cost. Moving on to our next question which is how do you evaluate a rack system? Now a rag system is [11:06] evaluated by measuring both retrieval quality and generated response quality. Retrieval evaluation focus on metrics such as precise recall and whether the retrieved document contain relevant information. Generation evaluation [11:19] checks factors such as answer accuracy, relevance, faithfulness to the retrieved context and hallucination rate. Tools like Lansmith and evaluation framework can help analyze system performance, identify failures and improve the [11:33] overall reliability of the application. Moving on to our next question which is what is lang? Now a lang is an observability and evaluation platform created by lang chain that help developer monitor, debug and improve lm [11:47] applications. It provide detailed tracking of applications workflow includes prompt, model responses, tool calls, latency and errors. Developers can use Lansmart to evaluate AI responses, compare different version of [12:00] application, identify issues in chain or agent and improve the performance of to our next question which is what is the difference between lang chain and LAN graph. Now chain is a framework that provides [12:14] components for building LLM application including prompt chain tools retriever and on other hand is built on top of langchain and is designed for creating complex stateful workflow using graphs. While langchain is very useful for [12:28] straightforward workflow. Lang graph provides advanced capabilities such as nodes, edges, loops, conditional routing, state management and human in the loop interaction. Land graph is commonly used for building reliable [12:41] agents based system with complex execution paths. Moving on to our next LAN graph. Now a nodes land graph represent individual task or operation within a workflow. Each node perform a [12:54] specific function such as calling an LLM, retrieving documents, executing a tool, validating output or processing data. A complete AI workflow is created by connecting multiple node together. For example, a customer support agent [13:07] workflow may contain separate nodes for intent detection, document retrieval, escalation. Moving on to our next question, which is what are the edges in LAN graph? Now, edges in LAN graph define the connection and flow of the [13:21] execution between different nodes. They determined how information moves from one step to another within the langraph supports normal edges where execution follows a fixed path and conditional edges where the next step is selected [13:35] based on certain condition or the current state. This allow developer to build flexible workflow with decision making and branching logic. Moving on to our next question which is what is state in langraph. Now state in LAN graph [13:47] represents a shared information that moves between the different nodes during workflow execution. It stores important data such as user messages, retrieve document, previous responses, tools output and workflow status. By [14:01] complex application to remember previous steps, manage conversation and make a better decision throughout the execution process. Moving on to our next question, which is how does LN graph handle loops? Now, Lang graph supports looping [14:15] workflow by allowing execution to return to previous nodes when required. This capability is useful for tasks that require multiple attempts, validation or selfcorrection. For example, an AI agent can generate an answer, checks its [14:28] accuracy and return to the retrieval step if the information is insufficient. Loop help create more reliable AI system that can improve their output before completing the task. Moving on to our next question, what is human in the [14:41] loop? Now, human in the loop is a workflow design approach where human approval or intervention is added at important stages of an AI process. In Landraph, a workflow can pause and wait for human feedback before continuing [14:54] execution. This is useful for sensitive tasks such as financial transactions, sending important emails, legal decision or customer escalation. Where complete automation may not be appropriate. Moving on to our next question, which is [15:08] how would you design a multi- aent system? Now a multi- aent system is designed by creating multiple specialized agent where each agent is responsible for a specific task or domain. Instead of one AI agent handling [15:20] everything, different agent can work together to solve complex problem. For example, a research agent can collect information. A coding agent can generate a review code and a and a validation agent can check the quality of results. [15:33] A supervisor agent manages communication between these agents, assign task and decide the workflow direction. Land graph can be used to build such system by managing agent states, communication, routing and execution flow. Moving on to [15:47] some advanced level interview questions. How does Landraph improve agent reliability? Now improves agent reliability by providing a structured workflow environment instead of allowing agent to operate with uncontrolled [15:59] decision- making. It enables developer to define clear execution path using nodes, edges, state management, conditional routing and checkpoints and human approval steps. These features help control agent behavior, handle [16:12] failures, track progress and prevent unexpected actions by creating predictable workflow around agent. Langraph makes AI agent system more reliable, transparent and easier to debug in production environment. Moving [16:25] would you build a customer support agent? Now a customer support agent can be built by creating a workflow that understands user queries, retrieve relevant information, generate responses and escalate complex issues whenever it [16:39] is required. The process can start with an intent classification step to identify the customer's request followed by a retriever that research knowledge bases such as FAQs or company's document. The retrieved information is [16:52] response. For complex cases, the workflow can route the conversation to human support representative and LAN graph can manage this workflow using different nodes for classification, retrieval, response generation and [17:06] escalation. Moving on to our next question which is what is checkpointing? Now checkpointing in LAN graph is a mechanism that saves a current state of a workflow during execution. It allows an application to pause, recover or [17:18] continue from a previous point without restarting the entire process. This is especially useful for longunning workflows, human approval processes and agent dates application where task may take multiple steps. For example, if an [17:32] AI agent completes research but requires human approval before taking action, checkpointing allow the workflow to resume from that exact stage after the approval. Moving on to our next question, which is how would you debug a [17:44] LAN graph agent? Now debugging a lang graph agent involve analyzing each step of the workflow to understand how decisions are being made. Developers can inspect node execution, state updates, tool calls, prompt, model responses and [18:00] routing decision to identify problem. Tools like Langsmith provide detailed execution traces that help monitor agent behavior, identify failures, analyze latency and improve response quality. Common debugging approaches include [18:13] checking incorrect routing logic, improving prompts, validating tools output and monitoring unexpected agent decision. Moving on to your last question which is infinite repeat finite loop. Now infinite loops in LAN graph [18:26] agents can be prevented by defining clear domination conditions and controlling workflow execution. Developers can set maximum iteration limits, add validation steps, monitor state changes, and use conditional [18:39] routing to ensure that workflow moves toward completion. Now, checkpointing and monitoring tools can also help identify repeated execution pattern. Proper workflow design ensure that agent know when to stop, request human input [18:53] or move to the next stage instead of continuously repeating actions. Keep learning, keep building and keep solving meaningful problems. Till then, thank meaningful problems. Till then, thank you and see you in the next video.