LangChain blueprint · Telecom
Support FAQ bot with semantic caching
A telecom FAQ bot that checks an embeddings-based semantic cache before running a LangChain RAG agent, purges cached answers when knowledge-base articles change, and hands low-confidence or account-specific chats to a human. It must never serve a cached answer that belongs to a different question, is based on an outdated article, or contains another customer's personal data.
- Steps
- 8
- Subjective questions
- 33
- Objective questions
- 33
The problem and the outcome
Problem: Telecom support receives the same questions again and again, such as roaming activation, recharge validity and SIM swap steps. Running full retrieval and an LLM call for every repeat is slow and expensive, and answers drift out of date when plans or policies change.
Outcome: Repeated questions are answered from the cache in one embedding lookup, misses still get grounded RAG answers with citations, and article edits remove the affected cached answers automatically. Customers with account-specific or unresolved issues reach a human agent with the full transcript.
Architecture
How it works, step by step
- The customer's message reaches the chat API, which redacts phone numbers, emails and account IDs and classifies intent. Account-specific questions (my bill, my balance) are marked to bypass the cache because their answers are personal.
- For FAQ intents, the redacted query is embedded and searched in the cache index, filtered by language and customer segment (for example prepaid vs postpaid). A hit above the tuned similarity threshold, whose linked article versions are still current, is returned immediately.
- On a miss, a LangChain agent built with create_agent and init_chat_model calls a retriever tool over the KB vector store. response_format forces a structured result: answer, cited article IDs, confidence and a needs_human flag; PIIMiddleware and model fallback middleware wrap the model calls.
- The confidence gate sends a grounded, cited answer to the customer. If the intent is generic and confidence is high, it writes the query vector, answer, segment and cited article IDs with versions into the cache, with a TTL as a backstop.
- If confidence is low, no article supports the answer, the customer asks for a person, or the question needs account access, the chat is handed to a human agent. The agent sees the thread history saved by the checkpointer so the customer does not repeat themselves.
- When an editor publishes, edits or retires an article in the CMS, a webhook emits a change event with the article ID and new version onto a queue.
- The reindex worker re-chunks and re-embeds the changed article in the KB vector store, then deletes every cache entry tagged with that article ID. Purging is done before or together with the reindex so no stale answer survives the change.
- Tracing records cache hit/miss, similarity scores, handoffs and customer feedback. Sampled cache hits and human resolution labels are reviewed to tune the threshold and catch false hits.
Tech stack
- LangChain v1 create_agent with init_chat_model
- PIIMiddleware and model fallback middleware
- LangGraph checkpointer (Postgres) for thread memory
- Vector store with metadata filters (e.g. pgvector or Redis) for cache and KB
- Embedding model shared by cache and retriever
- Document loaders and text splitters for KB ingestion
- Message queue (e.g. Kafka or SQS) for article change events
- LangSmith for tracing and feedback
Key design decisions
- Keep the semantic cache outside the agent, in front of it, so a hit skips the model call entirely instead of being one more tool the model may or may not use.
- Store cited article IDs and versions on every cache entry and invalidate by tag on article change; TTL is only a safety net, not the main freshness mechanism.
- Partition cache lookups by language and customer segment, because the same question can have different correct answers for prepaid and postpaid users.
- Only cache answers that are generic, grounded in cited articles and above the confidence bar; personal or account-specific answers are never cached.
- Handoff is decided by a deterministic gate reading the structured output plus explicit customer requests, rather than trusting free-text model judgement alone.
Common mistakes
- False cache hits on near-identical wording with opposite meaning, such as 'activate roaming' vs 'deactivate roaming'; tune the threshold on labelled pairs and consider a reranker or keyword check for negations.
- Caching an answer that contains personal data or account details, then serving it to another customer.
- Re-embedding the KB but forgetting to purge the cache, so old plan prices or policies keep being served from cached answers.
- Changing the embedding model without rebuilding the cache index, which makes old vectors incomparable with new queries.
- Hindi, English and Hinglish versions of the same question landing in different cache regions, lowering hit rate unless the embedding model handles multilingual input.
What to measure
- Cache hit rate and model calls saved per day
- False-hit rate from sampled review of cache hits
- Time from article publish to cache purge completion
- Handoff rate and customer satisfaction after handoff
- Cost and latency per resolved conversation, split by hit vs miss
Most-asked interview questions
Subjective questions 33
1How do you invalidate a semantic cache when knowledge-base articles change?Asked almost every time
I treat article lineage as part of every cache entry. When the RAG agent produces an answer, the structured output includes cited article IDs, and I store those IDs and versions with the cached answer. The CMS emits a change event on publish, edit or retire. A worker consumes it, deletes all cache entries tagged with that article ID, and re-chunks and re-embeds the article in the KB vector store. On a cache hit I also check that the stored versions match current ones, which covers races. A TTL sits underneath as a backstop for anything missed. I also track time from publish to purge so editors know when the bot reflects their change.
Sourced from Docs by LangChain (MCP)
2Walk me through the end-to-end architecture of this telecom FAQ bot.Asked almost every time
The chat API receives the message, redacts phone numbers, emails and account IDs, and classifies intent. Account-specific intents skip the cache and go to the agent or a human. FAQ intents are embedded and searched in a cache index filtered by language and segment. A hit counts only if it is above the tuned threshold and its linked article versions are still current. On a miss, a create_agent agent calls a retriever tool over the KB vector store and returns a structured answer with citations, confidence and a needs_human flag. A confidence gate either answers, caches generic high-confidence results, or hands off to a human. A separate path handles CMS change events: re-embed the article and purge tagged cache entries. Tracing closes the loop.
Sourced from Docs by LangChain (MCP)
3Why do you redact personal data before embedding the query and checking the cache?Asked almost every time
There are two reasons: privacy and hit quality. If raw phone numbers or account IDs were embedded, the cache key would carry personal data. A stored entry could also leak one customer's details to another through a near match. Redaction also makes queries more uniform. "Why was 98xxxxxxx charged roaming" and the same question with a different number collapse to one pattern, which improves reuse. Redaction alone is not the full defence, though. Answers about a specific account still bypass the cache entirely, because the answer itself is personal even when the query looks generic. PIIMiddleware on model calls adds a second layer in case something slips past the API redaction.
Sourced from Docs by LangChain (MCP)
4Describe the data model of a single semantic cache entry.Asked almost every time
Each entry holds an ID, the redacted query text and its vector, and the embedding model name and version. It also holds the language, the customer segment, the intent label, the answer text, and a list of cited article IDs, each with the version used. Then it holds the created time, the TTL expiry, and the generating model plus trace ID for audit. The article IDs need to be filterable metadata, because the reindex worker deletes by article ID. The versions let the read path reject an entry whose article has moved on. Storing the embedding model version prevents mixing vectors from different models. No customer identifiers are stored, because entries are shared across customers.
Sourced from Docs by LangChain (MCP)
5How would you pick the similarity threshold for the semantic cache?Very often asked
I would not guess a number. I build a labelled set of query pairs from real logs: true paraphrases, and tricky near-misses like activate versus deactivate roaming or prepaid versus postpaid. I sweep thresholds and look at precision of hits, because a wrong cached answer costs more than a miss. I pick the point where false hits are acceptably rare, then watch it in production by sampling hits for review and using thumbs-down and human resolution labels. Metadata filters for language and segment reduce the burden on the threshold. If negation errors remain, I add a cheap check such as a reranker or keyword guard before serving.
Sourced from Docs by LangChain (MCP)
6When should the bot hand off to a human, and how do you make the handoff smooth?Very often asked
Handoff triggers should be explicit and testable: the customer asks for a person, the question needs account access like billing disputes or SIM swaps, the structured output reports low confidence or no supporting article, or the conversation keeps looping. I use a deterministic gate on the response_format fields rather than parsing free text. For smoothness, the thread is persisted with a LangGraph checkpointer, so the human agent receives the full transcript, the retrieved articles and the detected intent. The customer should not have to repeat anything. Human resolutions are then fed back as labels to improve the KB and cache rules.
Sourced from Docs by LangChain (MCP)
7Why must cache lookups be filtered by language and customer segment rather than relying on similarity alone?Very often asked
Two questions can be almost identical in meaning yet have different correct answers. "How do I check my data usage" may have one answer for prepaid and another for postpaid. The embeddings will be very close, so the similarity score cannot tell them apart. Filtering by segment as metadata makes a wrong-segment answer impossible, not just unlikely. Language works the same way. A Hindi speaker should get the Hindi answer, and a cross-lingual embedding could otherwise return an English cached answer. These are hard partitions applied before ranking. The similarity threshold then only has to separate paraphrases from different questions within the same partition.
Sourced from Docs by LangChain (MCP)
8If the reindex worker already purges entries on article change, why also check article versions on every cache read?Very often asked
Purging is asynchronous and can fail or lag. The webhook might be delayed, the queue might back up, or a delete might partly fail. A version check at read time compares each cited article's stored version with the current version registry. That closes the window between publish and purge, so a stale answer is never served even while the purge is pending. It is cheap, because it is a key lookup on a small set of article IDs. Think of purging as keeping the cache clean and the version check as the correctness guarantee. The TTL is a third backstop for anything both miss.
Sourced from Docs by LangChain (MCP)
9How do you stop a race where an answer generated from an old article version is written to the cache after the purge has already run?Very often asked
The agent may start on a cache miss, retrieve article v3, and still be generating while v4 is published and the purge runs. If it then writes its answer, a stale entry appears after the purge. The fix is a conditional write. Before inserting, compare the cited article versions in the answer with the current version registry, and skip the write if any are outdated. The read-time version check is a second guard, because even if the write slipped through, the entry would be rejected on lookup. Storing the version with each retrieved chunk is what makes this possible. The structured output only gives article IDs, so the versions should come from the retrieved chunk metadata.
Sourced from Docs by LangChain (MCP)
10What happens if the intent classifier labels an account-specific question as a generic FAQ?Very often asked
That is the riskiest failure, so I would design for it. First, set the classifier's operating point to favour bypassing: when unsure, treat the question as account-specific, since a missed cache hit only costs latency. Second, use cheap rules alongside the model, such as possessives with billing terms or redaction placeholders in the query. Third, the agent's structured output has a needs_human flag, and a question needing account access triggers handoff. Fourth, at write time, block caching if the answer contains redaction placeholders or personal patterns. Finally, sample cached entries in review to catch misrouted intents and retrain.
Sourced from Docs by LangChain (MCP)
11The chat API already redacts PII. Why also add PIIMiddleware to the agent?Very often asked
It is defence in depth at a different boundary. API redaction handles the inbound customer message. During the agent loop, though, personal data could enter through other paths: retrieved content, tool results, earlier thread history, or a format the API regex missed. PIIMiddleware runs around model calls and can redact, mask or block types such as email and phone. That protects both what goes to the model provider and what comes back. It also lowers the chance that an answer containing personal data reaches the cache write step. I would still keep a separate check at the cache write, because caching shared data has the highest privacy risk.
Sourced from Docs by LangChain (MCP)
12The model reports a confidence field. Can you trust it for the gate?Very often asked
Not on its own. Self-reported confidence from an LLM is often poorly calibrated, and it can be confidently wrong. I would combine it with objective signals. Did the retriever return chunks above a relevance floor? Are the cited article IDs actually among the retrieved chunks? Is the article current? Is the intent on the list of intents allowed in the cache? The gate treats model confidence as one input. Answering requires grounding, and caching requires the strictest combination. Over time, compare confidence with human resolution labels and feedback from tracing, and calibrate the threshold per intent rather than using a single global number.
Sourced from Docs by LangChain (MCP)
13How do you verify that the cited article IDs in the structured output are real?Very often asked
After the agent returns, check each cited ID against the set of chunks the retriever tool actually returned in that run. Then check it against the current version registry. If the model cites an ID it never retrieved, or an article that is retired, treat the answer as ungrounded and either retry or hand off. If no valid citations remain, the step five rule applies: no supporting article means handoff. This check matters most for caching. The cited IDs are the invalidation tags, so a wrong or missing ID means the entry would never be purged when the real source article changes.
Sourced from Docs by LangChain (MCP)
14How do you make the CMS change pipeline reliable when webhooks can be duplicated, delayed or lost?Very often asked
Assume at-least-once delivery. The webhook handler should write the event to a durable queue and acknowledge quickly. The worker processes events idempotently, keyed by article ID and version, so a duplicate repeats a harmless purge and reindex. Failed events retry with backoff and go to a dead-letter queue with an alert. For lost webhooks, run a periodic reconciliation job. It compares CMS article versions with the version registry and KB index, and emits events for any mismatch. The read-time version check and the TTL limit the damage while the pipeline catches up. Tracing should show the lag from publish to purge.
Sourced from Docs by LangChain (MCP)
15Why purge the cache before or together with the reindex instead of after it finishes?Very often asked
Reindexing takes time, because chunking and embedding a long article is not instant. If you purge only afterwards, the old cached answers stay valid-looking for that whole window and can be served after the editor has published a correction. That might be a wrong tariff or a withdrawn offer. Purging first means that during the window, queries miss the cache and go to the agent. The agent may still see old chunks briefly, which is why version checks at write time matter. The cost of purging early is a short burst of extra agent calls. That is a cheap price compared with serving an outdated answer.
Sourced from Docs by LangChain (MCP)
16How do you handle follow-up turns like "and for postpaid?" with the semantic cache?Very often asked
The bare follow-up has almost no meaning on its own, so embedding it would match random entries or nothing. There are two safe options. First, rewrite the turn into a standalone question using the thread context, such as "how do I activate international roaming on postpaid". Then redact it, re-evaluate segment and intent, and look it up. Second, bypass the cache for context-dependent turns and let the agent answer with the thread history. Rewriting improves the hit rate but adds a model call, and a bad rewrite can cause a false hit. I would start by bypassing and add rewriting once evaluation showed it was reliable.
Sourced from Docs by LangChain (MCP)
17Could a malicious user poison the shared cache, and how do you prevent it?Very often asked
Yes. A user might use prompt injection to make the agent produce a misleading answer, which would then be cached and served to everyone with similar questions. The defences come in layers. Cache only generic intents with high confidence and valid citations to current articles. Check that the answer is grounded in retrieved text rather than in user-supplied instructions. Keep the system prompt firm that the KB is the only source. Consider caching only when the query matches a known FAQ topic. Rate-limit cache writes per session. Sample cache entries for review, and provide a manual purge-by-entry tool so a bad answer can be removed at once.
Sourced from Docs by LangChain (MCP)
18Which metrics would you put on the dashboard for this system?Very often asked
For the cache, track hit rate per intent, language and segment; the similarity score distribution for hits and near misses; the false-hit rate from sampled reviews; and stale-rejection counts from the version check. For the agent, track latency for hits and misses, model fallback rate, structured output failures, the confidence distribution, and citation validation failures. For handoffs, track the rate by reason: low confidence, no article, user asked for a person, or account access. For freshness, track lag from CMS publish to purge and dead-letter queue depth. For outcomes, track customer feedback and human resolution labels.
Sourced from Docs by LangChain (MCP)
19How would you build an evaluation set to test the cache before go-live?Very often asked
Use three kinds of pairs from redacted historical queries. First, true paraphrases that should share an answer. Second, near-miss pairs that look alike but differ: activate versus deactivate roaming, prepaid versus postpaid, a daily pack versus a monthly pack. Third, account-specific questions that must never hit. Label each pair with whether the answer should be shared. Run the embedding, threshold, filters and intent classifier over the set, and measure false hits and missed reuse per intent. Also include staleness tests: edit an article and confirm its entries are purged and rejected. Re-run the set whenever the embedding model, threshold or classifier changes.
Sourced from Docs by LangChain (MCP)
20What is the TTL for in this design, and how would you choose its value?Often asked
The TTL is a backstop, not the main invalidation mechanism. It limits how long an entry can survive if both the purge and the version check fail. Examples are an article edited outside the CMS, a missed webhook, or a bug in tagging. It also ages out answers that depend on things the CMS does not track, such as a policy explained in a system prompt. I would choose it from how often articles change and how costly a stale answer is. Plan and tariff topics would get shorter TTLs than stable how-to content. I would check the effect on hit rate in tracing, since too short a TTL wastes the cache.
Sourced from Docs by LangChain (MCP)
21How would you estimate the storage size of the cache index?Often asked
Start with the number of distinct generic questions you expect to cache within the TTL window. FAQ traffic tends to concentrate on a limited set of topics, but you should measure that from logs rather than assume it. Vector storage is roughly entries times dimensions times bytes per value. For example, 100,000 entries at 1,024 float32 dimensions is about 410 MB. Add the index overhead, which depends on the index type, and add the metadata and answer text. Multiply by the number of language and segment partitions if entries are duplicated per partition. Even generous estimates usually fit in one vector store node, so lookup latency matters more than storage.
Sourced from Docs by LangChain (MCP)
22How do you keep cache lookup latency low enough that the cache is worth it?Often asked
A cache hit costs one embedding call, one filtered nearest-neighbour search, and one version check. Use a fast embedding model, and keep it on the same model as the cache vectors. Use an approximate index with metadata filtering that runs efficiently, rather than filtering after the search. Keep the article version registry in a fast key-value store. Run the lookup with a strict timeout. If it times out, fall through to the agent instead of failing the request. Reuse the query embedding for KB retrieval where the models match, so a miss does not pay twice. Measure the p95 of the hit path in tracing against the miss path.
Sourced from Docs by LangChain (MCP)
23Model fallback middleware switches to a backup model during an outage. What should you watch out for?Often asked
The fallback model may differ in quality, refusal behaviour, structured output reliability and calibration of its confidence field. The confidence gate may then let through answers that would not pass with the primary model. I would record which model produced each answer in tracing. I would also consider not writing fallback-generated answers to the shared cache, or applying a stricter confidence bar to them, so an outage does not fill the cache with weaker answers for the whole TTL. Test the fallback model with response_format in advance, because a model that often fails schema validation turns a provider outage into a flood of human handoffs.
Sourced from Docs by LangChain (MCP)
24What if change events for the same article arrive out of order, for example v5 before v4?Often asked
The worker should never move an article backwards. Keep the current version per article in the registry and apply an event only if its version is newer. A late v4 after v5 is then dropped, apart from a purge, which is always safe. The reindex should fetch the latest published content from the CMS rather than trusting the event payload, so the result matches the CMS. Partitioning the queue by article ID keeps events for one article in order, but the version comparison is what guarantees correctness. Out-of-order events then cost only extra work, never stale content.
Sourced from Docs by LangChain (MCP)
25How does retiring an article differ from editing one in this pipeline?Often asked
An edit replaces content: re-chunk, re-embed, swap in the new chunks and purge cache entries tagged with the article. A retirement removes content. The worker must delete the article's chunks from the KB vector store, purge every cache entry tagged with it, and mark it retired in the version registry. The read-time check then rejects any entry citing it. If the retired article was the only source for some answers, later queries on that topic may find no support and go to a human. That is correct behaviour. Tracing will show a rise in handoffs on that topic, which tells editors a replacement article is needed.
Sourced from Docs by LangChain (MCP)
26Why expose retrieval as a tool to a create_agent agent instead of a fixed retrieve-then-generate chain?Often asked
A tool lets the model reformulate a query, search again when the first results are weak, or decide that no article supports an answer and set needs_human. A fixed chain always does one retrieval and then generates, which is simpler, cheaper and more predictable. For a FAQ bot the trade-off is real. I would keep the tool set small, possibly only the retriever, and cap iterations with the model call limit middleware so cost and latency stay bounded. If evaluation showed single-shot retrieval was good enough, a two-step chain would be an acceptable choice too.
Sourced from Docs by LangChain (MCP)
27How does the checkpointer support the human handoff, and what privacy concerns does it raise?Often asked
The checkpointer stores thread-scoped state under a thread ID, including the message history. When the chat moves to a human, the agent console loads that thread, so the customer does not have to repeat the issue. The concern is that the history may contain personal data, especially for account questions. Apply the same redaction rules to what is stored where possible. Restrict console access by role, and set a retention period that follows telecom and data protection rules. Never let checkpointer content feed the shared semantic cache. Cache writes use only the redacted generic query and the grounded answer.
Sourced from Docs by LangChain (MCP)
28How do you detect false cache hits after launch?Often asked
False hits are silent, because the customer gets a fluent answer to the wrong question. Sample cache hits regularly, stratified by similarity score, with extra weight near the threshold. Have reviewers label whether the cached question and the new question truly share an answer. Watch for cache hits followed by negative feedback, a rephrase or a request for a human, which are strong signals. Compare with human resolution labels when those chats escalate. Feed confirmed false pairs into the evaluation set. Then tighten the threshold for that intent or add a rule, such as keeping activate and deactivate apart.
Sourced from Docs by LangChain (MCP)
29Should Hindi and English versions of the same question share a cache entry?Often asked
I would keep them separate. The filter is by language, so each language has its own entries and answers. Even if a multilingual embedding places them close together, the customer must get an answer in their own language. Translating a cached answer on the fly adds latency and risk. Code-mixed input, such as Hinglish, is common, so language detection needs a clear rule for which partition that input goes to. Separate partitions slightly lower hit rates for less common languages, but they keep answers correct and make review simpler.
Sourced from Docs by LangChain (MCP)
30Could you implement the cache with a LangGraph store instead of a dedicated vector database?Often asked
LangGraph stores hold JSON documents by namespace and key, with optional semantic search. A namespace like language and segment maps naturally to the partitions, so it is a workable option for modest volume. The key requirement here, though, is bulk deletion by article ID across all entries, along with efficient filtered nearest-neighbour search and tight latency. A dedicated vector store with metadata filters and delete-by-filter usually suits that better. I would choose based on whether the store can do a fast, reliable delete of every entry tagged with an article ID, because invalidation correctness matters more than convenience.
Sourced from Docs by LangChain (MCP)
31When is a semantic cache not worth adding?Often asked
It is not worth it when traffic is spread thinly across many distinct questions so hits are rare, or when most questions are account-specific and must bypass the cache anyway. It is also not worth it when articles change so often that entries are purged before reuse, or when the agent path is already fast and cheap enough. Each lookup adds an embedding call and a search to every FAQ request. A false hit costs more than a miss, because it is a wrong answer delivered with confidence. I would measure potential hit rate from logs offline first, by replaying redacted historical queries against a simulated cache, before building it.
Sourced from Docs by LangChain (MCP)
32How would you warm the cache at launch?Sometimes asked
Take the most common generic questions from historical chat logs and search queries, redacting them first. Group paraphrases together, and run each representative question through the normal agent path. Write only the answers that pass the same confidence, citation and intent rules as live traffic. Have editors spot-check the warm set before launch. Do not hand-write answers straight into the cache, because that bypasses grounding and citation tags, and those tags are needed for invalidation. Warming improves early hit rates, but live traffic will quickly reshape the cache anyway.
Sourced from Docs by LangChain (MCP)
33Where, if anywhere, would HumanInTheLoopMiddleware fit in this design?Sometimes asked
HumanInTheLoopMiddleware interrupts before specific tool calls, with allowed decisions of approve, edit or reject. It suits tools with side effects. The FAQ agent's retriever is read-only, so it does not need approval. Handoff in this design is a different mechanism, where the whole conversation is routed to a human agent. If the bot later gained action tools, such as raising a ticket or changing a plan, I would set interrupt_on for those tools so a human approves or edits the call before it runs. That keeps the cheap read path automatic and gates only the actions that change something.
Sourced from Docs by LangChain (MCP)
Objective questions 33
1In LangChain v1 Python, which function builds the FAQ agent from a model, tools and an optional system prompt?Asked almost every time
Why: LangChain v1 builds agents with create_agent (createAgent in JS), which runs the model-tool loop on LangGraph.
Sourced from Docs by LangChain (MCP)
2Which create_agent option forces the agent to return answer, cited IDs, confidence and needs_human as fields?Asked almost every time
Why: Structured output in LangChain v1 is configured with response_format.
Sourced from Docs by LangChain (MCP)
3A customer asks, "Why is my balance lower than yesterday?" What should the pipeline do?Asked almost every time
Why: Account-specific questions are marked to bypass the cache, because their answers depend on the individual customer's data.
Sourced from Docs by LangChain (MCP)
4Which conditions must all hold before a cached answer is returned?Asked almost every time
Why: Lookups are filtered by language and segment, and a hit must clear the threshold and have current article versions.
Sourced from Docs by LangChain (MCP)
5An editor edits article A-17. What does the reindex worker delete from the cache?Asked almost every time
Why: The worker deletes every cache entry tagged with the changed article's ID.
Sourced from Docs by LangChain (MCP)
6What is the main risk of setting the similarity threshold too low?Asked almost every time
Why: A low threshold accepts less similar queries, so the cache returns answers that belong to different questions.
Sourced from Docs by LangChain (MCP)
7Which kind of answer should never be written to the shared semantic cache?Very often asked
Why: Account-specific answers contain personal data and are only correct for one customer. Caching them risks leaking data and serving wrong answers to others.
Sourced from Docs by LangChain (MCP)
8How does the workflow initialise the chat model in LangChain v1?Very often asked
Why: Models are initialised with init_chat_model using a "provider:model" string.
Sourced from Docs by LangChain (MCP)
9What text is embedded for the cache lookup?Very often asked
Why: Phone numbers, emails and account IDs are redacted first, and then the redacted query is embedded and searched.
Sourced from Docs by LangChain (MCP)
10When should the cache purge happen relative to the reindex?Very often asked
Why: Purging before or together with the reindex ensures no stale answer survives the change.
Sourced from Docs by LangChain (MCP)
11What role does the TTL on cache entries play?Very often asked
Why: The workflow uses a TTL only as a backstop. Purging on change events and version checks are the main controls.
Sourced from Docs by LangChain (MCP)
12Which actions can PIIMiddleware take on detected types such as email and phone?Very often asked
Why: PIIMiddleware supports redact, mask and block strategies for PII types.
Sourced from Docs by LangChain (MCP)
13What does model fallback middleware do?Very often asked
Why: Model fallback middleware tries the configured fallback models in order when a model call fails.
Sourced from Docs by LangChain (MCP)
14What gives the human agent the customer's conversation history after a handoff?Very often asked
Why: Short-term memory is thread-scoped through the checkpointer, so the human agent can see the saved thread history.
Sourced from Docs by LangChain (MCP)
15What should the CMS change event put on the queue?Very often asked
Why: The webhook emits a change event containing the article ID and its new version.
Sourced from Docs by LangChain (MCP)
16The webhook delivers the same change event twice. What is the right worker design?Very often asked
Why: With at-least-once delivery, idempotent handling keyed by article ID and version makes duplicates harmless.
Sourced from Docs by LangChain (MCP)
17Which situation should NOT trigger a handoff to a human?Very often asked
Why: High-confidence, grounded answers to generic questions go straight to the customer. The other cases are handoff triggers.
Sourced from Docs by LangChain (MCP)
18Why does each cache entry store the cited article IDs together with their versions?Very often asked
Why: The IDs are the purge tags, and the versions let the read path reject entries built on outdated articles.
Sourced from Docs by LangChain (MCP)
19"How do I activate roaming?" and "How do I deactivate roaming?" score very high similarity. What does this show?Very often asked
Why: Opposite intents can embed close together, so you need near-miss test pairs, per-intent tuning or rules to stop false hits.
Sourced from Docs by LangChain (MCP)
20After a miss, when does the gate write the answer to the cache?Very often asked
Why: Only generic, high-confidence answers are cached, together with the vector, segment, and cited article IDs and versions.
Sourced from Docs by LangChain (MCP)
21What is the most reliable way to find false cache hits in production?Very often asked
Why: The workflow reviews sampled hits and human resolution labels to tune the threshold and catch false hits.
Sourced from Docs by LangChain (MCP)
22In LangChain v1, how do you get the RAG agent to return answer, cited IDs and confidence as fields?Often asked
Why: response_format on create_agent produces structured output. The other options handle summarisation, tool approvals and thread memory.
Sourced from Docs by LangChain (MCP)
23Your team switches to a new embedding model for the KB. What must also happen to the semantic cache?Often asked
Why: Vectors from different embedding models are not comparable, so similarity scores between new queries and old cached vectors are meaningless until the index is rebuilt.
Sourced from Docs by LangChain (MCP)
24Which decisions does HumanInTheLoopMiddleware allow on an interrupted tool call?Often asked
Why: interrupt_on is configured per tool, and the allowed decisions are approve, edit and reject.
Sourced from Docs by LangChain (MCP)
25How is long-term memory organised in LangGraph stores?Often asked
Why: LangGraph stores hold JSON documents by namespace and key, with optional semantic search.
Sourced from Docs by LangChain (MCP)
26What is the main cost of setting the similarity threshold too high?Often asked
Why: A very strict threshold rejects valid paraphrases, which lowers the hit rate and sends more traffic to the agent.
Sourced from Docs by LangChain (MCP)
27Which custom middleware hook lets you run logic around each tool execution?Often asked
Why: wrap_tool_call wraps tool execution. wrap_model_call, before_model and after_model act around model calls.
Sourced from Docs by LangChain (MCP)
28A follow-up turn says only "and for postpaid?" What is the safe handling?Often asked
Why: Context-dependent fragments carry little meaning on their own, so they need a standalone rewrite or a cache bypass to avoid false hits.
Sourced from Docs by LangChain (MCP)
29An article is retired in the CMS. What should the worker do?Often asked
Why: Retirement is a change event. Its content must leave the KB and every cached answer citing it must be purged.
Sourced from Docs by LangChain (MCP)
30Roughly how much raw vector storage do 100,000 cache entries of 1,024 float32 dimensions need?Often asked
Why: 100,000 × 1,024 × 4 bytes ≈ 409.6 million bytes, or about 410 MB, before index overhead and metadata.
Sourced from Docs by LangChain (MCP)
31Which configuration matches SummarizationMiddleware as described in the docs?Sometimes asked
Why: SummarizationMiddleware takes a trigger such as ("tokens", 4000) and a keep setting such as ("messages", 20).
Sourced from Docs by LangChain (MCP)
32How would you expose an MCP server's tools to this LangChain agent?Sometimes asked
Why: MCP tools are converted into LangChain tools with the MCP adapters, such as MultiServerMCPClient.
Sourced from Docs by LangChain (MCP)
33Is create_deep_agent the better choice for this FAQ bot?Sometimes asked
Why: create_deep_agent targets long, multi-step tasks. A short retrieve-and-answer FAQ loop is well served by create_agent.
Sourced from Docs by LangChain (MCP)
Track your progress through every blueprint in your dashboard.
Start learning