What the NeMo Guardrails knowledge base does for RAG
A team with a small set of internal documents often asks whether the built-in knowledge base in NeMo Guardrails is enough to ground an assistant, or whether it needs its own retrieval stack. The short answer is that the kb folder is a simple, self-contained source inside a guardrails configuration, and it is sufficient only when the document set is small, the content is written as Markdown, and the team accepts the default retrieval behavior. The kb folder sits next to config.yml and any Colang or Python files. Its documents are split by Markdown headers, and the resulting chunks feed the retrieval rails, which decide what evidence reaches the prompt. Retrieval quality therefore depends on the embedding setup as much as on the documents themselves.
The current release, 0.25.0, requires Python 3.11, 3.12 or 3.13, so the target runtime should be checked against that range before any evaluation starts. Confirm in the documentation for the exact version you deploy which embedding model and index the knowledge base uses by default, since these defaults change between releases and determine how chunks are scored. Also confirm how the kb folder is loaded when the configuration is served from the guardrails server, because the path and reload behavior affect how you update documents in production.
Before committing to the built-in folder, run a short test with a representative set of questions and the documents you actually plan to ship. Record which chunks are retrieved for each question, whether headers split related facts apart, and whether answers depend on content that is not Markdown. Those results show whether the default chunking and retrieval are adequate. They also tell you whether the grounding checks described in the sibling sections will have good evidence to work with. If documents are in other formats, change frequently, or need per-user access controls, plan for an external vector database and custom retrieval instead, and treat the kb folder as a prototype path.
Options for the kb folder and when each fits
This table compares four ways to supply knowledge to a NeMo Guardrails RAG setup: the built-in kb folder, embedding model choices, the guardrails server with a configuration folder, and an external vector database with custom retrieval. Read each row for the content volume, update pattern and control needs it fits, then confirm the listed settings in the documentation for your release. The main takeaway is that the built-in folder suits small, slow-changing Markdown collections, and larger or faster-moving corpora usually need an external store.
| Option | Best fit | Main trade-off | Settings to confirm in the docs for your release |
|---|---|---|---|
| Built-in kb folder | Small, slow-changing sets of Markdown policies, FAQs and product notes | Only Markdown documents are supported, and the index is rebuilt from files on the server | Accepted file types, header-based chunking behavior, and how the index reloads after changes |
| Default embedding model (FastEmbed) with NumPy index | Prototypes and small corpora where a local, in-memory index is enough | Index size and search speed are limited by memory on the application host | Default embedding model name, index type, and whether the embeddings cache is enabled |
| Alternative embedding engines (OpenAI, NIM or others) | Teams that must use an approved embedding provider or a self-hosted NIM endpoint | Adds an external or extra service to review, plus its own cost and availability | Supported embedding engine keys, credentials handling, and any data sent to the provider |
| Guardrails server with a configuration folder | Shared assistants where config, kb files and Colang are versioned together and served over HTTP | Each config change needs a controlled reload and a review of the kb content it loads | Config folder layout, server startup options, container image settings, and reload behavior |
| External vector database with custom retrieval | Large corpora, frequent updates, existing access controls or metadata filtering in your own store | You own the retriever, the embedding pipeline, sync jobs and access checks before chunks reach rails | Custom EmbeddingsIndex or retrieval action interface, and how retrieved chunks are passed to rails |
How header-based chunking shapes what the model sees
The knowledge base splits each Markdown file at its headers, so the document's heading structure decides where a chunk starts and ends, and therefore how much text one chunk holds. A long section under a single heading becomes one long chunk, even when it covers several unrelated topics. A very short section can become a chunk that lacks the context needed to answer a question on its own. Before loading documents, review the heading hierarchy of each file and ask whether every section answers one clear question. Sections that mix topics are the first candidates for splitting into smaller headed sections.
Tables and code blocks need separate checks. A table or fenced code block that sits in the middle of a long section may be returned without the heading or surrounding explanation that gives it meaning, and a wide table can lose its header row if it is split. Code blocks that contain lines beginning with # may also be read differently from prose, depending on how the chunker parses Markdown. Confirm in the NeMo Guardrails documentation how the chunker treats tables and fenced code in the version you run, and restructure those sections so each one is self-explanatory.
Test chunk output on your own documents before you rely on retrieval. Load a representative set, inspect the chunks produced for each file, and run the questions your users will ask, checking whether the returned text contains the complete answer. The kb folder accepts only Markdown, so PDFs, Word files and HTML pages must be converted first, and conversion often flattens headings. Confirm with NVIDIA how the chunker handles any other file type placed in the folder, whether it is rejected, skipped or processed, and decide who owns the conversion step and its checks.
How a user question flows through the kb folder and rails
The flow starts with a user question that passes through input rails before any retrieval happens. The retrieval step searches chunks built from the Markdown files in the kb folder, which sits inside the guardrails configuration folder, or queries an optional external vector store instead. Retrieval rails filter the chunks before they reach the application LLM, and output rails check the draft answer. The trust boundary separates your infrastructure from any external embedding endpoint you configure, because query text crosses it when that endpoint is used. Confirm which embedding engine your configuration uses before assuming that data stays inside your network.
Question flow through kb chunks, rails and the trust boundary.
Setting up the kb folder in a NeMo Guardrails configuration
This sequence takes a NeMo Guardrails configuration from an empty folder to a knowledge base that answers from your own Markdown documents. Each step ends with a check the team can repeat, so the environment, chunks, embeddings and grounded answers are confirmed before retrieval reaches production traffic.
Confirm Python and install the 0.25.0 package
The engineer responsible for the environment checks that the host runs Python 3.11, 3.12 or 3.13, creates a virtual environment, and installs the release pinned to 0.25.0 from PyPI with pip install nemoguardrails==0.25.0. Pinning the version keeps the behavior you test tied to the documentation for that release. Done when pip show nemoguardrails reports version 0.25.0 and python -c 'import nemoguardrails' runs without error inside that environment.
Create the configuration folder and core files
Create a configuration folder containing a config.yml file, at least one Colang file, and an empty kb folder alongside them. The config.yml file names the model and the rails the application uses. Colang 1.0 is the default, so confirm in the documentation for 0.25.0 how to select a different Colang version if you need one. Keep the folder in version control so every knowledge base change can be reviewed. Done when the folder loads with the Python API or the guardrails server without configuration errors, even before any documents are added.
Add Markdown documents with clear headers
Place Markdown files in the kb folder, ideally one file per source document. Give each file a single top-level title, then use sections that each cover one topic, because the knowledge base splits documents at headers. Each section should be understandable on its own, so remove navigation text and repeated boilerplate and keep product names and identifiers in the headings. Done when every file reads cleanly as plain Markdown and each heading accurately describes the section beneath it.
Configure the embedding model for your release
Set the embedding model in the configuration exactly as the documentation for 0.25.0 describes. The default model, whether it downloads at first use, and whether it runs fully locally depend on the release and the installed packages, so confirm each of these in the docs instead of assuming them. If the environment is air-gapped or you plan to use a hosted or NIM embedding engine, confirm that option is supported in that release before you build on it. Done when the application starts, the embedding model loads, and the index builds without network errors.
Review the chunks produced from your documents
Inspect how the knowledge base splits each file before testing answers. Compare chunk boundaries with the headers you wrote, and check that each chunk carries enough context, such as the document title and section name, to be understood alone. Sections that cover several topics should be split into smaller headed sections. Confirm in the documentation for your release how chunks are exposed, for example through debug output or logs. Done when every chunk maps to one section of one document and no chunk mixes content from unrelated files.
Run test queries and confirm retrieved chunks
Write a set of questions that your documents answer, and record the section each answer should come from. Send the questions through the Python API or the guardrails server HTTP API, and log which chunks were retrieved for each one. Done when the top retrieved chunks for every question come from the expected section. Treat a miss as a signal to fix headings, wording or embedding settings before changing the prompt or the rails.
Verify grounded answers through the server or API
Call the configured application end to end and check that each answer states facts found in the retrieved section and reflects that source. Then ask a question the documents do not answer, and confirm the assistant says it lacks the information instead of inventing one. Done when both cases pass. Record the results alongside the configuration version so the same test set can be rerun after every document or embedding change.
Limits of the built-in kb folder to confirm before you commit
The built-in kb folder is convenient for a first RAG prototype, but its input format, chunking, embedding host, scaling, access model and Colang version all shape what you can run in production. Each card names one limit to confirm with NVIDIA, in the release notes, or in your own test environment before you commit the design.
Markdown-only input format
The kb folder accepts Markdown documents only, so PDFs, Word files, HTML exports and database rows must be converted before they reach the index. Check how your source documents will be converted, who owns that pipeline, and how tables, images and embedded diagrams survive conversion. Confirm the accepted file extensions and any size limits against the NeMo Guardrails documentation for the version you pin.
NeMo Guardrails docsHeader-based chunking behavior
Chunks are split on Markdown headers, so chunk size and retrieval quality depend on how your documents are structured. Long sections without headers can produce oversized chunks, and very short sections can lose context. Run a sample of your real documents through the loader and inspect the chunks that come out before you accept the structure. Confirm the exact splitting rules in the docs for your release.
Default embedding model and hosting
The default embedding model runs locally in the process, which affects where document text is processed and how the model is updated. Ask NVIDIA which default model ships with your release, whether it downloads model files at runtime, and how those files reach an air-gapped or restricted network. If your data cannot leave your environment, confirm the model source before indexing any content.
Index behavior at larger volumes
The default index is held in memory and is designed for small document sets, so memory use and search time grow with the number of chunks. Ask how the index is rebuilt when documents change, whether updates are incremental or full reloads, and how long a reload takes at your expected volume. Plan a load test with your own corpus before you promise users response times.
Access control over kb content
The kb folder is a directory of files, so anyone with write access to the configuration repository or server image can change what the assistant cites. Decide who approves content changes, how edits are reviewed in version control, and how the running server picks up a new version. Confirm with NVIDIA whether the server offers any built-in authentication for content management, and document the controls you add around it.
Colang 1.0 default versus 2.x
Colang 1.0 is the default, while Colang 2.0 and 2.x configurations follow different syntax and flow rules. Confirm which Colang version your configuration uses before you copy examples from the docs, since a retrieval setup written for one version may not run unchanged in the other. NVIDIA's migration guide says converted configurations still need manual review, so budget that review time if you plan to move.
Colang 2 migration guideWhen to move to an external vector database and custom retrieval
A small, curated set of Markdown documents is the case the built-in kb folder was designed for. Documents are loaded at startup, chunked by headers, embedded with the default model and searched in memory, so there is little to operate and little to integrate. The trade-off is that every change to the corpus means reloading the knowledge base, and the in-memory index is not meant to hold a large or fast-moving collection. Keep the prototype honest by treating it as a test bed for retrieval rails and fact-checking, not as the final retrieval layer.
- Low setup cost: No vector database, no separate service and no retriever code to write for the first working version.
- Fixed corpus assumption: Plan for a manual reload whenever a Markdown file changes, and confirm how the reload behaves in your deployment.
- Header-based chunks: Check that your documents have headings that produce chunks a model can use, since poorly structured Markdown gives poor retrieval.
- Single index: Everything lives in one index, so there is no per-user or per-source filtering yet.
- Early rail testing: Use this stage to tune retrieval rails and grounding checks before the data sources become real.
Before you rely on this approach beyond a pilot, confirm the current kb loading and indexing behavior, the supported file types and the index size guidance in the NeMo Guardrails documentation.
Production corpora usually change every day: policies are revised, product pages are published and support articles are retired. A knowledge base that is rebuilt from a folder works poorly when updates must reach users within a short window, when deletions must take effect immediately, or when several teams publish into the same content. An external vector store with incremental writes lets your ingestion pipeline add, update and remove individual chunks, and it moves re-embedding and index maintenance out of the guardrails process. The cost is an ingestion pipeline you must build, monitor and keep in step with the embedding model.
- Incremental ingestion: Your pipeline writes and deletes single documents, so a change does not require a full rebuild.
- Embedding versioning: Record which embedding model produced each vector, because mixing models in one index breaks similarity search.
- Deletion and staleness: Define how withdrawn documents are removed from the index and how quickly that removal must happen.
- Custom EmbeddingsIndex: Writing an
EmbeddingsIndeximplementation lets NeMo Guardrails query the store you already run. - Re-test after each change: Retrieval rails and fact-checks should be re-run against a fixed question set whenever the ingestion logic changes.
Confirm how the EmbeddingsIndex interface expects search results and metadata in the release you deploy, using the NeMo Guardrails documentation and the release notes for your version.
Many organizations already run an enterprise search platform or a vector store with its own relevance tuning, connectors and monitoring. Keeping a second copy of the content inside the guardrails configuration duplicates effort and invites drift between what users find in search and what the assistant cites. Wrapping the existing retriever is usually the better fit when the search team owns ranking and freshness. The guardrails layer then receives chunks, applies retrieval rails and checks the answer, and the retrieval logic stays in one place. The work shifts toward integration, contracts for returned chunks and testing against the search system's own behavior.
- Single source of relevance: Ranking changes made by the search team take effect in the assistant without a separate tuning cycle.
- Chunk contract: Define the fields each chunk must carry, such as text, source and identifier, so retrieval rails and citations work consistently.
- Custom retrieval path: A custom RAG action or retriever passes relevant chunks into the rails, as described in the adding-to-a-pipeline guidance.
- Access to existing connectors: Reuse the connectors and freshness jobs the search team already operates.
- Regression testing: Compare answers before and after integration on the same questions, since ranking differences change what the model sees.
Ask the search team which API and latency guarantees they can offer, and confirm the integration pattern with the NeMo Guardrails documentation before committing to it.
Strict data residency and per-user permission filtering are the situations where the built-in index is least suitable. The kb folder is shared by everyone who uses the assistant, so it cannot by itself decide that one employee may see a payroll document while another may not. Residency requirements also dictate where embeddings are computed, where vectors are stored and whether any text leaves the environment, including to a hosted embedding service. A custom retriever can enforce identity and region rules before any chunk reaches a prompt, but the access logic must be designed, reviewed and tested as part of the security scope.
- Filter before retrieval: Apply the user's entitlements as a filter on the vector query, not as a cleanup step after the model has seen the text.
- Residency of embeddings: Confirm that the embedding model, the index and the logs all run in the approved region or network.
- Identity propagation: Pass the authenticated identity from your application into the retriever, and test that it cannot be spoofed through the assistant.
- Audit trail: Log which documents were retrieved for which user, so reviewers can reconstruct answers.
- Permission tests: Build negative tests where an unauthorized user asks for restricted content and the rails must prevent any leakage.
Confirm each of these points with your security and privacy teams, and check the logging and telemetry options in the NeMo Guardrails documentation against your evidence requirements.
Security and operations for kb content and embedding endpoints
The kb folder and its embedding calls become part of the assistant's trust boundary once retrieved text enters the prompt. The cards below cover the controls a security team can review: who changes the content, where embedding calls go, what gets logged, how content is versioned, and what checks run before retrieved text reaches the model.
Restrict who can write to the kb folder
Anything placed in the kb folder is retrieved and sent to the model as trusted context, so a write to that folder is effectively a change to the assistant's instructions. Limit write access to named maintainers, require pull request review for every change, and record who approved each document. Ask whether your review process can reject documents with embedded instructions or content from unverified sources before they are merged.
Keep embedding calls inside your network
If the embedding model is a hosted API, every chunk of kb text is sent to that provider when the index is built and when queries are embedded. Confirm where the embedding endpoint runs, whether traffic leaves your network, and what the provider's data terms say about retention. A self-hosted embedding engine keeps that traffic on infrastructure you control and is easier to show in a data flow review.
Log retrieved chunks with care
Logs that record which chunks were retrieved help investigators explain an answer, but chunks often contain personal data, contract terms or internal figures. Decide which fields are logged, such as document identifier, chunk identifier, score and timestamp, and which are not, such as full chunk text. Set a retention period for these logs and restrict who can read them, and confirm that your logging stack does not store full prompts by default.
Version kb content with the configuration
Keep the kb folder, the config.yml file, Colang files and any custom actions in the same Git repository so each deployed answer can be traced to a commit. Back up the built index as well, because rebuilding it after an embedding model change can alter retrieval results. Ask your team to show how a previous kb state would be restored and how a rollback is tested before it is needed.
Check retrieved chunks before the prompt
Retrieval rails let you validate, filter or mask chunks before they enter the prompt, which is the control point for stale, off-topic or sensitive content. Define which checks run on each chunk, what happens when a chunk fails, and how blocked chunks are logged. Verify the required engine and rail configuration in the NeMo Guardrails documentation for your release before relying on this control in a review.
NeMo Guardrails docsQuestions teams ask before using the NeMo Guardrails knowledge base
How much more effort is a kb-based setup than an external vector store?
The kb folder is usually the smaller effort, because it avoids provisioning and operating a separate vector database. Your team writes Markdown documents, places them in the kb folder of your configuration, and lets NeMo Guardrails chunk them by headers and index them with its default embedding model and in-memory index. The effort grows when the corpus grows, when documents need structure the header-based chunking does not handle well, or when you need access control, updates at volume or multiple indexes. At that point an external store such as Qdrant starts to earn its operating cost. Confirm the current chunking behavior and supported file types in the NeMo Guardrails documentation before you commit to a document format.
What does the work need from our team?
Three roles cover most of it. Document owners convert policies, product pages and procedures into clean Markdown with clear headers, and they own updates when content changes. An engineer maintains the config.yml file, the embedding settings, any Python actions and the Colang files that route questions into retrieval. Someone on the test side writes questions with known answers, checks that the bot retrieves the right chunk and refuses when the evidence is missing, and reruns those checks after each content or configuration change. In smaller teams one person can hold two roles, but nobody should own content, configuration and testing alone without review.
Can our own engineers do this without a partner?
Yes, if your engineers are comfortable with Python, YAML and running a service in your own environment. The library is open source under Apache 2.0, and the documentation covers the kb folder, configuration and the server. The harder parts are judgment calls: how to split documents, which retrieval answers count as evidence, how to test refusals and how to keep the configuration aligned with the library version you run. Confirm that your team can meet the Python requirement in the release notes for the version you plan to use, and plan a test set before you call the build finished.
What drives the cost of a kb-based setup up?
Most of the cost is people time, which is one-time for the first build and recurring for content and test maintenance. Document volume raises indexing time and the amount of content your owners must review. Where you host the embedding model matters: the default model runs locally, while a hosted embedding endpoint adds infrastructure and usage charges from whoever runs it. Testing scope is the largest variable, because a small set of known questions costs far less than a regression suite covering every document, language and failure mode. Ask any partner to price these components separately, along with who pays for hosting and what is included after launch.
How long does a first build take, and what sets that time?
Duration depends on the number of documents, how much rewriting they need before they chunk well, how many people review them, and how complete your test set is. Converting existing wiki pages into clean Markdown is often the longest step, not the configuration. Embedding setup and the first retrieval tests usually go quickly once the documents are ready. No fixed duration is given here because none is supplied for this topic. Ask for a written plan that separates content preparation, configuration, testing and handover, and check each phase against your own document count.
When is outside help worth paying for?
Outside help is most useful when the knowledge base will answer questions from sensitive or regulated content, when you need an external vector store and custom retrieval, or when you must show a security or compliance review how the answers were grounded. DeployOpen plans, implements, tests and documents self-hosted NeMo Guardrails deployments inside your own infrastructure, and it can run security testing of the assistant, including prompt injection and data exposure checks. It does not issue audit reports or certifications. Ask for a fixed scope with written deliverables, and confirm which parts your team keeps after handover.
Does the kb folder affect our licensing or platform choice?
NeMo Guardrails is licensed under Apache 2.0, and the kb folder is part of the open-source library, so using it does not add a license fee for the library itself. Confirm the terms of any embedding model you choose, since the default and alternative models carry their own licenses. Also confirm the current release path with NVIDIA, because the NeMo Guardrails microservice has been sunset and the NeMo Platform now takes its place for enterprise users. Your account team can explain which support and runtime options apply to you.
How DeployOpen works on this
DeployOpen plans, builds, tests and documents NeMo Guardrails knowledge base setups inside your own infrastructure, so the folder of Markdown documents, the embedding configuration and the retrieval behavior can be reviewed by your security and platform teams. Work starts from a written scope that sets out which documents, models and rails are in play before any configuration is changed.
How we scope
- Inventory the source documents and confirm they are Markdown or can be converted to it without losing structure.
- Record which embedding model and index will run, and where the model files and inference will be hosted.
- Agree in writing whether the built-in knowledge base fits or an external vector database and custom retrieval are needed.
- Engagements are fixed-scope, so scope, deliverables and timelines are agreed in writing before work starts.
How we build
- Structure the kb folder so header-based chunking produces sections that answer distinct questions.
- Configure the embedding model and index in the NeMo Guardrails configuration, and confirm the Python version in use is supported by the release.
- Test retrieval against a set of representative questions and review which chunks are returned for each one.
- Document the chunking rules, configuration keys and file layout so the knowledge base can be rebuilt by your own team.
How we hand over
- Deliver the configuration folder, embedding and index settings, and the test questions with their expected retrieved sources.
- Provide a written record of the retrieval decisions, including the criteria that would trigger a move to an external vector database.
- Walk your engineers through rebuilding the index after a document change and through the upgrade notes for the release in use.
- Hand over with evidence your compliance reviewers can read, such as configuration history and test results.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer when the knowledge base changes over time.
- Retainer work can cover re-testing retrieval after new documents are added and reviewing the effect of each NeMo Guardrails release.
- Ask any quote to separate the one-time setup from recurring support so you can compare it with the cost of keeping the work in-house.

