-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Python: postgres memory store #1354
Python: postgres memory store #1354
Conversation
@microsoft-github-policy-service agree |
Working on change to conform to new Memory Record field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cschadewitz Thank you for contribution! I left initial comments. As soon as they are resolved, we will test it locally and if everything works as expected - merge it to main! 😃
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cschadewitz Thank you for all the hard work! I left some comments, but some of them can be definitely resolved in scope of follow-up PR. I think the most important one which should be resolved before merging to main is regarding timezones, please find the details under my comment. Thanks again!
Thanks again!
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/postgres/postgres_memory_store.py
Show resolved
Hide resolved
…hadewitz/semantic-kernel_python-pinecone-connector into python_postgres_memory_store
…opg (psycopg-binary) is not recommened for production dependencies)
…hadewitz/semantic-kernel into python_postgres_memory_store
Hi @cschadewitz - I'm setting up infra to be able to run the integration tests in CI. As soon as that's set up, we'll get this in asap. |
Great work @cschadewitz , wondering if there is any pre-release i can use to test it ? |
Funny you should ask, I made a request for python to get nightly/pre-release builds during yesterdays community hour. Here is another community member that wants pre-release pip packages @alexchaomander . |
for now i download the code and added a reference to this file so i can test my kernel with this memory connector, if i find a problem will report here, thanks again for putting it together. |
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? Brings parity to python implementation 2. What problem does it solve? With the pgvector extension, Postgres is a viable option for the storing of embeddings for memory in Semantic Kernel. The C# implementation is already capable of this, but the feature has yet to be added to python. 3. What scenario does it contribute to? Additional options for memory storage 4. If it fixes an open issue, please link to the issue here. --> ### Description Implemention of the MemoryStore to use a Postgresql (with pgvector extension) to resolve microsoft#1270 Taking a different approach from the .net implementation: Collections as postgres schemas as opposed to collection being another column in the table, willing to change to match but would love to have a discussion comparing the options. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com> Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com> Co-authored-by: Abby Harrison <abby.harrison@microsoft.com> Co-authored-by: Abby Harrison <54643756+awharrison-28@users.noreply.github.com>
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? Brings parity to python implementation 2. What problem does it solve? With the pgvector extension, Postgres is a viable option for the storing of embeddings for memory in Semantic Kernel. The C# implementation is already capable of this, but the feature has yet to be added to python. 3. What scenario does it contribute to? Additional options for memory storage 4. If it fixes an open issue, please link to the issue here. --> ### Description Implemention of the MemoryStore to use a Postgresql (with pgvector extension) to resolve microsoft#1270 Taking a different approach from the .net implementation: Collections as postgres schemas as opposed to collection being another column in the table, willing to change to match but would love to have a discussion comparing the options. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com> Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com> Co-authored-by: Abby Harrison <abby.harrison@microsoft.com> Co-authored-by: Abby Harrison <54643756+awharrison-28@users.noreply.github.com>
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? Brings parity to python implementation 2. What problem does it solve? With the pgvector extension, Postgres is a viable option for the storing of embeddings for memory in Semantic Kernel. The C# implementation is already capable of this, but the feature has yet to be added to python. 3. What scenario does it contribute to? Additional options for memory storage 4. If it fixes an open issue, please link to the issue here. --> ### Description Implemention of the MemoryStore to use a Postgresql (with pgvector extension) to resolve microsoft#1270 Taking a different approach from the .net implementation: Collections as postgres schemas as opposed to collection being another column in the table, willing to change to match but would love to have a discussion comparing the options. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com> Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com> Co-authored-by: Abby Harrison <abby.harrison@microsoft.com> Co-authored-by: Abby Harrison <54643756+awharrison-28@users.noreply.github.com>
Motivation and Context
Description
Implemention of the MemoryStore to use a Postgresql (with pgvector extension) to resolve #1270
Taking a different approach from the .net implementation:
Collections as postgres schemas as opposed to collection being another column in the table, willing to change to match but would love to have a discussion comparing the options.
Contribution Checklist
dotnet format