AI RAG Injector Policy

RAG injection with ACLs using OpenAI and Redis

Configure the AI RAG Injector policy with access control lists (ACLs) to restrict which consumer groups can access specific knowledge base collections. This configuration uses Redis as the vector database and OpenAI text-embedding-3-large for embeddings.

The example demonstrates a three-tier access model:

  • Public documents accessible to all authenticated users
  • Finance reports restricted to finance and executive groups
  • Executive confidential content accessible only to executives

Prerequisites

  • An existing AI Model.

  • An existing AI Auth Strategy.

  • Existing AI Consumer Groups that match your ACL configuration.

  • You have an OpenAI account.

  • A Redis instance.

  • Port 6379, or your custom Redis port, is open and reachable from AI Gateway.

Environment variables

  • OPENAI_API_KEY: The API key to use to connect to OpenAI

  • REDIS_HOST: The Redis server’s host

Set up the policy

Attach the policy

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!