Lola Store icon

Lola Store

Lola Store allows you to store data in Lola related to a specific tenant/chatSession

Overview

The Lola Store node allows you to interact with a key-value store associated with a specific chat or session. It supports three main operations: retrieving a value, setting a value, and clearing chat history. This node is useful for workflows that need to persist data between executions, manage per-session state, or handle chat histories in conversational automations.

Common scenarios:

  • Storing user preferences or session variables during a chat.
  • Retrieving previously stored values for use in subsequent workflow steps.
  • Clearing chat history while optionally retaining a specified number of recent messages.

Practical examples:

  • In a chatbot workflow, save the user's last message or context for continuity.
  • Retrieve a stored authentication token for API calls.
  • Clear all but the last 5 messages from a chat session when a reset is triggered.

Properties

Name Meaning
Operation The action to perform:
- Get: Retrieve a value from the store
- Set: Store a value in the store
- Clear: Clear chat history
Chat/Session Identifier An identifier to individualize the chat/session. Used to scope the storage to a particular conversation or user.
Store Key The key under which the value is stored or retrieved. Required for "Get" and "Set" operations.
Store Value / GET Default Value The value to store (for "Set") or the default value to return if not found (for "Get").
Enable TTL Whether to enable a time-to-live (TTL) for the key/value pair, causing it to be deleted after the TTL expires.
TTL (Seconds) The duration in seconds before the key/value pair expires. Only shown if "Enable TTL" is true and operation is "Get" or "Set".
Keep Last # Messages The number of messages to keep in the chat history when performing the "Clear" operation.

Output

  • The node outputs a JSON object with a field named lola_store.
  • The structure of lola_store is an object where each key corresponds to a stored key, and its value is the result of the operation:
    • For "Get": The retrieved value (or the provided default if not found).
    • For "Set": The value that was set.
    • For "Clear": The output may reflect the cleared state, depending on implementation.

Example output:

{
  "lola_store": {
    "myKey": "storedValue"
  }
}

If multiple keys are used over several executions, lola_store will accumulate them as properties.

Dependencies

  • May require credentials for "lolaKeyApi" if configured, though it's marked as optional.
  • No external services or environment variables are strictly required unless your Lola Store backend enforces authentication.

Troubleshooting

Common issues:

  • Missing required fields: If "Store Key" is not provided for "Get" or "Set", the node will likely throw an error.
  • Invalid TTL: Providing a non-numeric or negative value for TTL may cause errors or unexpected behavior.
  • Chat/Session Identifier missing: Not providing a unique identifier may lead to data collisions or retrieval failures.
  • Operation not selected: If no operation is chosen, the node will not perform any action.

Error messages and resolutions:

  • "Cannot read property 'value' of undefined" — This may occur if the requested key does not exist in the store. Ensure the key exists or provide a default value.
  • "Invalid TTL value" — Make sure TTL is a positive integer if TTL is enabled.
  • "Required parameter missing" — Check that all required fields for the selected operation are filled.

Links and References

Discussion