Partials allow you to reuse shared configuration across plugins.
Some plugins in Kong Gateway share common configuration settings that often need to be repeated. Partials allow you to extract those shared configurations into reusable entities that can be linked to multiple plugins. Without Partials, you would need to replicate this configuration across all plugins. If the settings change, you would need to update each plugin individually.
To ensure validation and consistency, Partials have defined types. Kong Gateway supports the following Partial types:
redis-ce: A short and simple Redis configuration.
redis-ee: A Redis configuration with support for Redis Sentinel or Redis Cluster connections.
vectordbv3.13+: Vector database connection and search settings, shared across AI plugins that perform semantic search.
embeddingsv3.13+: Embeddings model provider and authentication, shared across AI plugins that generate vector embeddings.
modelv3.13+: LLM provider, model name, authentication, and inference settings, shared across AI plugins that call language models.
Each plugin supports only the Partial types listed in its documentation.
In Konnect, Partials are only supported for bundled Konnect plugins. Custom plugins don’t support Partials.
Define a Redis Partial once and reference it across plugins to avoid repeating connection details, reduce configuration errors, and ensure consistent Redis behavior. The following plugins use Redis for storing counters, sessions, or cached data:
In Konnect, open API Gateway from the sidebar, then choose a control plane.
In Kong Manager, select your Workspace.
Select Plugins.
Click New Plugin and choose a plugin.
Choose a scope for the plugin:
Global, which applies the plugin to all Gateway Services, Routes, Consumers, and Consumer Groups in the Workspace (Kong Manager) or control plane (Konnect).
Scoped, which lets you choose a specific Gateway Service, Route, Consumer, or Consumer Group to apply the plugin to.
The types of entities you have available here depend on the plugin you picked.
Configure your plugin. The configuration options will depend on which plugin you picked.
In Konnect, open API Gateway from the sidebar, then choose a control plane.
In Kong Manager, select your Workspace.
Select Plugins.
Click New Plugin and choose a plugin.
Choose a scope for the plugin:
Global, which applies the plugin to all Gateway Services, Routes, Consumers, and Consumer Groups in the Workspace (Kong Manager) or control plane (Konnect).
Scoped, which lets you choose a specific Gateway Service, Route, Consumer, or Consumer Group to apply the plugin to.
The types of entities you have available here depend on the plugin you picked.
Configure your plugin. The configuration options will depend on which plugin you picked.
AI Gateway plugins often share the same vector database, embeddings model, or LLM configuration across multiple plugins. For example, you might run both the AI Semantic Cache plugin and the AI RAG Injector plugin against the same pgvector database using the same OpenAI embeddings model. Without Partials, you would need to define this configuration in each plugin individually.
With AI Partials, define the shared configuration once and link it to any number of plugins.
The AI Proxy Advanced plugin supports all three AI Partial types. A model Partial applies to each entry in the config.targets array, so you can share one provider configuration across multiple targets.
The following examples use OpenAI as the embeddings and model provider, and pgvector as the vector database.
You’ll need an OpenAI API key and a running pgvector instance.
Once created, link AI Partials to plugins the same way as Redis Partials: pass the Partial ID in the partials array. See Add a Partial to a plugin.
You cannot provide inline configuration for the same fields that a linked Partial covers. Either define the settings directly in the plugin, or leave that block empty and use a Partial instead.
Use the Partials feature in your custom plugins by adjusting the plugin schema.
To make custom plugins compatible with Partials, add the supported_partials key to the schema and specify
the appropriate Partial type.
Here is an example schema for a custom plugin using a Partial:
Be aware that when using a Partial, the configuration belonging to the Partial is no longer stored alongside
the plugin. If your code relies on Kong Gateway’s DAO and expects entities to contain Redis information,
this data won’t be retrieved when using kong.db.plugins:select(plugin_id).
Such a call will only fetch data stored in the plugin itself.
To include the Partial’s data within the plugin configuration, you must pass a special option parameter,
such as: kong.db.plugins:select(plugin_id, { expand_partials = true }).