AI RAG Injector Policy

RAG injection with OpenAI and Redis

Configure the AI RAG Injector policy to inject content to use Redis as vector database and the OpenAI text-embedding-3-large model for embedding.

This example uses text-embedding-3-large, which supports up to 3072 dimensions. If you use text-embedding-ada-002 instead, you must set dimensions to exactly 1536.

Prerequisites

  • An existing AI Model.

  • 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!