
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@invertase/genkitx-redis
Advanced tools
A Redis Plugin for Firebase GenKit that integrates Redis for state storage, trace storage, caching, and rate limiting.
A Redis Plugin for GenKit that adds Redis for efficient state storage, trace storage, caching, and rate limiting..
[!CAUTION] Vectors support is still in development (indexer, retriever) and not available here.
This plugin facilitates seamless interaction with Redis in GenKit for storing flow states and traces, managing cached data, and implementing rate limiting mechanisms, enhancing the scalability and performance of applications built with the GenKit AI framework.
npm install @invertase/genkit-plugin-redis
See the examples directory for sample code demonstrating how to use the Redis plugin in a GenKit application.
redisInitializes the Redis plugin.
import { configureGenkit } from "@genkit-ai/core";
import { redis } from "@invertase/genkit-plugin-redis";
configureGenkit({
plugins: [
redis({
// Tell the plugin where to connect, if not provided
// it defaults to localhost:6379 as below:
// connectionString: "redis://localhost:6379",
// Optional
flowStateStore: {
// The Redis key to use for storing flow states.
storageKey: "flowState",
},
// Optional
traceStore: {
// The Redis key to use for storing trace data.
storageKey: "trace",
},
}),
],
enableTracingAndMetrics: true,
// Tell GenKit to use the Redis plugin for flow state.
flowStateStore: "redis",
// Tell GenKit to use the Redis plugin for trace data.
traceStore: "redis",
});
Parameters:
params (optional): RedisPluginParams configuration for initializing the Redis client.Returns:
flowStateStore: An instance of RedisFlowStateStore.traceStore: An instance of RedisTraceStore.clearTraceStoreClears all entries in the trace store. Caution: This will delete all traces from the store.
Usage:
await clearTraceStore();
clearFlowStoreClears all entries in the flow state store. Caution: This will delete all flow states from the store.
Usage:
await clearFlowStore();
clearCacheClears all values from the cache or those matching a specific prefix.
Parameters:
prefix (optional): A string prefix to filter which keys to clear from the cache. If not provided, all keys will be deleted.Usage:
await clearCache(prefix);
cacheSetSets a value in the cache.
Parameters:
key: The key to set in the cache.value: The value to set in the cache. If null, the key will be deleted from the cache.ttlSeconds (optional): The time to live for the key in seconds. If not provided, the key will not expire.Usage:
await cacheSet(key, value, ttlSeconds);
cacheGetGets a value from the cache.
Parameters:
key: The key to get from the cache.Returns:
null if the key does not exist or has expired.Usage:
const value = await cacheGet<T>(key);
cacheFunctionCaches the result of a function.
Parameters:
key: The key to cache the result under.fn: The callback function to execute and cache the result of.ttlSeconds (optional): The time to live for the cached result in seconds. If not provided, the result will not expire.Returns:
Usage:
const result = await cacheFunction(key, () => myFunction(), ttlSeconds);
rateLimitChecks if a rate limit is exceeded for a given identifier. This counts as a single request for the given identifier.
Parameters:
identifier: The identifier to check the rate limit for, e.g., a user ID or a session ID.limit: The maximum number of requests allowed in a given time period.limitIntervalSeconds: The time period in seconds for which the limit is applied.Returns:
true if the rate limit is exceeded, false otherwise.Usage:
const isRateLimited = await rateLimit(identifier, limit, limitIntervalSeconds);
rateLimitWithStatusChecks the rate limit status for a given identifier. This counts as a single request for the given identifier.
Parameters:
identifier: The identifier to check the rate limit for, e.g., a user ID or a session ID.limit: The maximum number of requests allowed in a given time period.limitIntervalSeconds: The time period in seconds for which the limit is applied.Returns:
Usage:
const status = await rateLimitWithStatus(
identifier,
limit,
limitIntervalSeconds,
);
resetRateLimitResets the rate limit for a given identifier.
Parameters:
identifier: The identifier to reset the rate limit for, e.g., a user ID or a session ID.Usage:
await resetRateLimit(identifier);
clearRateLimitsClears all rate limits.
Usage:
await clearRateLimits();
Built and maintained by Invertase.
FAQs
A Redis Plugin for Firebase GenKit that integrates Redis for state storage, trace storage, caching, and rate limiting.
The npm package @invertase/genkitx-redis receives a total of 2 weekly downloads. As such, @invertase/genkitx-redis popularity was classified as not popular.
We found that @invertase/genkitx-redis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.