semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Add support for weaviate as a memory store (Python)

Open hsm207 opened this issue 2 years ago • 11 comments

Motivation and Context

  1. Why is this change required? Add support for weaviate as a memory store
  2. What problem does it solve? People want to use weaviate as a memory store
  3. What scenario does it contribute to? See point 2
  4. If it fixes an open issue, please link to the issue here. #803

Description

Implement MemoryStoreBase for weaviate

Contribution Checklist

  • [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)
  • [] 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 :smile:

hsm207 avatar May 04 '23 08:05 hsm207

@awharrison-28 @tawalke how's the review going?

hsm207 avatar May 08 '23 07:05 hsm207

@awharrison-28 @tawalke how's the review going?

Hi @hsm207 thanks for checking in, it is in progress.

Would you mind ensuring the branch is updated with changes from main branch and updated code as needed. Thanks!

tawalke avatar May 08 '23 12:05 tawalke

@hsm207 Thanks for updating, will provide more feedback as I test calls to Weaviate service shortly.

tawalke avatar May 09 '23 00:05 tawalke

@awharrison-28 I've incorporated your feedback

hsm207 avatar May 10 '23 00:05 hsm207

Double clicking on a question: will the integration test run as is? I think an external service needs to be stood up for it run in CI?

@awharrison-28 yes, it will run as is (answered in this comment earlier). Since we are running embedded weaviate, an external service does not need to be stood up. The weaviate client will download the binary when the test is being set up.

hsm207 avatar May 12 '23 02:05 hsm207

Consider updating FEATURE_MATRIX.md to include these changes in the Connectors and Skill Libraries section.

@lemillermicrosoft done!

hsm207 avatar May 12 '23 23:05 hsm207

@hsm207 Looks like embedded weaviate is unix only? Could you add skips to the tests if the host system is windows?

awharrison-28 avatar May 15 '23 18:05 awharrison-28

@hsm207 Looks like embedded weaviate is unix only? Could you add skips to the tests if the host system is windows?

@awharrison-28 Embedded weaviate is linux only at the moment.

What's the teams preferred way to check for host OS and skip tests?

hsm207 avatar May 15 '23 18:05 hsm207

@hsm207

I think something like this should do the trick:

if os.name == 'nt':
    is_windows=True
@pytest.mark.skipif(is_windows, reason="Embedded Weaviate is currently Linux only")

Will it fail on MacOS as well?

awharrison-28 avatar May 15 '23 23:05 awharrison-28

@awharrison-28

I think something like this should do the trick:

if os.name == 'nt':
    is_windows=True
@pytest.mark.skipif(is_windows, reason="Embedded Weaviate is currently Linux only")

Will it fail on MacOS as well?

yes, it will fail on MacOS as well. We have plans to add support for MacOS and Windows too.

I've updated the tests so that it only runs on Linux.

If you want, I can also set up a weaviate docker compose so that it will run on all platforms. Just let me know how you want to organize the files.

hsm207 avatar May 16 '23 10:05 hsm207

fixed merge conflicts and updated poetry lock

awharrison-28 avatar May 22 '23 23:05 awharrison-28

@hsm207 please run and commit poetry lock - this will account for the downstream dependencies of the weaviate client package.

awharrison-28 avatar Jun 02 '23 19:06 awharrison-28

@tawalke could you review this PR please?

hsm207 avatar Jun 03 '23 02:06 hsm207