Skip to content

Postgres connector for Semantic Memory - #946

Merged
Adrian Bonar (adrianwyatt) merged 17 commits into
microsoft:mainfrom
JadynWong:jadyn/feature-postgres-memory
May 19, 2023
Merged

Adrian Bonar (adrianwyatt) merged 17 commits into
microsoft:mainfrom
JadynWong:jadyn/feature-postgres-memory

Conversation

@JadynWong

Copy link
Copy Markdown
Contributor

Motivation and Context

Postgres supports cosine similarity search by installing the pgvector extension.

Description

Add a new Semantic Memory Connector leveraging Postgres with pgvector extension. Update the syntax example to demonstrate how it is used.

Contribution Checklist

Close #945

@github-actions github-actions Bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel samples labels May 11, 2023
@JadynWong

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@JadynWong
Jadyn (JadynWong) marked this pull request as draft May 11, 2023 16:56
@JadynWong
Jadyn (JadynWong) force-pushed the jadyn/feature-postgres-memory branch from d7a1a14 to 4dda575 Compare May 11, 2023 17:23
@JadynWong

Jadyn (JadynWong) commented May 11, 2023 •

Copy link
Copy Markdown
Contributor Author

I need some help, because some packages depend on different versions of nuget and cause conflict warnings when compiling.

Pgvector 0.1.2 -> Npgsql 7.0.0 -> Microsoft.Bcl.HashCode (>= 1.1.1)
Pgvector 0.1.2 -> Npgsql 7.0.0 -> System.Text.Json (>= 7.0.0)
Pgvector 0.1.2 -> Npgsql 7.0.0 -> System.Text.Json 7.0.0 -> Microsoft.Bcl.AsyncInterfaces (>= 7.0.0)
Microsoft.SemanticKernel.Skills.Web -> System.Text.Json 6.0.0
SemanticKernel.Abstractions -> System.Text.Json 6.0.0 ~~

Update

After merge #955, it seems normal.

@JadynWong
Jadyn (JadynWong) force-pushed the jadyn/feature-postgres-memory branch from 4dda575 to fb79006 Compare May 11, 2023 17:35
@JadynWong
Jadyn (JadynWong) marked this pull request as ready for review May 11, 2023 17:40
@JadynWong
Jadyn (JadynWong) force-pushed the jadyn/feature-postgres-memory branch 2 times, most recently from 76960ea to a449a73 Compare May 12, 2023 01:26
@github-actions github-actions Bot added the python Pull requests for the Python Semantic Kernel label May 12, 2023
@JadynWong
Jadyn (JadynWong) force-pushed the jadyn/feature-postgres-memory branch from a449a73 to 7ab1cbd Compare May 12, 2023 01:29
@github-actions github-actions Bot removed the python Pull requests for the Python Semantic Kernel label May 12, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR, looks great overall. If you could add a readme with instructions on quickly setting up postgres locally or even just a link to documentation would be helpful.

@JadynWong
Jadyn (JadynWong) force-pushed the jadyn/feature-postgres-memory branch from 7ab1cbd to d83ccc6 Compare May 12, 2023 16:54
@JadynWong

Copy link
Copy Markdown
Contributor Author

Thanks for the PR, looks great overall. If you could add a readme with instructions on quickly setting up postgres locally or even just a link to documentation would be helpful.

I have added the README.md file.
https://github.com/JadynWong/semantic-kernel/blob/jadyn/feature-postgres-memory/dotnet/src/Connectors/Connectors.Memory.Postgres/README.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested, works! Thanks again for putting this together. One minor change potentially in the readme. Otherwise LGTM.

@lemillermicrosoft Lee Miller (lemillermicrosoft) added the PR: ready for review All feedback addressed, ready for reviews label May 12, 2023
@adrianwyatt Adrian Bonar (adrianwyatt) added PR: feedback to address Waiting for PR owner to address comments/questions and removed PR: ready for review All feedback addressed, ready for reviews labels May 15, 2023
@JadynWong

Copy link
Copy Markdown
Contributor Author

Hi, Adrian Bonar (@adrianwyatt),

Can you review these new commits and let me know if there is anything else that can be done?

Thank you!

@JadynWong

Copy link
Copy Markdown
Contributor Author

Hi Lee Miller (@lemillermicrosoft). It looks like the formatting style of the .cs file was changed by #1030. Can you retrigger these actions?
Thanks.

@lemillermicrosoft Lee Miller (lemillermicrosoft) added PR: ready for review All feedback addressed, ready for reviews PR: ready to merge PR has been approved by all reviewers, and is ready to merge. and removed PR: feedback to address Waiting for PR owner to address comments/questions labels May 19, 2023
@adrianwyatt
Adrian Bonar (adrianwyatt) enabled auto-merge (squash) May 19, 2023 15:55
@adrianwyatt
Adrian Bonar (adrianwyatt) merged commit c88d42e into microsoft:main May 19, 2023
@JadynWong
Jadyn (JadynWong) deleted the jadyn/feature-postgres-memory branch May 20, 2023 00:38
Shawn Callegari (shawncal) pushed a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
### Motivation and Context
Postgres supports cosine similarity search by installing the [pgvector
extension](https://github.com/pgvector/pgvector).

### Description
Add a new Semantic Memory Connector leveraging Postgres with pgvector
extension. Update the syntax example to demonstrate how it is used.
John (johnoliver) pushed a commit to johnoliver/semantic-kernel that referenced this pull request Jun 5, 2024
### Motivation and Context
Postgres supports cosine similarity search by installing the [pgvector
extension](https://github.com/pgvector/pgvector).

### Description
Add a new Semantic Memory Connector leveraging Postgres with pgvector
extension. Update the syntax example to demonstrate how it is used.
John (johnoliver) pushed a commit to johnoliver/semantic-kernel that referenced this pull request Jun 5, 2024
### Motivation and Context
Postgres supports cosine similarity search by installing the [pgvector
extension](https://github.com/pgvector/pgvector).

### Description
Add a new Semantic Memory Connector leveraging Postgres with pgvector
extension. Update the syntax example to demonstrate how it is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews PR: ready to merge PR has been approved by all reviewers, and is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use postgres with pgvector extension as memory store

3 participants