Home › Blog › LangChain Interview Questions (2026): 30 Questions on Agents, Tools, RAG and LangGraph

LangChain Interview Questions (2026): 30 Questions on Agents, Tools, RAG and LangGraph

LangChain interview questions in 2026 are about LangChain 1.x: create_agent and the agent loop, tools, structured output, middleware, retrieval, and LangGraph underneath for state, persistence and human-in-the-loop. Answers built on pre-1.0 chains now sound dated.

LangChain interview questions in 2026 are about LangChain 1.x: create_agent and the agent loop, tools, structured output, middleware, retrieval, and LangGraph underneath for state, persistence and human-in-the-loop. Answers built on pre-1.0 chains now sound dated. On November 17, 2026, PyPI listed langchain 1.5.0 (November 11, 2026) and langgraph 1.2.22. LangChain 1.0 shipped in October 2025, replaced langgraph.prebuilt.create_react_agent with langchain.agents.create_agent, and moved legacy chains to langchain-classic; current releases need Python 3.11 or later per PyPI.

Every API named below was checked against the LangChain and LangGraph docs on that date. Below are 30 questions by level, five production scenarios and how interviews test this. Model-level theory is in LLM interview questions, and retrieval design in RAG interview questions.

LangChain interview questions: fundamentals (1–10)

  1. What is LangChain? An open-source framework, in Python and JavaScript, for building LLM applications and agents. It gives one interface over many providers' chat models, embeddings, vector stores and tools, plus a prebuilt agent. LangGraph is the lower-level runtime it builds on, and LangSmith is a separate platform for tracing and evaluation.
  2. What changed in LangChain 1.0? Three things, per the v1 release notes: create_agent became the standard way to build agents; messages gained a standard content_blocks property across providers; and the namespace was trimmed, with legacy chains, retrievers, indexes and hub moved to langchain-classic.
  3. How do you initialize a chat model? init_chat_model("provider:model") from langchain.chat_models, or a provider class from its integration package, passing parameters such as temperature, max tokens and timeout.
  4. What are invoke, stream and batch? The standard Runnable methods from langchain-core: invoke returns one result, stream yields chunks as they arrive, and batch runs inputs in parallel (cap it with config={"max_concurrency": 5}). Each has an async twin such as ainvoke.
  5. What message types are there? SystemMessage, HumanMessage, AIMessage and ToolMessage, imported from langchain.messages. An AIMessage carries tool_calls and usage metadata.
  6. How do you define a tool? Decorate a function with @tool. Its name comes from the function, its description from the docstring, and type hints are required because they define the input schema. Pass args_schema for a custom Pydantic schema.
  7. bind_tools or create_agent? model.bind_tools([get_weather]) lets the model emit tool_calls, but your code must execute them and send results back. create_agent runs that loop for you.
  8. What is the agent loop? The model is called, chooses tools, the tools run, their results come back as tool messages, and the loop repeats until the model answers without calling a tool.
  9. How do you set the system prompt? create_agent(..., system_prompt="...") takes a string or a SystemMessage. For prompts that change at runtime, use middleware such as the @dynamic_prompt decorator.
  10. How do you get structured output? For a single model call, model.with_structured_output(Schema). For agents, response_format= with ProviderStrategy (provider-native) or ToolStrategy (via tool calling); the result is in result["structured_response"]. Schemas can be Pydantic models, TypedDicts or JSON Schema.

Intermediate LangChain questions (11–20)

  1. What can you pass to create_agent? model, tools, system_prompt, response_format, middleware, a checkpointer, state_schema for custom state, context_schema for per-run context, and a name for use in multi-agent systems.
  2. What is agent state? AgentState, a typed dictionary holding the message history and any custom fields. Subclass it and pass state_schema= to add fields such as a counter.
  3. Which middleware hooks exist? before_agent, before_model, wrap_model_call, after_model, wrap_tool_call and after_agent, available as decorators or as methods on a middleware class.
  4. Name some built-in middleware. SummarizationMiddleware, HumanInTheLoopMiddleware, ModelRetryMiddleware, ToolRetryMiddleware, ModelFallbackMiddleware, ModelCallLimitMiddleware, ToolCallLimitMiddleware, PIIMiddleware and LLMToolSelectorMiddleware.
  5. How does short-term memory work? Pass a checkpointer, InMemorySaver() in development or a database-backed one such as PostgresSaver in production, and invoke with config={"configurable": {"thread_id": "1"}}. Reusing the thread ID continues the conversation.
  6. Checkpointers versus stores? Per the LangGraph docs, checkpointers persist one thread's graph state (short-term, thread-scoped memory); stores persist application data across threads, such as user preferences (long-term memory). Most apps use both.
  7. How do tools get runtime information? Add a runtime: ToolRuntime parameter to read runtime.state, runtime.context (per-run data such as a user ID, typed by context_schema) and the store. The docs recommend it over the older InjectedState patterns.
  8. Describe a RAG pipeline in LangChain. Load documents with loaders, split them (the docs use RecursiveCharacterTextSplitter from langchain_text_splitters with chunk_size=1000 and chunk_overlap=200), embed, store in a vector store, retrieve with similarity_search or as_retriever(), and generate with the retrieved context.
  9. 2-step RAG or agentic RAG? 2-step RAG always retrieves, then generates: predictable and fast. Agentic RAG gives the agent a retrieval tool and lets it decide when and how to search: more flexible, variable latency. The docs also describe hybrids with validation steps.
  10. How do you stream agent progress? The current docs stream an agent with agent.stream_events(..., version="v3") and read intermediate state from the stream, so users see tool calls before the final answer; model.stream() streams a single model's output.

Experienced and senior LangChain questions (21–30)

  1. Why does create_agent run on LangGraph? It returns a compiled LangGraph graph, and middleware hooks run inside it, so persistence, streaming and interrupts come for free. You can drop the whole agent in as a node of a larger StateGraph for routing, fan-out or deterministic steps.
  2. How do you add a human approval step? HumanInTheLoopMiddleware(interrupt_on={"send_email": True}) pauses before that tool runs. With a checkpointer, resume on the same thread with Command(resume=...).
  3. What happens when a LangGraph node resumes after interrupt()? The whole node restarts from the beginning, not from the interrupt line. Side effects before interrupt() must be idempotent, the payload must be JSON-serializable, and the docs warn against while True loops with interrupt() in one node.
  4. How do you stop a runaway agent? The docs say create_agent sets the recursion limit to 9,999 steps. Pass a lower recursion_limit in the invoke config, or cap calls with ModelCallLimitMiddleware and ToolCallLimitMiddleware.
  5. How do you handle provider failures? Retry and fallback middleware (ModelRetryMiddleware, ModelFallbackMiddleware, ToolRetryMiddleware) handle rate limits and transient errors at the harness level, so tools need no retry code; set timeouts on the model too.
  6. How do you manage the context window? SummarizationMiddleware compresses history before it overflows; trim large tool outputs; delegate big subtasks to subagents with their own isolated context.
  7. How do you add guardrails? Deterministic middleware that does not rely on the prompt, such as PIIMiddleware for detecting PII, plus checks before tool results reach the model or before output reaches the user.
  8. How do you trace and evaluate? LangSmith tracing is enabled with environment variables such as LANGSMITH_TRACING=true and LANGSMITH_API_KEY, optionally LANGSMITH_PROJECT. Then build datasets of real inputs and run evaluators on every prompt or model change.
  9. How do you build multi-agent systems? A supervisor agent calls specialized subagents as tools, each in its own context, or a LangGraph workflow routes between agents. LangChain's Deep Agents builds on create_agent with planning, filesystem tools, subagents and memory.
  10. How do you migrate pre-1.0 code? Replace create_react_agent with create_agent and prompt= with system_prompt=; move pre_model_hook and post_model_hook logic into middleware; switch prompted structured output to ToolStrategy or ProviderStrategy; import LLMChain and other legacy pieces from langchain_classic or rewrite them.

LangChain scenario and troubleshooting questions

The agent keeps calling the same search tool. The tool's output is unhelpful or its description is vague. Improve the description and return concise, decisive results; add ToolCallLimitMiddleware or a lower recursion limit; tell the model in the system prompt when to stop.

The agent forgets the previous message. No checkpointer, or a new thread_id on every request. Use a database-backed checkpointer and pass the user's thread ID each turn.

Structured output fails intermittently. Use ProviderStrategy where the model supports native structured output and ToolStrategy elsewhere, simplify the schema, and validate with Pydantic so failures are explicit.

After an approval, the email was sent twice. The send happened in the same node before interrupt(), and the node re-ran on resume. Move the side effect after the interrupt, into its own node, or make it idempotent with a key.

RAG answers cite the wrong document. Evaluate retrieval separately from generation: check chunk size and overlap, the same embedding model at index and query time, metadata filters, the number of results and reranking, using a LangSmith dataset of known question-and-source pairs.

How LangChain interviews test this

FormatWhat it usually looks likeHow to prepare
Concept Q&AAgents versus chains, tools, structured output, memory, LangChain versus LangGraphAnswer with 1.x APIs; avoid pre-1.0 idioms unless asked
Build exerciseAn agent with two tools, memory and structured output, sometimes as a take-homeBuild one with a checkpointer and human approval
System designA support bot or research assistant: retrieval, guardrails, evaluation, costSee agentic AI interview questions for the design side
Production debuggingLoops, memory loss, bad retrieval, flaky output, latencyUse the five scenarios above as rehearsal prompts

Broader GenAI questions are in generative AI interview questions, and storage choices in vector database interview questions.

Where CoPilot Interview fits

CoPilot Interview is an AI interview assistant. Its free AI mock interview builds LangChain, LLM and agent questions from your résumé and the job description, reads them aloud and scores each spoken answer out of 10, which is a fast way to find the answers above that you know but cannot yet explain cleanly under pressure. The browser demo has 145 practice questions in 10 tracks, scores typed answers out of 10 and needs no signup. The free plan gives 15 minutes a day of live help in sessions of up to 15 minutes, with AI mock interviews included. Paid plans are Standard at $24.99 a month and Pro at $39.99 a month, in the desktop app for Windows 10/11 and macOS 12 or later.

Use it to practice. Online assessments, proctored tests, take-home tasks with rules and AI-led rounds forbid outside help, so prepare for those instead of bringing a tool. For any live interview, follow your employer's rules.

Disclosure: CoPilot Interview is our product, so weigh what we say about it accordingly.

Frequently asked questions

What are the most common LangChain interview questions?

What LangChain and LangGraph are, create_agent and the agent loop, defining tools, structured output, memory with checkpointers and thread IDs, middleware, RAG pipelines, human-in-the-loop, and tracing with LangSmith.

What is the difference between LangChain and LangGraph?

LangChain gives high-level building blocks and create_agent; LangGraph is the lower-level runtime for stateful graphs, with persistence, streaming and interrupts. create_agent returns a LangGraph graph.

Is LCEL still used in LangChain 1.x?

The Runnable interface in langchain-core still works, including the pipe operator for simple chains, but the v1 docs center on create_agent and middleware, and legacy chains such as LLMChain moved to langchain-classic.

What is the latest LangChain version?

PyPI listed langchain 1.5.0, released November 11, 2026, when we checked on November 17, 2026.

How do I prepare for a LangChain interview?

Build an agent with two tools, a checkpointer, a human approval step and structured output, trace it in LangSmith, break it with a vague tool description, and explain how you fixed it.

Practice this interview before the real one

The AI mock interview builds questions from your resume and the job description, reads them aloud and scores each spoken answer out of 10. Included on the free plan.

Start a mock interview