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)
- 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.
- What changed in LangChain 1.0? Three things, per the v1 release notes:
create_agentbecame the standard way to build agents; messages gained a standardcontent_blocksproperty across providers; and the namespace was trimmed, with legacy chains, retrievers, indexes and hub moved tolangchain-classic. - How do you initialize a chat model?
init_chat_model("provider:model")fromlangchain.chat_models, or a provider class from its integration package, passing parameters such as temperature, max tokens and timeout. - What are invoke, stream and batch? The standard Runnable methods from
langchain-core:invokereturns one result,streamyields chunks as they arrive, andbatchruns inputs in parallel (cap it withconfig={"max_concurrency": 5}). Each has an async twin such asainvoke. - What message types are there?
SystemMessage,HumanMessage,AIMessageandToolMessage, imported fromlangchain.messages. AnAIMessagecarriestool_callsand usage metadata. - 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. Passargs_schemafor a custom Pydantic schema. - bind_tools or create_agent?
model.bind_tools([get_weather])lets the model emittool_calls, but your code must execute them and send results back.create_agentruns that loop for you. - 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.
- How do you set the system prompt?
create_agent(..., system_prompt="...")takes a string or aSystemMessage. For prompts that change at runtime, use middleware such as the@dynamic_promptdecorator. - How do you get structured output? For a single model call,
model.with_structured_output(Schema). For agents,response_format=withProviderStrategy(provider-native) orToolStrategy(via tool calling); the result is inresult["structured_response"]. Schemas can be Pydantic models, TypedDicts or JSON Schema.
Intermediate LangChain questions (11–20)
- What can you pass to create_agent?
model,tools,system_prompt,response_format,middleware, acheckpointer,state_schemafor custom state,context_schemafor per-run context, and anamefor use in multi-agent systems. - What is agent state?
AgentState, a typed dictionary holding the message history and any custom fields. Subclass it and passstate_schema=to add fields such as a counter. - Which middleware hooks exist?
before_agent,before_model,wrap_model_call,after_model,wrap_tool_callandafter_agent, available as decorators or as methods on a middleware class. - Name some built-in middleware.
SummarizationMiddleware,HumanInTheLoopMiddleware,ModelRetryMiddleware,ToolRetryMiddleware,ModelFallbackMiddleware,ModelCallLimitMiddleware,ToolCallLimitMiddleware,PIIMiddlewareandLLMToolSelectorMiddleware. - How does short-term memory work? Pass a checkpointer,
InMemorySaver()in development or a database-backed one such asPostgresSaverin production, and invoke withconfig={"configurable": {"thread_id": "1"}}. Reusing the thread ID continues the conversation. - 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.
- How do tools get runtime information? Add a
runtime: ToolRuntimeparameter to readruntime.state,runtime.context(per-run data such as a user ID, typed bycontext_schema) and the store. The docs recommend it over the olderInjectedStatepatterns. - Describe a RAG pipeline in LangChain. Load documents with loaders, split them (the docs use
RecursiveCharacterTextSplitterfromlangchain_text_splitterswithchunk_size=1000andchunk_overlap=200), embed, store in a vector store, retrieve withsimilarity_searchoras_retriever(), and generate with the retrieved context. - 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.
- 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)
- 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
StateGraphfor routing, fan-out or deterministic steps. - 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 withCommand(resume=...). - 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 againstwhile Trueloops withinterrupt()in one node. - How do you stop a runaway agent? The docs say
create_agentsets the recursion limit to 9,999 steps. Pass a lowerrecursion_limitin the invoke config, or cap calls withModelCallLimitMiddlewareandToolCallLimitMiddleware. - 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. - How do you manage the context window?
SummarizationMiddlewarecompresses history before it overflows; trim large tool outputs; delegate big subtasks to subagents with their own isolated context. - How do you add guardrails? Deterministic middleware that does not rely on the prompt, such as
PIIMiddlewarefor detecting PII, plus checks before tool results reach the model or before output reaches the user. - How do you trace and evaluate? LangSmith tracing is enabled with environment variables such as
LANGSMITH_TRACING=trueandLANGSMITH_API_KEY, optionallyLANGSMITH_PROJECT. Then build datasets of real inputs and run evaluators on every prompt or model change. - 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_agentwith planning, filesystem tools, subagents and memory. - How do you migrate pre-1.0 code? Replace
create_react_agentwithcreate_agentandprompt=withsystem_prompt=; movepre_model_hookandpost_model_hooklogic into middleware; switch prompted structured output toToolStrategyorProviderStrategy; importLLMChainand other legacy pieces fromlangchain_classicor 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
| Format | What it usually looks like | How to prepare |
|---|---|---|
| Concept Q&A | Agents versus chains, tools, structured output, memory, LangChain versus LangGraph | Answer with 1.x APIs; avoid pre-1.0 idioms unless asked |
| Build exercise | An agent with two tools, memory and structured output, sometimes as a take-home | Build one with a checkpointer and human approval |
| System design | A support bot or research assistant: retrieval, guardrails, evaluation, cost | See agentic AI interview questions for the design side |
| Production debugging | Loops, memory loss, bad retrieval, flaky output, latency | Use 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