Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Jan 29, 2026

Summary

Updates learn/search/semantic-search/semantic-search.ipynb to use Pinecone Python SDK v8 instead of pinecone-client 5.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 key (env PINECONE_API_KEY or prompt)
  • Optional: PINECONE_CLOUD, PINECONE_REGION for index spec

Key changes

  • Install: pinecone-client[grpc]==5.0.1pinecone>=8.0.0
  • API key: Environment variable with getpass fallback (per notebook review template)
  • Index API: create_index(name=...), delete_index(name=...) (v8 keyword args)
  • Patterns: Existing from pinecone import Pinecone, ServerlessSpec, and pc.inference.embed usage retained; no deprecated APIs

Links


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.ipynb to use Pinecone Python SDK v8 by switching installs to pinecone>=8 and adjusting index management calls (e.g., create_index(name=...), delete_index(name=...)).

Consolidates setup into the first cell (imports, PINECONE_API_KEY prompt fallback, shared Pinecone client/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.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

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",
Copy link

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.

Fix in Cursor Fix in Web

"!pip install -qU \\\n",
" pinecone>=8.0.0 \\\n",
" datasets==2.14.6 \\\n",
" sentence-transformers==2.2.2 \\\n",
Copy link

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.

Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a 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": []
Copy link

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.

Fix in Cursor Fix in Web

@jhamon jhamon force-pushed the jhamon/sdk-200-modernize-sdk-semantic-searchipynb branch from f1d300c to 51af2ec Compare January 29, 2026 16:05
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.

2 participants