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

metadata integration with Pinecone #437

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

nsadeh
Copy link

@nsadeh nsadeh commented Jan 2, 2024

Resolves #435

Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

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

@nsadeh thanks a lot for your contribution! Please check my comment.

.build())
.putAllFields(textSegments.get(i).metadata().asMap().entrySet()
.stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> Value.newBuilder().setStringValue(e.getValue()).build()))));
Copy link
Owner

Choose a reason for hiding this comment

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

With this change, metadata is stored, but not retrieved during read. Please update PineconeEmbeddingStoreIT to extend EmbeddingStoreIT (instead of EmbeddingStoreWithoutMetadataIT). should_add_embedding_with_segment_with_metadata will fail.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I'll try to get to it today

Copy link
Author

Choose a reason for hiding this comment

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

Changed as requested - is that it? Sorry, I am not familiar with Java testing

Copy link
Author

Choose a reason for hiding this comment

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

All my tests succeed when I run ./mvnw test except for Neo4J which I doubt is related

Copy link
Owner

Choose a reason for hiding this comment

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

Hi @nsadeh, should_add_embedding_with_segment_with_metadata test still fails because there is no code that reads stored metadata key-value pairs when retrieving embeddings. You have added code for writing metadata, but not for reading back.

Copy link
Author

Choose a reason for hiding this comment

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

@langchain4j latest commit should do it

Copy link
Owner

Choose a reason for hiding this comment

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

@nsadeh 3 tests are now failing:
should_add_embedding_with_segment
should_add_multiple_embeddings_with_segments
should_add_embedding_with_segment_with_metadata

Copy link
Author

Choose a reason for hiding this comment

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

I am going to need a lot more hand-holding on the tests here.

When I run ./mvnw test, the pinecone tests succeed.

When I run these tests specifically from IntelliJ, they fail because they're missing an API key. I haven't been able to find the test api key in the repo.

What's the SOP here for running pinecone tests?

Copy link
Owner

Choose a reason for hiding this comment

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

@nsadeh sorry for the delayed response... You can registed on pinecone.io and get a free key for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Pinecone should support storing metadata
2 participants