Use CortexDB as a memory node in n8n workflow automations.

n8n Integration

CortexDB provides a custom n8n community node that lets you add long-term memory to any n8n workflow. Store data from any trigger, recall context for AI processing, and search your memory from within n8n's visual workflow builder.

Installation

Install the community node package in your n8n instance:

npm install n8n-nodes-cortexdb

Or install from the n8n UI: Settings > Community Nodes > search for n8n-nodes-cortexdb.

Setup

  1. After installation, go to Credentials in n8n
  2. Click Add Credential and select CortexDB API
  3. Enter your CortexDB server URL and API key
  4. Click Save

Operations

The CortexDB node supports four operations:

Remember

Store content in CortexDB's long-term memory:

  • Content: The text to store
  • Tenant ID: Tenant identifier (default: "default")

Recall

Retrieve relevant context using natural language:

  • Query: Natural language query
  • Tenant ID: Tenant identifier
  • Max Tokens: Maximum response size (default: 4096)
  • Min Confidence: Minimum confidence threshold (default: 0)

Forget

Remove memories from CortexDB:

  • Query: Query to match memories for deletion
  • Reason: Reason for the operation (useful for audit trails)
  • Tenant ID: Tenant identifier

Search

Search for matching episodes with filters:

  • Query: Search query
  • Tenant ID: Tenant identifier
  • Limit: Maximum results (default: 20)
  • Offset: Pagination offset
  • Namespace: Optional namespace filter

Example Workflows

AI Agent with Memory

  1. Webhook trigger receives a user message
  2. CortexDB Recall retrieves relevant past context
  3. OpenAI Chat generates a response using the context
  4. CortexDB Remember stores the conversation
  5. Respond to Webhook returns the response

Slack-to-Memory Pipeline

  1. Slack Trigger fires on new messages in a channel
  2. CortexDB Remember stores the message content with metadata
  3. Use CortexDB Search in other workflows to find Slack context

Scheduled Knowledge Sync

  1. Schedule Trigger runs daily
  2. HTTP Request fetches data from your internal API
  3. CortexDB Remember stores the latest data
  4. CortexDB Forget cleans up stale entries

Error Handling

The node supports n8n's Continue on Fail option. When enabled, failed operations return an error object instead of stopping the workflow:

{
  "error": "Connection refused: http://localhost:3141"
}