Skip to content

Commit 137b425

Browse files
Pouyanpimiyoungc
andauthored
docs: mark LangChain integration as opt-in in 0.22 entry-point docs (#1856)
Co-authored-by: Miyoung Choi <miyoungc@nvidia.com>
1 parent c69efe5 commit 137b425

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ You can use programmable guardrails in different types of use cases:
7676
1. **Question Answering** over a set of documents (a.k.a. Retrieval Augmented Generation): Enforce fact-checking and output moderation.
7777
2. **Domain-specific Assistants** (a.k.a. chatbots): Ensure the assistant stays on topic and follows the designed conversational flows.
7878
3. **LLM Endpoints**: Add guardrails to your custom LLM for safer customer interaction.
79-
4. **LangChain Chains**: If you use LangChain for any use case, you can add a guardrails layer around your chains.
79+
4. **LangChain Chains** (optional): If you use LangChain for any use case, you can add a guardrails layer around your chains. To enable this integration, set the `NEMOGUARDRAILS_LLM_FRAMEWORK=langchain` environment variable or call `set_default_framework("langchain")`.
8080

8181
### Usage
8282

@@ -282,9 +282,9 @@ Sample output:
282282

283283
To start a guardrails server, you can also use a Docker container. The NeMo Guardrails library provides a [Dockerfile](./Dockerfile) that you can use to build a `nemoguardrails` image. For further information, see the [using Docker](https://docs.nvidia.com/nemo/guardrails/user-guides/advanced/using-docker.html) section.
284284

285-
## Integration with LangChain
285+
## Integration with LangChain (Optional)
286286

287-
The NeMo Guardrails library integrates seamlessly with LangChain. You can easily wrap a guardrails configuration around a LangChain chain (or any `Runnable`). You can also call a LangChain chain from within a guardrails configuration. For more details, check out the [LangChain Integration Documentation](https://docs.nvidia.com/nemo/guardrails/user-guides/langchain/langchain-integration.html)
287+
LangChain integration is opt-in. To enable it, set the `NEMOGUARDRAILS_LLM_FRAMEWORK=langchain` environment variable or call `set_default_framework("langchain")`. Then install the LangChain packages your configuration requires. After you enable the integration, you can wrap a guardrails configuration around a LangChain chain (or any `Runnable`), and you can call a LangChain chain from within a guardrails configuration. For more information, refer to the [LangChain Integration Documentation](https://docs.nvidia.com/nemo/guardrails/user-guides/langchain/langchain-integration.html).
288288

289289
## Evaluation
290290

docs/about/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Agentic security provides specialized guardrails for LLM-based agents that use t
107107
This includes:
108108

109109
- **Tool call validation**: Execute rails that validate tool inputs and outputs before and after invocation.
110-
- **Agent workflow protection**: Integrate with [LangGraph](../integration/langchain/langgraph-integration.md) for multi-agent safety.
110+
- **Agent workflow protection**: Integrate with [LangGraph](../integration/langchain/langgraph-integration.md) for multi-agent safety. Requires the LangChain opt-in (`NEMOGUARDRAILS_LLM_FRAMEWORK=langchain`) and the matching `langchain-*` packages.
111111
- **Secure tool integration**: Review guidelines for safely connecting LLMs to external resources (refer to [Security Guidelines](../resources/security/guidelines.md)).
112112
- **Action monitoring**: Monitor detailed logging and tracing of agent actions.
113113

@@ -128,7 +128,7 @@ If you have a script or tool that runs a custom guardrail, you can use it in NeM
128128

129129
1. **Python actions**: Create custom actions in Python for complex logic and external integrations. For more information, refer to the [](../configure-rails/actions/index.md).
130130

131-
2. **LangChain tool integration**: Register LangChain tools as custom actions. For more information, refer to the [](../integration/tools-integration.md).
131+
2. **LangChain tool integration**: Register LangChain tools as custom actions. Requires the LangChain framework. For more information, refer to the [](../integration/tools-integration.md).
132132

133133
3. **Third-party API integration**: Integrate external moderation and validation services. For a complete list of supported third-party guardrail services, refer to [Third-Party APIs](../configure-rails/guardrail-catalog/third-party.md) in the Guardrail Catalog.
134134
:::

docs/about/release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For a complete record of changes in a release, refer to the
5252
- Added the `GuardrailsMiddleware` class, a new middleware that integrates with
5353
LangChain's Agent Middleware protocol, applying input and output rail checks before and after
5454
every model call in the agent loop. It includes the `InputRailsMiddleware` and `OutputRailsMiddleware`
55-
convenience subclasses.
55+
convenience subclasses (requires `NEMOGUARDRAILS_LLM_FRAMEWORK=langchain`).
5656
For more information, refer to [](../integration/langchain/agent-middleware.md).
5757

5858
- Added three new community rails:

docs/getting-started/integrate-into-application.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title:
33
page: Integrate Guardrails into Your Application
44
nav: Integrate Guardrails
5-
description: Add guardrails to existing applications using the Python SDK, LangChain, or HTTP API.
5+
description: Add guardrails to existing applications using the Python SDK, the HTTP API, or the optional LangChain integration.
66
topics:
77
- Get Started
88
- AI Safety
@@ -36,7 +36,11 @@ The NeMo Guardrails library provides the following tools to integrate guardrails
3636
response = rails.generate(messages=[...])
3737
```
3838

39-
- Use the NeMo Guardrails LangChain integration capabilities to wrap guardrails around LangChain chains or use chains within guardrails.
39+
- Use the NeMo Guardrails LangChain integration to wrap guardrails around LangChain chains or use chains within guardrails.
40+
41+
```{note}
42+
Starting in 0.22, the LangChain integration is opt-in. To enable it, set the `NEMOGUARDRAILS_LLM_FRAMEWORK=langchain` environment variable or call `set_default_framework("langchain")`. Install `langchain` and `langchain-community` (or the matching `langchain-<provider>` package) before importing. For background, see [Migrating to 0.22](../migration/0.22.md).
43+
```
4044

4145
```python
4246
from nemoguardrails.integrations.langchain.runnable_rails import RunnableRails

0 commit comments

Comments
 (0)