-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(learn): modernize semantic-search.ipynb to Pinecone SDK v8 #534
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
base: master
Are you sure you want to change the base?
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| " time.sleep(1)\n", | ||
| "\n", | ||
| "# connect to index\n", | ||
| "index = pc.Index(index_name)\n", |
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.
Inconsistent keyword argument usage across index operations
Low Severity · Bugbot Rules
The PR updated create_index and delete_index to use the name= keyword argument pattern for SDK v8, but describe_index(index_name) and pc.Index(index_name) still use positional arguments. This violates the repository's review rule stating "Prefer to use named keyword arguments over positional arguments." For example code meant to teach developers, having inconsistent patterns within the same code block reduces clarity.
| "!pip install -qU \\\n", | ||
| " pinecone>=8.0.0 \\\n", | ||
| " datasets==2.14.6 \\\n", | ||
| " sentence-transformers==2.2.2 \\\n", |
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.
Unused sentence-transformers dependency installed but never used
Low Severity
The sentence-transformers==2.2.2 package is installed but never imported or used anywhere in the notebook. The notebook exclusively uses pc.inference.embed from the Pinecone SDK for all embedding operations. This unused dependency increases installation time and could confuse developers about which embedding approach the notebook actually uses.
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| "# Setup complete. Connection and model name are ready for the rest of the notebook." | ||
| ], | ||
| "execution_count": null, | ||
| "outputs": [] |
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.
Code cell with only comment should be markdown
Low Severity · Bugbot Rules
A new code cell was added that contains only a comment. This cell is not functional, adds visual clutter, and duplicates information already established in the previous cell. Informational content is generally better suited for markdown cells.
f1d300c to
51af2ec
Compare
Summary
Updates
learn/search/semantic-search/semantic-search.ipynbto use Pinecone Python SDK v8 instead ofpinecone-client5.x.Audience and use case
Developers learning semantic search with Pinecone: loading Quora questions, embedding with Pinecone inference (multilingual-e5-large), upserting to a serverless index, and querying.
Prerequisites
PINECONE_API_KEYor prompt)PINECONE_CLOUD,PINECONE_REGIONfor index specKey changes
pinecone-client[grpc]==5.0.1→pinecone>=8.0.0create_index(name=...),delete_index(name=...)(v8 keyword args)from pinecone import Pinecone,ServerlessSpec, andpc.inference.embedusage retained; no deprecated APIsLinks
Note
Low Risk
Low risk documentation/notebook modernization; main risk is runtime breakage if Pinecone v8/inference APIs or dependency pins differ from the user environment.
Overview
Updates
learn/search/semantic-search/semantic-search.ipynbto use Pinecone Python SDK v8 by switching installs topinecone>=8and adjusting index management calls (e.g.,create_index(name=...),delete_index(name=...)).Consolidates setup into the first cell (imports,
PINECONE_API_KEYprompt fallback, sharedPineconeclient/model name) and makes minor notebook cleanups (consistent quoting, updated docs link, and small refactors in embedding/query/upsert snippets).Written by Cursor Bugbot for commit 51af2ec. This will update automatically on new commits. Configure here.