Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Postgres Chat Memory Node): Implement Postgres Chat Memory node #10071

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

OlegIvaniv
Copy link
Contributor

@OlegIvaniv OlegIvaniv commented Jul 16, 2024

Summary

  • Add Postgres Chat Memory
  • Improve wrapping of BaseChatMessageHistory & BaseChatMemory in logWrapper to make sure sub-node input/ouput is correctly populated

Docs: n8n-io/n8n-docs#2241

How to test

  1. Spin-up a Postgres instance, for example with docker-compose:
version: '3.9'

services:
  postgres:
    image: postgres:14-alpine
    ports:
      - 5432:5432
    volumes:
      - ./db:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=password
      - POSTGRES_USER=chat
      - POSTGRES_DB=chat

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Jul 16, 2024
burivuhster
burivuhster previously approved these changes Jul 16, 2024
Copy link
Contributor

@burivuhster burivuhster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Minor comments, non-blocking.

packages/@n8n/nodes-langchain/utils/helpers.ts Outdated Show resolved Hide resolved
packages/@n8n/nodes-langchain/utils/helpers.ts Outdated Show resolved Hide resolved
Copy link

cypress bot commented Jul 16, 2024

4 flaky tests on run #5951 ↗︎

0 400 0 0 Flakiness 4

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 OlegIvaniv 🗃️ e2e/*
Project: n8n Commit: 1e61222ece
Status: Passed Duration: 05:22 💡
Started: Jul 16, 2024 3:40 PM Ended: Jul 16, 2024 3:46 PM
Flakiness  5-ndv.cy.ts • 2 flaky tests

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Screenshots Video
NDV > Stop listening for trigger event from NDV Screenshots Video
Flakiness  10-undo-redo.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Undo/Redo > should undo/redo adding connected nodes Test Replay Screenshots Video
Flakiness  24-ndv-paired-item.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > resolves expression with default item when input node is not parent, while still pairing items Test Replay Screenshots Video

Review all test suite changes for PR #10071 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@OlegIvaniv OlegIvaniv force-pushed the ai-187-postgres-memory-sub-node branch from cbfa9ad to 685ddd4 Compare July 16, 2024 13:43
Copy link
Contributor

✅ All Cypress E2E specs passed

@OlegIvaniv OlegIvaniv merged commit 9cbbb63 into master Jul 17, 2024
33 checks passed
@OlegIvaniv OlegIvaniv deleted the ai-187-postgres-memory-sub-node branch July 17, 2024 06:25
@github-actions github-actions bot mentioned this pull request Jul 17, 2024
@janober
Copy link
Member

janober commented Jul 17, 2024

Got released with n8n@1.51.0

@mprytoluk
Copy link
Contributor

Got released with n8n@1.51.0

I'm afraid I can't find the Postgres Chat Memory node in n8n@1.51.0.

@Joffcom
Copy link
Member

Joffcom commented Jul 18, 2024

@mprytoluk I have just taken a look and it is there for me, How are you trying to find it?

@mprytoluk
Copy link
Contributor

@mprytoluk I have just taken a look and it is there for me, How are you trying to find it?

@Joffcom I believe there was a mistake on my side, because the node is indeed there in n8n@1.51.0. Sorry for the confusion.

@jeanpaul
Copy link
Contributor

@mprytoluk This type of node will only appear in search results if there's a node that can use it, such as the AI Agent node. You can find it manually by going to "Advanced AI > Other AI Nodes > Memory".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants