Question library
Explained questions for the decisions developers make.
What is RAG?
RAG retrieves relevant external evidence and gives it to a model before answering. It lets the insurance assistant use current private policy documents and produce source-backed explanations instead of relying only on learned knowledge.
RAG or long context?
If the task already identifies a small permitted document set, long context may be simpler. For a large changing corpus, retrieval selects relevant evidence more efficiently. Both need access control, applicability checks, and answer evaluation.
How do you debug wrong RAG answers?
I inspect parsing, document version and permissions, chunk boundaries, candidate recall, ranking, supplied context, and answer support in that order. I score retrieval and generation separately, then improve the failing stage rather than automatically using a…
An answer cites a real document but is wrong. Why?
The cited document may be irrelevant, expired, inapplicable, or missing an exception; the answer may also misinterpret it. I validate source eligibility and claim support, not just whether the link exists.
Embeddings
Beginner — Explain an embedding.
Explain an embedding.
It is a numerical vector that represents useful features of content, often meaning. Similar wording or meaning tends to produce nearby vectors, enabling retrieval of “vehicle collision” for a query about “car accident.”
What does cosine similarity tell you?
It compares vector direction and helps rank related content. A high score is not a probability that the passage is true or sufficient. I use a compatible metric and calibrate thresholds on domain-specific queries.
How do you upgrade embedding models?
I version models and index data, re-embed the intended corpus into a separate compatible space, evaluate filtered retrieval, and switch query/index routing together. I preserve source data and support rollback instead of mixing arbitrary old and new vectors.
Policy-code search fails despite good semantic search. What do you do?
I add exact identifier fields and lexical/hybrid retrieval. Embeddings may not preserve rare codes or precise numbers well. I test actual identifiers and keep them intact during query rewriting and text preprocessing.
Vector databases
Beginner — Why use a vector index?
Why use a vector index?
It makes repeated similarity queries efficient over a growing corpus. Small datasets can use exact comparison, but larger collections need indexing and careful metadata filtering for relevance and eligibility.
Exact versus approximate search?
Exact search examines eligible vectors thoroughly; approximate search trades some nearest-neighbor recall for speed and scale. I benchmark with realistic filters, corpus sizes, and query patterns rather than assuming ANN is always required.
Dedicated vector store or existing database?
I first test the existing database's vector capability against filtered recall, latency, lifecycle, security, and cost needs. A dedicated store is justified when it solves measured limitations enough to offset another operational dependency.
Unauthorized documents are removed after top-k, leaving no results. What is wrong?
The retrieval process selected candidates from an ineligible corpus. I move supported eligibility filters into retrieval and recheck object permissions before evidence reaches the model. Post-filtering alone can both underfill results and expose data upstream.
LangChain
Beginner — What does LangChain provide?
What does LangChain provide?
Reusable model, prompt, tool, and retrieval components and higher-level agent integrations. It helps compose applications but does not own domain security or guarantee output truth.
What is a chain?
A sequence of transformations or calls, such as prompt → model → parser. A chain can be deterministic and is not automatically an agent; an agent chooses some actions based on observations.
When would you avoid LangChain?
For a small direct API call with clear validation, plain SDK code may be easier to understand and maintain. I adopt abstractions when they reduce actual integration complexity and keep provider requests, costs, and failures inspectable.
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.