Lola NLP AI v2 icon

Lola NLP AI v2

Basic Lola Sample Node

Lola NLP AI v2

AI-generated

Overview

The Lola NLP AI v2 node integrates with the Lola AI platform to process natural language messages using various GPT-based models. It is designed for conversational AI scenarios, such as chatbots or virtual assistants, where context-aware responses and advanced features like topic and mood detection are required. The node can operate in synchronous (waits for a response) or asynchronous (returns immediately, response handled elsewhere) modes.

Practical examples:

  • Building a chatbot that leverages a custom knowledge base and adapts its responses based on conversation history.
  • Implementing customer support automation with topic switching and mood detection.
  • Integrating AI-driven message processing into messaging platforms (e.g., Telegram).

Properties

Name Meaning
Knowledge Base The Knowledge Base used to train the AI to understand the context of the conversation.
Mode How the node operates:
- Sync: Waits for Lola's response and outputs it.
- Async: Returns immediately; response will be available in the Lola Callback node.
Model Selects the AI model:
- GPT3 4K
- GPT-3.5 Turbo 4K
- GPT-4 8K
- GPT-4 32K
Execution ID The n8n execution ID, used to track the workflow execution.
Load From Message Composer Whether the message is coming from the Message Composer. If true, some fields are auto-filled from incoming data.
Incoming Message The text message from the user. Only shown if "Load From Message Composer" is false.
Chat Identifier A unique identifier for the chat session. Only shown if "Load From Message Composer" is false.
Message Identifier An identifier to track the specific message. Only shown if "Load From Message Composer" is false.
Source ID The source of the message (e.g., Telegram). Only shown if "Load From Message Composer" is false.
Main Scope Main prompt scope (number of previous messages considered for context).
Switch Topic Whether to automatically switch topics during the conversation.
Topic Shift Detection Enables detection of topic shifts in the conversation.
User Shift Detection Number Number of messages to consider for detecting user-initiated topic shifts.
Mood Detection Enables mood detection in the conversation.
Mood Detection Scope Number of recent messages to analyze for mood detection.
Allow Retries Whether to allow retries for NLP processing.
Maximun Retries Maximum number of retries for NLP processing. Only shown if "Allow Retries" is true.
Allow Client Commands Allows client commands such as /debug.
Skip Append To History On Topic Change Skips appending to conversation history when the topic changes.
Prompt Params Additional metadata parameters as key-value pairs to pass to the AI.
SubPrompts List of sub-prompts, each with a topic and associated text, used for topic-specific prompting.

Output

The node produces three possible outputs (main, cmd, err):

  • Main output (json.lola_response):
    Contains the processed response from Lola AI, structured as follows:
{
  "header": {
    "executionId": "...",
    "workflowId": "...",
    "source": "...",
    "chatId": "...",
    "msgId": "..."
  },
  "content": {
    "type": "text",
    "text": "...",
    "subPrompts": [
      { "topic": "...", "text": "..." }
    ],
    "params": { "key": "value" },
    "prompt": "...",
    "commands": [...]
  },
  "settings": {
    "language": "en",
    "autoSwitchTopic": true,
    "topicShiftDetection": true,
    "topicShiftDetectionScope": 5,
    "moodDetection": true,
    "moodDetectionScope": 5,
    "retries": 0,
    "allowClientCommands": true,
    "onTopicShiftSkipAppendToHistory": false,
    "model": "gpt3",
    "mainPromptScope": 10
  }
}
  • Command output:
    If the response type is "command", the item is sent to the second output.

  • Error output:
    If an error occurs, the third output contains:

{
  "lola_response": {
    "error": "<error object>"
  }
}

Dependencies

  • External Service: Requires access to the Lola AI API endpoint.
  • API Key: Needs a valid lolaKeyApi credential (token and URI).
  • n8n Configuration: Ensure the Lola API credentials are set up in n8n.

Troubleshooting

Common issues:

  • Invalid Credentials: If the Lola API token or URI is missing or incorrect, requests will fail.
  • Missing Required Fields: Not providing required properties (e.g., Incoming Message, Chat Identifier) may cause errors.
  • API Errors: If the Lola API returns an error, it will appear in the lola_response.error field in the third output.

Error messages:

  • "lola_response": { "error": ... }
    Indicates an issue with the request or Lola API. Check credentials, input data, and API availability.

Resolution steps:

  • Double-check all required fields and credentials.
  • Review the error message in the output for clues.
  • Ensure the Lola API service is reachable from your n8n instance.

Links and References

Discussion