Redis
Redis Certified

Persist chat memory in Redis

yaml
type: io.kestra.plugin.ai.memory.Redis
yaml
id: chat_with_memory
namespace: company.ai

inputs:
  - id: first
    type: STRING
    defaults: Hello, my name is John and I'm from Paris
  - id: second
    type: STRING
    defaults: What's my name and where am I from?

tasks:
  - id: first
    type: io.kestra.plugin.ai.rag.ChatCompletion
    chatProvider:
      type: io.kestra.plugin.ai.provider.GoogleGemini
      modelName: gemini-2.5-flash
      apiKey: "{{ secret('GEMINI_API_KEY') }}"
    embeddingProvider:
      type: io.kestra.plugin.ai.provider.GoogleGemini
      modelName: gemini-embedding-exp-03-07
      apiKey: "{{ secret('GEMINI_API_KEY') }}"
    embeddings:
      type: io.kestra.plugin.ai.embeddings.KestraKVStore
    memory:
      type: io.kestra.plugin.ai.memory.Redis
      host: localhost
      port: 6379
    systemMessage: You are a helpful assistant, answer concisely
    prompt: "{{ inputs.first }}"

  - id: second
    type: io.kestra.plugin.ai.rag.ChatCompletion
    chatProvider:
      type: io.kestra.plugin.ai.provider.GoogleGemini
      modelName: gemini-2.5-flash
      apiKey: "{{ secret('GEMINI_API_KEY') }}"
    embeddingProvider:
      type: io.kestra.plugin.ai.provider.GoogleGemini
      modelName: gemini-embedding-exp-03-07
      apiKey: "{{ secret('GEMINI_API_KEY') }}"
    embeddings:
      type: io.kestra.plugin.ai.embeddings.KestraKVStore
    memory:
      type: io.kestra.plugin.ai.memory.Redis
      host: localhost
      port: 6379
      drop: AFTER_TASKRUN
    systemMessage: You are a helpful assistant, answer concisely
    prompt: "{{ inputs.second }}"
Properties
DefaultNEVER
Possible Values
NEVERBEFORE_TASKRUNAFTER_TASKRUN
Default{{ labels.system.correlationId }}
Default10
Default6379
DefaultPT1H