RAG injection with OpenAI and Valkeyv3.14+

Configure the AI RAG Injector plugin to use Valkey as a vector database and the OpenAI text-embedding-3-large model for embedding.

Valkey is automatically detected when using the redis vectordb strategy. Kong Gateway queries the server and uses the Valkey-specific driver when it detects a Valkey backend.

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

  • You have enabled the AI Proxy or AI Proxy Advanced plugin

  • You have an OpenAI account

  • A Valkey 8.x instance.

  • Port 6379, or your custom Valkey port is open and reachable from Kong Gateway.

Environment variables

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

  • VALKEY_HOST: The Valkey server’s host

Set up the plugin

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!