.
├── cloud-pubsub-interceptor
│ ├── Dockerfile: Docker-image creation for Cloud Pub/Sub Interceptor deployment on Cloud Run
│ ├── main.py: A starter for flask app
│ ├── requirements.txt: Python packages for running Cloud Pub/Sub Interceptor service
│ └── unit_test.py: Unit test code for Cloud Pub/Sub Interceptor
├── cloudbuild.yaml: An example configuration file for Cloud Build
├── deploy.sh: An automated deployment script
├── images
├── readme.md
└── ui-connector
├── Dockerfile: Builds Docker image for UI Connector deployment on Cloud Run
├── auth.py: JWT validation and registration handling
├── auth_options.py: Support for authentication through different identity providers
├── config.py: Configuration for variables about authentication, logging, and CORS origins
├── dialogflow.py: With Dialogflow utilities for runtime-conversation handling
├── main.py: A starter for flask app
├── requirements.txt: Python packages for running UI Connector
├── templates
│ └── index.html: A simple interactive demo
└── unit_test.py: Unit test code for UI Connector
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eAgent Assist now features backend modules, a ready-to-use solution for integrating Agent Assist into your system.\u003c/p\u003e\n"],["\u003cp\u003eBackend modules consist of a Cloud Pub/Sub interceptor service, which processes event notifications from Dialogflow, and a UI connector service, which pushes these to the agent desktop UI.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Pub/Sub interceptor is deployed on Cloud Run and manages event messages from Pub/Sub topics, publishing them to Redis Pub/Sub channels.\u003c/p\u003e\n"],["\u003cp\u003eThe UI connector, also deployed on Cloud Run, acts as a RESTful Dialogflow API proxy and uses a SocketIO WebSocket endpoint to stream messages to agent desktops, using temporary JWTs for authentication.\u003c/p\u003e\n"],["\u003cp\u003eMemorystore for Redis is leveraged by backend modules to record UI connector server IDs and forward event notifications to the appropriate UI connector server using a Pub/Sub mechanism.\u003c/p\u003e\n"]]],[],null,["# Agent Assist backend modules basics\n\nAgent Assist now offers **backend modules**, an out-of-the-box option for\nintegrating Agent Assist into your system. Backend modules includes\na Cloud Pub/Sub interceptor service and a UI connector service. The interceptor processes feature-related event notifications from Dialogflow using Cloud Pub/Sub topics and then the UI connector pushes them to the agent desktop UI. UI connectors also support feedback signals from the agent desktop and sends them to Dialogflow.\n| **Note:** You can check the [GitHub repository](https://github.com/GoogleCloudPlatform/agent-assist-integrations/tree/b00b1c1438d655d0cb37848382f3ac7039433bfb/aa-integration-backend) for the latest instruction.\n\nBackend modules structure\n-------------------------\n\nBackend module components\n-------------------------\n\nBackend modules require the following Google products to integrate Agent Assist into your system:\n\n- Cloud Pub/Sub\n- Cloud Pub/Sub interceptor\n- Memorystore for Redis\n- UI connector\n\n### Cloud Pub/Sub\n\nCloud Pub/Sub topics are configured in\n[conversation profiles](/agent-assist/docs/conversation-profile).\nAgent Assist will then publish suggestions, new messages, new recognition-result notifications, and conversation\nlifecycle-related events to the topic. Suggestions are in the form of\n[`HumanAgentAssistantEvent`](/dialogflow/es/docs/reference/rest/v2/HumanAgentAssistantEvent),\nand both new messages and conversation lifecycle events in the form of\n[`ConversationEvent`](/dialogflow/es/docs/reference/rest/v2/ConversationEvent).\nFor each conversation profile, these four kinds of event messages are published\nto different topics. For example, a conversation lifecycle event message might\nbe `{\"conversation\":\"projects/your-project-id/locations/global/conversations/your-conversation-id\",\"type\":\"CONVERSATION_STARTED\"}`,\nwhich indicates the start of a conversation.\n\n### Cloud Pub/Sub interceptor\n\nThe Cloud Pub/Sub interceptor is deployed on [Cloud Run](https://cloud.google.com/run/docs).\nThe functionality of each container instance (server) of this Cloud Run service\nis identical to each other instance, including:\n\n- Processing event messages posted by Cloud Pub/Sub topics using HTTP requests.\n- Publishing messages received to Redis Pub/Sub channels, specific to the conversation name and the UI connector server ID. The channel format is `{connector_id}:{conversation_name}`.\n\n### Redis\n\nRedis uses [Memorystore for Redis](/memorystore/docs/redis/redis-overview) to do the following:\n\n- Record the UI connector server ID information for each conversation in mapping `\u003cconversation_name, connector_id\u003e`.\n- Forward event notifications published by Cloud Pub/Sub interceptor to the corresponding UI connector server using the Redis Pub/Sub mechanism.\n\n### UI connector\n\nUI connector is an application that exposes a RESTful Dialogflow API\nproxy and a SocketIO WebSocket endpoint to stream Dialogflow messages\noriginating from Agent Assist.\nUI connector is deployed on [Cloud Run](/run/docs).\nBecause WebSocket connections are stateful, the agent desktop will stay\nconnected to the same container on Cloud Run throughout the lifespan of the\nconnection. Therefore, every UI connector server handles different conversations\nand subscribes to distinct Redis Pub/Sub channels (`{connector_id}:*`) for the\nconversations they handle. Tasks for each UI connector server:\n\n- Supports a customized authentication method for agent desktops.\n- Generates temporary JWT after authenticating agent desktops' customized tokens. When they send requests to the Dialogflow API or WebSocket connection, UI connectors validate the attached JWT instead of checking the original agent token.\n- Establishes a SocketIO WebSocket connection with the authenticated agent desktop based on a given conversation name.\n- Subscribes event messages to Redis Pub/Sub channels for the conversations it handles.\n- Pushes Agent Assist events to the desktop UI as they are received.\n\n### Secret Manager\n\nThe UI connector needs a JWT secret key to generate temporary JWTs for\nauthenticated agent desktops. This secret key is stored in the\n[Secret Manager](https://cloud.google.com/secret-manager).\n\nDirectory\n---------\n\nThe following is an outline of directory structure in the code repository.\nContact your Google representative for permissions if you are not able to access\nthe repository. \n\n```\n.\n├── cloud-pubsub-interceptor\n│ ├── Dockerfile: Docker-image creation for Cloud Pub/Sub Interceptor deployment on Cloud Run\n│ ├── main.py: A starter for flask app\n│ ├── requirements.txt: Python packages for running Cloud Pub/Sub Interceptor service\n│ └── unit_test.py: Unit test code for Cloud Pub/Sub Interceptor\n├── cloudbuild.yaml: An example configuration file for Cloud Build\n├── deploy.sh: An automated deployment script\n├── images\n├── readme.md\n└── ui-connector\n ├── Dockerfile: Builds Docker image for UI Connector deployment on Cloud Run\n ├── auth.py: JWT validation and registration handling\n ├── auth_options.py: Support for authentication through different identity providers\n ├── config.py: Configuration for variables about authentication, logging, and CORS origins\n ├── dialogflow.py: With Dialogflow utilities for runtime-conversation handling\n ├── main.py: A starter for flask app\n ├── requirements.txt: Python packages for running UI Connector\n ├── templates\n │ └── index.html: A simple interactive demo\n └── unit_test.py: Unit test code for UI Connector\n```\n\nPricing and quotas\n------------------\n\nAgent Assist integrations include the following services, which have their own applicable pricing and quota limits.\n\n- Agent Assist [prices](/agent-assist/pricing) and [quotas](/agent-assist/docs/quotas)\n- Pub/Sub [prices](/pubsub/pricing) and [quotas](/pubsub/quotas)\n- Memorystore [prices](/memorystore/docs/redis/pricing) and [quotas](/memorystore/docs/redis/quotas)\n- Cloud Run [prices](/run/pricing) and [quotas](/run/quotas)\n\nWhat's next\n-----------\n\nSee the\n[backend modules installation guide](/agent-assist/docs/backend-module-install)\nfor more information about getting started with this integration method."]]