smart-memory

Flexible memory management node for n8n with support for multiple storage backends

Package Information

Released: 10/1/2025
Downloads: 1,334 weekly / 4,705 monthly
Latest Version: 1.0.7
Author: hypocrite

Documentation

Smart Memory for n8n

A flexible, configuration-driven memory management node for n8n that supports multiple storage backends and chat types.

Features

  • Chat-Type Aware: Different handling for private chats vs group chats
  • Smart User Mapping: Configure how user names are displayed
  • Multiple Storage Backends: In-memory, Google Sheets, Redis
  • Configurable Assistant Identity: Customize how the assistant is identified
  • Optional Features: Reply context, semantic/episodic memory extraction
  • Token Efficient: Only stores essential information

Installation

  1. Clone this repository
  2. Install dependencies: npm install
  3. Build the node: npm run build
  4. Start n8n with the node: n8n start --nodes ./dist

Usage

Basic Setup

  1. Add the "Smart Memory" node to your workflow
  2. Configure the basic settings:
    • Memory Window Size: Number of messages to keep in memory
    • Assistant Role: How the assistant should be identified (e.g., "Assistant", "Bot")
    • User Display Name Expression: Expression to combine user name fields
    • Storage Backend: Choose where to store memory data

Advanced Configuration

User Field Mapping

The node allows flexible mapping of user fields:

// Default display name expression
={{ $json.message.from.first_name + " " + $json.message.from.last_name }}

// Alternative expressions
={{ $json.message.from.username }}
={{ $json.customFields.displayName }}
={{ "User" + $json.message.from.id }}

Discussion