Prerequisites
To use the PII management capability, you need to have the following prerequisites in place:- Rasa Pro version 3.13.0 or later installed.
- Defined
privacyYAML config in your Rasa project. - A Lock Store when tracker store anonymization or deletion is configured (required by the background privacy manager to avoid race conditions during read-modify-write on trackers).
GLiNER Requirements
To use the GLiNER PII identification, you need to have the following prerequisites in place:- Rasa Pro version 3.13.0 or later installed with the
piioptional extra, for example:
- GLiNER PII model downloaded and available in your Rasa project.
GLiNER Model Download
To download the GLiNER PII model prior to starting the Rasa assistant, run the following script in your Rasa venv:download_model.py
GLINER_MODEL_PATH environment variable to the path where the model is saved.
To create a custom Docker image for the assistant, you can modify the Dockerfile in your Rasa Pro root project to include the model download script:
Dockerfile
docker build . -t pii-assistant:latest, you can run the assistant with the GLiNER
PII model available in your Rasa project using this docker compose file which also requires BOT_PATH environment variable
to be set to the path of your Rasa project:
docker-compose.yml
Machine Spec Requirements with GLiNER
The Rasa Pro image with pre-downloaded GLiNER model will be larger than the standard Rasa Pro image due to the GLiNER model size. If you are running the Rasa assistant with the GLiNER model in a Docker container, ensure that your machine has sufficient resources to run the model. In addition, if you are running your Rasa assistant with multiple Sanic workers, the GLiNER model will be loaded into memory for each worker and will require additional 1 - 2GB of memory per worker. Ensure to choose your assistant’s number of Sanic workers according to the available memory on your machine. For example, a machine with 32GB of RAM can run up to 10 Sanic workers with the GLiNER model loaded in memory.Environment Variables
You can configure the PII management capability using the following environment variables:New in 3.16
USER_CHAT_INACTIVITY_IN_MINUTES is deprecated. Prefer leaving it unset so that eligibility uses session management (event-based with ConversationInactive/SessionEnded and session_id grouping) and different tracker variants are handled accordingly.USER_CHAT_INACTIVITY_IN_MINUTES: When unset, “new” trackers (events withsession_id) are processed for PII anonymization or deletion based onConversationInactive/SessionEndedevents andsession_idgrouping, with a grace period ofmin_after_session_end. “Legacy” trackers (nosession_id) use a fixed 30 minutes plusmin_after_session_end. When set, time-based eligibility (env value +min_after_session_end) is applied per session; this behavior is deprecated. Default when used for legacy/time-based logic is30minutes.GLINER_MODEL_PATH: The path to the downloaded GLiNER PII model in your Rasa project.HUGGINGFACE_HUB_CACHE_DIR: The path to the HuggingFace Hub cache directory if defined when downloading the GLiNER model.