Think first When should NeMo Guardrails manage retrieval for a RAG app, and when should the app retrieve chunks itself?
Why it matters: Questions describe a RAG setup and ask which mode, knowledge base option or embedding search setting fits it.
NeMo Guardrails uses embedding search for both its rails and its knowledge base. In a RAG app, you either let it manage retrieval from a configured knowledge base, or retrieve chunks yourself and pass them in.
Reported, thanks
Step 2 of 10
Term
Meaning
Knowledge Base mode
You configure a knowledge base in the guardrails config, and NeMo Guardrails manages retrieval.
Relevant Chunks mode
Your app performs retrieval and passes the chunks directly to the generate method.
EmbeddingsIndex
The class you subclass to build a custom embedding search provider.
Embedding cache
Stores computed embeddings so they are not recomputed; disabled by default.
NVIDIARAGToolConfig
The NeMo Agent Toolkit tool config for searching the NVIDIA Developer database.
Reported, thanks
Step 3 of 10
First decide who performs the retrieval. Embedding search, also known as a vector database, powers both the guardrails process and the knowledge base. The modes differ in who retrieves and where chunks come from.
Knowledge Base and Relevant Chunks modes compared
Feature
Knowledge Base mode
Relevant Chunks mode
Who retrieves
NeMo Guardrails
Your application
Where chunks come from
A knowledge base in the guardrails config
Passed directly to the generate method
Exam trap In Relevant Chunks mode, NeMo Guardrails does not retrieve anything for you; your app retrieves the chunks and passes them in.
Reported, thanks
Step 4 of 10
Send chunks in a message with the role context. The message content holds a relevant_chunks field with your retrieved text. You pass that message to rails.generate.
Example: A context message that hands your own retrieved chunks to the generate call.
"relevant_chunks": holds the text your app retrieved
Reported, thanks
Step 5 of 10
A knowledge base can be configured in 3 ways. Use the kb folder, a custom retrieve_relevant_chunks action, or a custom EmbeddingSearchProvider. The kb folder goes inside the config folder.
Exam trap The kb folder does not accept any document type; currently only the Markdown format is supported.
Reported, thanks
Step 6 of 10
By default, FastEmbed computes embeddings with all-MiniLM-L6-v2. An exact NumPy index then handles the similarity search. The batch feature starts embedding generation after a predefined latency of 10 milliseconds.
Reported, thanks
Step 7 of 10
Embedding caching is disabled by default. When enabled, it stores computed embeddings to avoid repeated computation and speed up search. The default cache configuration uses the sha256 key generator and the filesystem store.
Exam trap Embedding caching is not on out of the box; by default the caching mechanism is disabled.
Reported, thanks
Step 8 of 10
Subclass EmbeddingsIndex to build your own provider. Its search method takes the query text, max_results and an optional threshold, and returns a list of IndexItem objects. Register the provider in the init function of config.py.
Example: Registers a custom embedding search provider under the name simple.
"simple": the name the provider is registered under
Reported, thanks
Step 9 of 10
NVIDIARAGToolConfig searches the NVIDIA Developer database. It finds documents across many NVIDIA asset types. Its settings include top_k and collection_name, alongside base_url, timeout, document_separator and document_prompt.
Reported, thanks
Step 10 of 10
Knowledge Base mode lets NeMo Guardrails retrieve; Relevant Chunks mode passes your own chunks to generate.
Pass your chunks as a context role message with a relevant_chunks field.
Default search uses FastEmbed with all-MiniLM-L6-v2 and an exact NumPy index.
Embedding caching is off by default; its default configuration uses sha256 keys and a filesystem store.
Think first Which retrieval and caching settings would you change first to make a guardrailed RAG application answer faster?
Why it matters: Questions describe a retrieval or latency problem and ask which embedding, knowledge base or cache setting addresses it.
Retrieval runs as a vector similarity search over a knowledge base of Markdown documents, using a configurable embedding search provider. Caching then cuts repeated work, either by reusing whole LLM responses or by reusing the system prompt's computation inside NIM.
Reported, thanks
Step 2 of 7
Term
Meaning
Embedding search provider
The component that runs vector similarity search, using FastEmbed, OpenAI or a custom implementation.
Knowledge base
A folder of Markdown documents that NeMo Guardrails uses for RAG-based responses.
In-memory model cache
A cache that returns stored LLM responses for repeated prompts, evicting entries by LFU.
KV cache reuse
A NIM-level optimization so each NemoGuard NIM call skips recomputing its system prompt.
Reported, thanks
Step 3 of 7
FastEmbed is the default embedding engine. The other supported engines are nim for NVIDIA NIM embeddings and openai for OpenAI embeddings. An embedding model is declared in the models list with type: embeddings, for example FastEmbed with all-MiniLM-L6-v2.
Exam trap There are three engines, not two. Besides FastEmbed and OpenAI, the nim engine serves NVIDIA NIM embeddings.
Reported, thanks
Step 4 of 7
The knowledge_base section in config.yml points to the documents folder. It also names the embedding_search_provider and holds a cache setting. For example, the folder can be kb, the provider default, and the cache enabled: false.
Reported, thanks
Step 5 of 7
Guardrails offers two caching strategies to reduce inference latency. You can turn on either one, or both, independently. They save work at different layers.
In-memory model cache and KV cache reuse compared
Feature
In-memory model cache
KV cache reuse
What it reuses
Stored LLM responses for identical prompts
The system prompt's computation
Where it works
In the Guardrails library
At the NIM level, on NemoGuard NIM calls
Notable detail
Evicts entries using LFU
Avoids redoing the system prompt each call
Reported, thanks
Step 6 of 7
A model's cache is off by default. Set models.cache.enabled to true to use it. Its maxsize defaults to 50000 entries. Cache statistics tracking is also off until you enable models.cache.stats.enabled.
Exam trap Caching is not on out of the box. Both models.cache.enabled and models.cache.stats.enabled default to false.
Reported, thanks
Step 7 of 7
FastEmbed is the default embedding engine; nim and openai are the alternatives.
The knowledge base is a folder of Markdown documents used for RAG-based responses.
The model cache reuses whole responses with LFU eviction; KV cache reuse saves system prompt computation in NIM.
The model cache is disabled by default and holds up to 50000 entries when enabled.
Think first How would you connect an agent workflow to outside data sources and tools so their data flows into it reliably?
Why it matters: Questions describe an enterprise data source or service and ask which client, transport or setting brings it into a workflow.
The toolkit brings outside data in through function groups. An MCP client turns a server's tools into functions, and a RAG client adds search and generation. Dataset loaders hand data over as a DataFrame.
Reported, thanks
Step 2 of 9
Term
Meaning
MCP host
A workflow that creates MCP clients, which connect to MCP servers so their tools work as functions.
mcp_client
A function group that connects to an MCP server, discovers its tools and registers them as toolkit functions.
Agent Card
What an a2a_client fetches to discover a remote agent's skills, by default from /.well-known/agent-card.json.
load_fn
The callable in a DatasetLoaderInfo that returns a pandas DataFrame.
Reported, thanks
Step 3 of 9
A workflow that uses MCP tools acts as an MCP host. It creates MCP clients that connect to MCP servers. You can use several mcp_client function groups in one workflow to pull tools from several servers. The feature needs the nvidia-nat-mcp package.
Reported, thanks
Step 4 of 9
mcp_client discovers a server's tools and registers them as functions. Use include and exclude to filter which tools come in. Use tool_overrides to change a tool's name or description from what the server defines.
Reported, thanks
Step 5 of 9
streamable-http is the default and recommended for new deployments. Both sse and streamable-http need server.url. Protected servers need an auth_provider, and that only works with streamable-http.
Exam trap An auth_provider for a protected MCP server is not supported on every transport. It works only with streamable-http.
Reported, thanks
Step 6 of 9
Know the mcp_client defaults for timeouts, sessions and reconnects. These settings decide how long a call may take and how the client recovers.
mcp_client settings and their defaults
Setting
What it controls
Default
tool_call_timeout
Timeout for MCP tool calls
60 seconds
max_sessions
Maximum concurrent session clients
100
reconnect_max_attempts
Maximum reconnect attempts
2
Reported, thanks
Step 7 of 9
The RAG client plugin exposes search and generate tools on one shared client. To reach a remote agent instead, use a2a_client. It reads the agent's Agent Card to discover its skills, and its default transport is JSON-RPC over HTTP.
Exam trap A2A clients are per-user function groups. A shared workflow like react_agent cannot use them directly.
Reported, thanks
Step 8 of 9
A dataset loader's load_fn returns a pandas DataFrame. The loader hands the toolkit its data as a DataFrame through this callable in DatasetLoaderInfo.
Reported, thanks
Step 9 of 9
A workflow using MCP tools is an MCP host, and it can combine several mcp_client groups.
streamable-http is the default MCP transport and the only one that supports auth_provider.
Think first How would you set up a release gate so that only real regressions on the benchmarks you care about block a model?
Why it matters: Questions describe gate results or a policy file and ask which verdict nel gate returns or which setting to change.
nel gate compares baseline and candidate results against a policy YAML that lists benchmarks, tiers and thresholds. It judges each benchmark on paired per-item data, then rolls the tiers up into one release verdict.
Reported, thanks
Step 2 of 9
Term
Meaning
Policy YAML
The file that names the required benchmarks, the tier of each one and the thresholds to apply.
Tier
Critical, supporting or advisory. Critical and supporting both block a release; advisory never does.
max_drop
The largest absolute regression tolerated on a 0-1 scale; 0.01 is one percentage point.
INSUFFICIENT_EVIDENCE
The result when there are fewer than 10 paired items or results.jsonl is missing.
Reported, thanks
Step 3 of 9
Two result directories and a policy YAML. You pass the baseline and candidate result directories. The policy says which benchmarks are required, the tier of each and its thresholds. Benchmark names must match exactly, because matching is case-sensitive. A Duplicate Benchmark Error usually means stale results from earlier runs are still in the directory.
Exam trap A benchmark spelled MMLU in the policy will not match mmlu in the results. Name matching is case-sensitive.
Reported, thanks
Step 4 of 9
Each benchmark is judged on paired per-item results. The gate loads results.jsonl, works out the primary-metric difference per pair and puts a 95% confidence interval around it. With fewer than 10 paired items, or no results.jsonl, the benchmark gets INSUFFICIENT_EVIDENCE.
Exam trap Summary scores alone are not enough. Without per-problem results.jsonl data, the gate can only report INSUFFICIENT_EVIDENCE.
Reported, thanks
Step 5 of 9
Only advisory benchmarks never block a release. Critical and supporting benchmarks both have hard caps. They differ only in their threshold value. Advisory benchmarks show in the report but never change the aggregate verdict.
How each tier affects the release verdict
Feature
Critical
Supporting
Advisory
Can block a release
Yes, hard cap
Yes, hard cap
No
BREACH or MISSING leads to
NO-GO
NO-GO
No effect on the verdict
Exam trap Supporting does not mean non-blocking. It differs from critical only in its threshold; use advisory for a benchmark that must never block.
Reported, thanks
Step 6 of 9
max_drop is an absolute drop on a 0-1 scale. A max_drop of 0.01 tolerates one percentage point of regression. direction defaults to higher_is_better, so any drop counts as a regression. Pick lower_is_better for perplexity or loss. relative_guard_below turns on the relative guardrail only when the baseline is below its value.
Exam trap A max_drop of 0.01 is not one percent of the baseline score. It is an absolute drop of one percentage point on the 0-1 scale.
Reported, thanks
Step 7 of 9
Add --strict to fail a pipeline on NO-GO or INCONCLUSIVE. NO-GO means a critical or supporting benchmark has a BREACH or is MISSING. With --strict, the command exits 1 on NO-GO and 2 on INCONCLUSIVE, so a CI or release script can stop the release.
Reported, thanks
Step 8 of 9
nel compare investigates; nel gate decides. nel compare runs McNemar's significance test to ask whether a regression is statistically real. nel gate applies thresholds from the policy to make the release decision.
Exam trap nel compare is not the release gate. Its McNemar test is an investigation tool, while nel gate makes the go or no-go call.
Reported, thanks
Step 9 of 9
Critical and supporting benchmarks both block; only advisory benchmarks never affect the verdict.
Without results.jsonl, or with fewer than 10 paired items, a benchmark gets INSUFFICIENT_EVIDENCE.
A max_drop of 0.01 means one percentage point on the 0-1 scale.
With --strict, nel gate exits 1 on NO-GO and 2 on INCONCLUSIVE.
Think first How would you let an agent answer from your own documents in real time, and when is the simplest setup enough?
Why it matters: Questions describe a knowledge source and ask how NeMo Guardrails retrieves it or which retrieval option fits.
NeMo Guardrails can ground bot responses in documents through RAG. It embeds the user query and places the retrieved chunks in the context as $relevant_chunks. You supply knowledge through a kb folder, a custom action or direct context.
Reported, thanks
Step 2 of 7
Term
Meaning
kb folder
The folder inside the configuration folder that holds Markdown knowledge base documents.
$relevant_chunks
The context variable that holds the retrieved knowledge base chunks.
Topic chunk
A piece of a document split at Markdown headers, then at blank lines if it is large.
retrieve_relevant_chunks
A custom action that fetches chunks from external sources, such as a vector database.
Reported, thanks
Step 3 of 7
Markdown files in the kb folder enable a knowledge base. The folder sits inside the configuration folder, and the feature turns on by itself once documents are there. Only Markdown is supported for now. It is the simplest option for a static set of documents.
Exam trap PDF or Word files are not an option for the kb folder. Only Markdown documents are supported.
Reported, thanks
Step 4 of 7
Documents are chunked, and the query is embedded. Documents split into topic chunks at Markdown headers, and large chunks split again at blank lines. At query time, the user query is embedded with the model set in the models section of config.yml. Retrieved chunks appear in the context as $relevant_chunks.
Reported, thanks
Step 5 of 7
Use a custom action to reach external sources. A custom retrieve_relevant_chunks action can pull chunks from an external vector database. You can also pass context straight into a generate call, using a message with the context role.
Ways to supply knowledge to NeMo Guardrails
Feature
kb folder
Custom action
Direct context
Source
Markdown files in the configuration folder
External sources such as a vector database
Context sent with the generate call
How it is used
Enabled automatically when documents are present
Implemented as retrieve_relevant_chunks
A message with the context role
Exam trap The kb folder is not the only route. A custom retrieve_relevant_chunks action can fetch chunks from an external vector database.
Reported, thanks
Step 6 of 7
NIM supports apps that reason over images, audio, video and text. Its inference engine, vLLM or SGLang, runs the model and offers OpenAI-compatible endpoints. In NeMo Agent Toolkit, a reasoning agent needs an LLM that supports reasoning, and it plans ahead instead of reasoning between steps.
Reported, thanks
Step 7 of 7
Markdown files in the kb folder enable the knowledge base automatically.
Retrieved chunks reach the context as $relevant_chunks.
Queries are embedded with the embedding model from the models section of config.yml.
Use a custom retrieve_relevant_chunks action for an external vector database.
Each topic's Check tested it on its own; this mixes them.
Mixed quiz
Take the Domain 6 quiz
7 questions mixed from every topic in this domain, each answer explained. Mixing topics is harder than one at a time, and it is what the exam does. No account needed; with a free account your answers also build your estimated exam score.
Free to start: the study notes and plan, quizzes, flashcards and the first mock exam, no card needed. A free account keeps your place and saves your quiz scores.