LangChain
You will learn the framework that popularised LLM application plumbing: prompts, model wrappers, memory, retrievers, tools, and the LCEL Runnable model that composes them. Interviewers ask about LangChain because it is the shared vocabulary for these apps, and they want to hear where its abstractions earn their keep and where you would drop to a raw client.
part ofAI agent & RAG frameworksoverview, primer and where to startread it →on this pageshowhide
explore
- Prompts & Templates6 questions
- LCEL & Runnables6 questions
- LLM & Chat Models6 questions
- Memory & State5 questions
- Retrievers & RAG7 questions
- Tools & Agents6 questions
questions
page 2 of 2How does LangChain's EnsembleRetriever combine BM25 and vector search results?
basics
~20 sBy reciprocal rank fusion, not by score arithmetic. EnsembleRetriever runs each wrapped retriever, converts every result to its rank position, sums weight divided by (c + rank) across retrievers, and returns the deduplicated candidates ordered by that fused score.
In LangChain, what does MultiQueryRetriever buy you, and what does it cost?
basics
~20 sMultiQueryRetriever asks an LLM to rewrite the question into several phrasings, runs the base retriever on each, and returns the deduplicated union. It buys recall against vocabulary mismatch; it costs one extra LLM call of latency and a larger, unranked document set.
When would you ship a fixed LangChain pipeline instead of create_agent?
basics
~20 sUse a fixed pipeline whenever the sequence of steps is known before the request arrives. An agent spends model calls deciding what you already know, adds latency variance and non-determinism, and makes evaluation and incident response markedly harder.
When does an LCEL chain stop being the right abstraction for a workflow?
basics
~10 sWhen the workflow needs cycles, durable state between turns, mid-run human approval, or per-step recovery. LCEL composes a directed, stateless pipeline; those requirements need a graph runtime with checkpointing, or plain imperative code.
How do you choose where LangChain conversation history lives for a multi-replica service?
basics
~20 sTreat the get_session_history factory as the seam and pick the backend from the requirements behind it: latency and TTL push toward a cache, durability and audit toward a database. Key by authenticated user plus conversation, bound each read, and set retention and deletion policy alongside.
How would you structure model selection across providers in a LangChain service?
basics
~20 sConstruct models from configuration with init_chat_model rather than importing provider classes at call sites, keep a small set of named tiers per task, and gate any switch behind evaluation — because capability differences leak through the shared interface even when the code compiles.
showing 31–36 of 36