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

[Feature Request] Allow IndexConnection to be used with multiple namespaces #81

Open
anuraaga opened this issue Oct 16, 2024 · 1 comment
Labels
enhancement New feature or request status:needs-triage An issue that needs to be triaged by the Pinecone team

Comments

@anuraaga
Copy link

What motivated you to submit this feature request?

IndexConnection is tied to a single namespace, which is passed in request messages. This means we need an IndexConnection per namespace even though there is no reason the same gRPC connection couldn't be used for all of them. For a service that has downstream requests that are segmented by namespace (e.g., a namespace per tenant in a multi-tenant system), either a connection pool needs to be maintained or connection is opened/closed per request. Both have some complexity or overhead that shouldn't be required for a gRPC request parameter.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Methods that can operate on a single namespace passed by the user. Some approaches could be

  • additional version of each method, e.g. UpsertVectorsNamespace, which follows the pattern of methods in the standard library that accept context, slog.Info / slog.InfoContext.
  • pass it in context.Context to keep the same current signatures, e.g. UpsertVectors(pinecone.ContextWithNamespace(ctx, "my-namespace"), vectors)
  • Create a new class with same methods as current but accept namespace, e.g. Index

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

If the gRPC generated code was public we could try using it directly, and otherwise we may need to use the protos and generate ourselves.

Additional context
Add any other context or screenshots about the feature request here.

@anuraaga anuraaga added the enhancement New feature or request label Oct 16, 2024
@github-actions github-actions bot added the status:needs-triage An issue that needs to be triaged by the Pinecone team label Oct 16, 2024
@austin-denoble
Copy link
Contributor

Hi @anuraaga, thanks a lot for the great suggestions. You're right, the ergonomics of working with namespaces within an IndexConnection could be improved.

We've added a ticket to take a look at this in an upcoming sprint, thanks again. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request status:needs-triage An issue that needs to be triaged by the Pinecone team
Projects
None yet
Development

No branches or pull requests

2 participants