Memory API

Use an external API as chat memory storage

Memory API

AI-generated

Summary

Provides a LangChain BufferWindowMemory backed by an external HTTP API, so an AI node can read and write conversation history per session.

Inputs

  • API URL (required) — URL of the external memory API (e.g., an n8n webhook URL). The node POSTs JSON to this URL for every memory read/write/clear operation.
  • Session ID (required) — Unique identifier for the conversation session. Defaults to {{ $json.sessionId }}.
  • API Key — Optional API key. When set, it is sent as an Authorization: Bearer header on every request.
  • Context Window Length — Number of previous messages to include as context. Passed as k to LangChain's BufferWindowMemory.

Output shape

ai_memory output containing a BufferWindowMemory instance

This is a memory-supply node. It returns a LangChain BufferWindowMemory object wrapped as { response: memory } to connected AI nodes, not normal workflow JSON.

Examples

Example 1: Use as the memory source for an AI Agent or LangChain-based node; point the API URL at an n8n webhook or external service that stores and returns chat messages per session ID.

required API URL and session ID; optional API key; context window length default 10

Links

Discussion