Skip to content

feat: upgraded to Pinecone v7#633

Merged
jamescalam merged 69 commits into
mainfrom
semantic-router/pinecone-v7
Nov 3, 2025
Merged

feat: upgraded to Pinecone v7#633
jamescalam merged 69 commits into
mainfrom
semantic-router/pinecone-v7

Conversation

@shinobi-josh

@shinobi-josh shinobi-josh commented Aug 4, 2025

Copy link
Copy Markdown
Member

PR Type

Enhancement


Description

  • Upgrade Pinecone SDK dependency to v7

  • Adapt client init to Pinecone v7 API

  • Update installation error message text

  • Adjust version spec in pyproject.toml


File Walkthrough

Relevant files
Enhancement
pinecone.py
Adapt Pinecone client to v7 API                                                   

semantic_router/index/pinecone.py

  • Import Pinecone and ServerlessSpec for v7 API
  • Update ImportError message to reference v7+
  • Remove extra blank line
+2/-5     
Dependencies
pyproject.toml
Bump Pinecone dependency to v7                                                     

pyproject.toml

  • Bump pinecone dependency to >=7.0.0,<8.0.0
+1/-1     

@shinobi-josh
shinobi-josh requested a review from jamescalam August 4, 2025 11:47
@shinobi-josh shinobi-josh self-assigned this Aug 4, 2025
@shinobi-josh shinobi-josh added the enhancement Enhancement to existing features label Aug 4, 2025
@github-actions

github-actions Bot commented Aug 4, 2025

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Import Validation

Verify that from pinecone import Pinecone, ServerlessSpec and the instantiation via Pinecone(**pinecone_args) align with Pinecone SDK v7+, as class names or initialization APIs may have changed.

    from pinecone import Pinecone, ServerlessSpec
    self.ServerlessSpec = ServerlessSpec
except ImportError:
Error Message Consistency

Ensure the ImportError installation instructions match the updated dependency version constraints and correctly reference the new Pinecone SDK v7 package.

    "Please install the Pinecone SDK v7+ to use PineconeIndex. "
    "You can install it with: `pip install 'semantic-router[pinecone]'`"
)

@github-actions

github-actions Bot commented Aug 4, 2025

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Conditionally include host parameter

Only include the host key when self.base_url is set to avoid passing None to the
Pinecone client, which could lead to connection errors. Move the host assignment
into a conditional block.

semantic_router/index/pinecone.py [252-256]

 pinecone_args = {
     "api_key": api_key,
     "source_tag": "semanticrouter",
-    "host": self.base_url,
 }
+if self.base_url:
+    pinecone_args["host"] = self.base_url
Suggestion importance[1-10]: 7

__

Why: Moving "host" into a conditional prevents passing None to Pinecone, avoiding potential connection errors when self.base_url isn’t set.

Medium
Add Pinecone version check

After importing, verify that the installed Pinecone SDK version is at least v7.0.0
and raise an informative error if not. This prevents silent failures when an
incompatible version is installed.

semantic_router/index/pinecone.py [245-246]

+import pinecone as _pinecone
 from pinecone import Pinecone, ServerlessSpec
 self.ServerlessSpec = ServerlessSpec
+version_tuple = tuple(map(int, _pinecone.__version__.split(".")))
+if version_tuple < (7, 0, 0):
+    raise ImportError(f"Pinecone SDK v7+ required, found v{_pinecone.__version__}")
Suggestion importance[1-10]: 5

__

Why: Adding a runtime check for pinecone.__version__ ensures SDK v7+ compatibility, though the pyproject already enforces this requirement.

Low

@shinobi-josh

Copy link
Copy Markdown
Member Author

note: we no longer use pinecone-client and instead is just pinecone

@shinobi-josh

Copy link
Copy Markdown
Member Author

All references to PINECONE_API_BASE_URL for Pinecone Local now use http://localhost:5080 (not http://pinecone:5080).

Comment thread docs/user-guide/guides/pinecone-v7.md Outdated
Comment thread semantic_router/index/pinecone.py Outdated
Comment thread semantic_router/index/pinecone.py Outdated
Comment thread semantic_router/index/pinecone.py Outdated
Comment thread semantic_router/index/pinecone.py
Comment thread semantic_router/index/pinecone.py Outdated
Comment thread semantic_router/index/pinecone.py Outdated
Comment thread semantic_router/index/pinecone.py Outdated
shinobi-josh and others added 19 commits August 12, 2025 02:26
…all in .dagger/src/semantic_router_ci/main.py
Add unit tests covering the gRPC toggle path, creation options, and namespace helpers.
Update docs to describe transport, deletion_protection, tags, and the new helper methods.
@jamescalam
jamescalam merged commit 7a5e264 into main Nov 3, 2025
6 checks passed
@jamescalam
jamescalam deleted the semantic-router/pinecone-v7 branch November 3, 2025 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement to existing features Review effort 1/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants