Embedding models and vector search providers in NeMo Guardrails

Choose and configure the embedding engine and index that NeMo Guardrails uses for retrieval, from the default setup to OpenAI, NIM or a custom EmbeddingsIndex on your existing vector store.

On this page

Why NeMo Guardrails embedding models matter for RAG retrieval

NeMo Guardrails turns text into vectors with an embedding model and searches an index to find the chunks that retrieval rails and the knowledge base use. Every time a retrieval step runs, the embedding model decides how well a question matches a passage, and the index decides which candidates come back. A team with a RAG assistant that must keep retrieval inside infrastructure it controls needs to know both components, because a weak match at this stage gives the grounding checks less relevant evidence to work with. The default setup, a FastEmbed model with a NumPy index, is meant for getting started. It runs without an external embedding service, which makes it a reasonable first test, but it is not a sizing or production decision. Production teams usually choose the embedding engine, the index and the caching behavior deliberately, after they have measured retrieval quality on their own documents.

Before you rely on any default, confirm the exact model names, versions and index behavior in the NeMo Guardrails documentation for the release you run. The current release is 0.25.0, so pin that version in your build and check the embedding settings against its configuration reference rather than against older blog posts or examples. The NeMo Guardrails documentation is the place to confirm supported engines, configuration keys and the knowledge base behavior. Record the model and version you tested, because changing the embedding model later changes the vectors and can change which chunks the rails see.

Decide early which parts of the retrieval path are yours to operate. If the embedding model is served from a hosted API, your documents or queries leave the network boundary, so the data handling terms and the network path become part of your review. If it runs locally or on your own inference service, you take on capacity, patching and availability for that service. Ask your engineering team to write down the embedding model, the index type, the expected corpus size, the cache location and the owner of each component before the first production build. Those answers drive the rest of this page.

Embedding engine and index options and when each fits

This table compares the embedding engine and index options available to a NeMo Guardrails knowledge base or retrieval setup, covering where each runs, what data leaves your environment, what your team must supply, and the best fit. Read each row against your network policy, because the hosted options depend on your own accounts and data-handling terms. Cost figures come from each provider, not from this page.

OptionWhere it runs and what leaves your environmentWhat your team must supplyBest fit
Default FastEmbed model with NumPy indexRuns locally in the guardrails process; no text is sent to an external embedding servicePython environment that can load the model files, and a plan for re-indexing when the kb folder changesSmall, Markdown-only knowledge bases and proofs of concept in air-gapped or tightly controlled networks
OpenAI embeddingsHosted by OpenAI; chunk and query text leaves your environment for the embedding callAn OpenAI account and API key, outbound network access, and a review of the provider's data-handling termsTeams that already have an approved OpenAI agreement and accept external processing of document text
NVIDIA NIM embedding endpointsRuns wherever you host the NIM container; stays in your environment when self-hosted, but leaves it if you use a hosted endpointGPU capacity or a reachable endpoint, container image access, and confirmation of your NVIDIA licensing and network rulesOrganizations that want a self-hosted, GPU-backed embedding service with an endpoint their platform team operates
Other embedding engines via configurationDepends on the engine; a self-hosted server keeps text internal, a hosted API sends it outEndpoint hosting or API credentials, model compatibility checks, and a documented embedding model versionTeams with an existing internal embedding service or a model they have already evaluated
Custom EmbeddingsIndex for an existing vector storeRetrieval stays in your vector database; only the query and returned chunks reach the guardrails processDeveloper time to write and test the index class, a running vector store, access controls, and index refresh jobsOrganizations with a governed vector database and an ingestion pipeline that must remain the system of record
Embeddings cacheStores computed embeddings in local or configured storage, so cached text stays in the place you configureDecisions on cache location, retention, and invalidation when documents or embedding models changeKnowledge bases with repeated queries or large document sets where re-embedding is a recurring cost
Model and index changesChanging the embedding model usually requires rebuilding the index, so vectors from different models are not mixedVersioned re-indexing, regression tests on retrieval results, and a rollback pathAny environment where the embedding model may change after go-live

How a query moves through the embedding and index path

The path starts when a user query reaches the retrieval step of a guardrails configuration. The query is embedded by the configured engine, either the default FastEmbed model or an external embedding provider, and the optional embeddings cache can sit beside that step to reuse vectors. The index lookup then runs against the default NumPy index or a custom EmbeddingsIndex backed by your own vector store, and the returned chunks pass through retrieval rails before reaching the application LLM. Check where the trust boundary falls, because any external embedding API receives query text.

Query flow through the embedding engine, index lookup and retrieval rails, with the external boundary marked.

Four decisions that shape your embedding setup

Embedding choices in NeMo Guardrails touch latency, data exposure, consistency and effort at the same time. The four decisions below are the ones to settle in writing before you change the default FastEmbed and NumPy setup.

Where the embedding model runs

The embedding model turns user queries and knowledge base chunks into vectors, so its location decides where that text travels. A local FastEmbed model keeps text inside your network, while a hosted engine such as OpenAI sends content to a third party and adds a network round trip to every retrieval. Confirm in the NeMo Guardrails documentation which embedding engines are supported in the version you run, and confirm with your data owners whether the content may leave your environment.

NeMo Guardrails docs

In-memory index or existing vector store

The default NumPy index lives in the process memory and suits small knowledge bases. Once documents grow, or when a vector store such as Qdrant already holds approved data with access controls, you need a custom EmbeddingsIndex that queries that store. This choice affects latency, the number of copies of your data, and the effort of keeping two stores aligned. Confirm how the index is built at startup and whether your store can answer queries within your latency budget.

Enabling and invalidating the embeddings cache

The embeddings cache avoids recomputing vectors for text the system has already embedded, which reduces repeated embedding calls. The risk is consistency: if a document changes and the cached vector still reflects the old text, retrieval returns stale evidence to the fact-checking rails. Decide who triggers invalidation when documents are updated, and confirm in the docs how cache keys are formed and how entries are cleared before you enable the cache in production.

Testing retrieval quality after a switch

Changing the embedding model changes which chunks come back for the same question, and that change flows into every grounding check downstream. Build a fixed set of representative questions with expected source passages, record which chunks the retriever returns before and after the switch, and compare the results. Treat this as the acceptance test for any model change. Confirm the scoring method you will use and who signs off on the result before the switch goes live.

Setting up a non-default embedding engine step by step

This sequence takes a NeMo Guardrails 0.25.0 setup from the default FastEmbed model to a chosen embedding engine. Each step ends with a check, so the team can confirm that retrieval returns the expected documents before the configuration moves on.

  1. Confirm the Python version

    Run python --version on the host or in the build image that will run the rails. NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13, so an older interpreter must be replaced before anything else. Create a virtual environment or container pinned to a supported interpreter so the embedding dependencies install against the same version your test environment uses. Done when the interpreter reports a supported version and the environment is activated for the remaining steps.

  2. Install the nemoguardrails package

    Install the library into the activated environment with pip install nemoguardrails==0.25.0, or the release your team has reviewed. The package is published on PyPI under the Apache-2.0 license. Record the installed version with pip show nemoguardrails so the configuration you write can be matched to the documentation for that release. Done when the package imports in a Python shell and reports the version you pinned.

  3. Choose and configure the embedding engine

    Decide which engine the retrieval path will use, such as the default FastEmbed model or an OpenAI, NIM or other supported engine, and set it in config.yml. Take the provider and model key names from the NeMo Guardrails documentation for your installed version, and check any older examples against it. Ask your security team which engines are approved for the classification of the documents being indexed. Done when config.yml loads and the guardrails start without configuration errors.

  4. Provide credentials through secure sources

    Supply API keys and endpoint URLs for a hosted or NIM engine through environment variables or your secrets manager. Keep these values out of config.yml and out of version control. Confirm the variable names in the documentation for the engine you chose, and inject the values at runtime when the server runs in a container. Done when the configuration loads with the variables set, and a deliberate test with an invalid key fails at the embedding call, which confirms the value is read from the intended source.

  5. Build the index from your documents

    Place source documents in the knowledge base kb folder, or connect your own document set to the index build your application uses. The built-in knowledge base accepts Markdown only, so convert other formats first. Build the index once with the engine from the previous steps, and record the number of source files and indexed chunks. Done when the build completes without errors and the chunk count is consistent with the number of files you expect.

  6. Enable the embeddings cache

    Enable the embeddings cache only if the same documents and engine will be reused across runs. Set the cache option as described in the documentation for your version, and point it at storage your team controls. Confirm with the documentation how cache entries are keyed, since changing the embedding model generally means existing vectors no longer match. Clear the cache whenever you switch engines. Done when a second run reads vectors from the cache and the index build time drops, as shown in the logs your version produces.

  7. Run a retrieval check with known questions

    Write a set of questions, each paired with the document that should answer it, and run them through the retrieval path. Check that the returned chunks come from the expected documents and that the set covers the content areas your assistant must answer. Record misses, then adjust chunking or the engine before going further. Done when every question in the agreed set returns its expected source, and the results are saved as the baseline for the next embedding change.

Writing a custom EmbeddingsIndex for an existing vector store

Write a custom EmbeddingsIndex when your organization already runs a vector database and wants NeMo Guardrails retrieval to query that store instead of the built-in NumPy index. The reason is governance: the store already holds the approved document corpus, its ingestion pipeline, and the access controls your security team has reviewed. Duplicating that content into a second index creates a second copy to keep current, secure and audit. The custom class is the seam where NeMo Guardrails asks for similar documents and receives them in the shape its retrieval flow expects, so the rest of the configuration stays unchanged. Confirm the EmbeddingsIndex interface, its method signatures and the expected return structure in the NeMo Guardrails documentation for the release you run, since these have changed across versions and the class is referenced by path in your configuration.

The class has three jobs. It connects to the store using a client configured at initialization, it adds and updates documents by computing or receiving embeddings and writing them with their metadata, and it runs similarity search and maps the store's results into the objects the retrieval code consumes. Plan authentication before writing code: the service account should have read access for query paths and separate write access for the indexing job, and credentials should come from your secrets manager, not from the config.yml file or the repository. Filtering by access rights is the control most often missed. If the store holds documents that not every user may see, store the permission attributes as metadata at index time and apply them as a filter inside the search call, so unauthorized chunks never reach the prompt. Also plan document deletion. A removed source document that stays in the store will keep being retrieved, so tie deletions to your source system's lifecycle and test that a deleted document no longer appears in answers.

Keep the embedding model identical between indexing and querying. Vectors produced by one model are not comparable with vectors from another, and a mismatch usually produces plausible but wrong results rather than an error. Record the model name and version alongside each document or in an index-level setting, and make the indexing job and the query path read the same value from one configuration source. If you change models, plan a full re-index into a new collection and switch over after comparing retrieval results on a representative question set. Test the class with a small corpus before connecting production data: check that a known document ranks first for a matching query, that filtered-out documents never appear, and that a deleted document disappears after the next sync. These tests belong in your own pipeline, and they give your compliance team evidence for how retrieved content is scoped.

Security and data handling for embeddings and vector stores

An embedding pipeline moves your documents through a model and into an index, and each step creates a copy of your content or a derivative of it. The four cards below cover where text goes, where vectors sit, who can retrieve them, and how the credentials that connect everything are held.

What leaves your environment

When the embedding model is an external API, the text of every chunk you index and every query you embed is sent to that provider. Queries are included, so user questions can leave your network as well as your documents. Check the provider's data use and retention terms in writing, and confirm whether your contract covers embedding requests separately from chat completions. A self-hosted engine such as NIM or a local FastEmbed model keeps this text inside your boundary.

Where vectors are stored

Embeddings are not plain text, but they are derived from your content and can support inversion or similarity attacks, so treat them as sensitive. Confirm where the NeMo Guardrails embeddings cache writes its files, what it keeps, and how long it retains entries in the NeMo Guardrails documentation. Apply the same encryption at rest, backup and deletion rules to cached vectors as to the source documents they came from.

NeMo Guardrails docs

Access control on the index

Retrieval returns the nearest chunks regardless of who asked, so a shared index can expose content a user could not open in the source system. Decide whether access is enforced by separate indexes per permission group, by metadata filters applied on every query, or by checking results against source permissions before they reach the prompt. Test each route with a user who lacks access to a known document, and confirm that filtered chunks never reach the model.

Provider keys and store credentials

The embedding provider key and the credentials for the vector store are high-value secrets that often end up in config.yml, environment files or container images. Load them from your secrets manager or the orchestrator's secret store at runtime, scope each key to embedding calls only, and rotate them on a schedule. Confirm that the server logs and traces do not print request headers or connection strings, and that the cache directory is not copied into images.

What buyers ask about embedding setup, cost and effort

Is the default FastEmbed model and NumPy index enough for production?

It depends on the size of the corpus, the latency and recall you need, and whether the index must survive restarts and scale out. The default setup runs inside the guardrails process with no external service, which makes it convenient for evaluation and small knowledge bases. For production, confirm three things before you rely on it: how many chunks you will index, how often the index is rebuilt, and whether your retrieval quality has been measured against a representative question set. Larger or frequently changing corpora usually move to an external vector store, and that move is where a custom EmbeddingsIndex integration comes in.

What drives the cost of switching to an external embedding API?

The main recurring cost is usage pricing set by the embedding provider, which is charged on the text you send, so it scales with two things: the volume of content you index and the query traffic your assistant generates. Indexing is usually a one-time or periodic cost, while every user question that is embedded adds to the recurring bill. Other cost components include the engineering time to configure the model, the rework needed when you re-embed an existing index, and any hosting cost if you run a self-hosted embedding engine yourself. When requesting a quote, ask for the assumed number of documents, the re-indexing frequency, the expected monthly query volume, and the provider's current rates as of the quote date.

How long does a custom EmbeddingsIndex integration take?

The duration depends mainly on how complex the existing vector store is and how much access control must be mirrored. A store with a simple client API, one collection and no per-user filtering is a small piece of work. Effort rises when the store has its own metadata schema, namespaces or tenant isolation, when permissions on source documents must be enforced at query time, and when the team needs batch indexing, updates and deletions to stay in sync with source systems. Testing is a large share of the work: retrieval results, filtering behavior, failure handling and performance under expected load all need verification. Ask any partner for a written scope that lists each of these areas and the test plan that covers them.

What does the work need from our team?

The work needs read and write access to the vector store in a non-production environment, a sample of the documents to be indexed, and a test question set that reflects real user questions along with the expected source chunks. You will also need a named owner who can approve the security review of data flows, since embeddings are generated from document text and queries, and that text may leave your boundary if an external embedding API is used. Expect to provide the credentials and network paths, the access model for source documents, and the decision on which embedding provider is approved for your data classification. Confirm these items in the written scope before work starts.

Does sending text to an external embedding provider create a security review item?

Yes. Any external embedding API receives the document chunks you index and the user queries you embed, so it becomes part of the data flow your security and compliance teams must review. The review should cover what text is sent, whether it is retained or used for training under the provider's terms, where the provider processes it, and how credentials for the API are stored. A self-hosted embedding engine keeps that text inside your infrastructure but moves the operational burden to you. Ask the provider for its current data handling terms and confirm them against your own policy rather than relying on a summary.

What changes if we switch the embedding model later?

Changing the embedding model usually means re-embedding the whole index, because vectors produced by different models are not comparable. The cost of that step is the compute or API usage for every stored chunk, plus the time to validate retrieval quality again against your test question set. Plan for a parallel index, a comparison of results, and a controlled cutover so that users are not exposed to a silent drop in answer quality. If the model is served by a dimension-sensitive vector store, the schema may also need to change. Record the model name, version and dimension in your configuration so that a future switch is traceable.

Can our own team set this up without outside help?

A capable platform team can configure the built-in embedding options, enable the embeddings cache and test retrieval with the default setup. Writing and testing a custom EmbeddingsIndex for an existing vector store requires experience with that store, with NeMo Guardrails configuration, and with the access and security review your organization needs. Before deciding, compare the in-house effort against the written scope a partner would propose, including testing, documentation and handover. Ask any partner to list which parts of the work they would hand over to your team and which they would keep, so that the decision rests on your skills and your timeline. DeployOpen plans and builds these integrations inside infrastructure you control and provides testing and documentation as part of the agreed scope.

Limits to confirm before choosing an embedding provider

Embedding choices in NeMo Guardrails depend on the release you run, the engines it supports and how the cache behaves with your documents. Confirm each limit below in the documentation, the release notes or a test in your own environment before you fix a provider.

Model and index compatibility by release

Confirm which embedding model and index settings your release accepts, because the API surface is changing. Release 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, so code that constructs the old class may need a change before that version. Check the 0.25 migration guide and the release notes for the version you plan to run, and test a configuration with a changed embedding setting before upgrading.

Release notes

Supported engines and index types

Confirm which embedding engines and index types your release supports before you write configuration against them. The default path is a FastEmbed model with a NumPy index, and switching to an external engine such as OpenAI or NIM is a configuration decision that should be verified against your release's documentation. Ask whether a custom EmbeddingsIndex is the documented extension point, and whether it needs changes when the library is upgraded.

NeMo Guardrails docs

Embeddings cache behavior and invalidation

Confirm when the embeddings cache stores vectors, where it lives, and when it is invalidated. A stale cache can return vectors produced by an older model after you change the embedding provider, which makes retrieval quietly inconsistent. Test by changing the model in a staging copy, re-indexing a known document, and checking that the returned vectors and retrieved chunks match the new model. Record the cache location and the steps that clear it in your runbook.

Performance at your document volume

Confirm indexing time, query latency and memory use with a document set close to your real size. The NumPy index is simple to run, but its behavior at large volumes should be measured rather than assumed, and an external engine adds network calls and API costs. Run a load test against your intended corpus, record index build time and per-query latency, and compare the results with the requirements of the assistant that depends on retrieval.

How DeployOpen scopes and delivers embedding and retrieval setups

DeployOpen plans, builds, tests and documents embedding and vector search setups for NeMo Guardrails inside infrastructure you control. Each engagement starts from a written scope that names the embedding engine, index, cache and retrieval path your assistant will use, so your security and platform teams can review the design before work begins.

How we scope

  • Confirm which embedding engine you must use, whether a local FastEmbed model, an OpenAI endpoint, a NIM service or another approved provider.
  • Record where the document corpus lives, who owns it, and whether an existing vector store such as Qdrant must be reused.
  • Agree in writing which NeMo Guardrails version and Python runtime will be targeted, including the 0.25.0 requirements for Python 3.11 to 3.13.

How we build

  • Configure the embedding model and index in config.yml and test each provider path separately in a staging environment you control.
  • Write and test a custom EmbeddingsIndex for your existing vector store, covering add, search and error handling against sample data.
  • Enable and verify the embeddings cache, confirming cache location, permissions and behavior when the source documents change.

How we hand over

  • Deliver the configuration files, custom index code, and a short runbook describing how to switch embedding providers and rebuild indexes.
  • Document the data flows for every embedding call, including which text leaves your network if a hosted provider is chosen.
  • Provide retrieval test results showing that relevant chunks come back for your agreed evaluation questions, with the outcomes recorded.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing upgrades, dependency reviews and retrieval re-testing are available as a retainer after handover.
  • Ask any provider to confirm model compatibility, licensing and hosting terms in your environment before the quote is finalized.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.