mirror of
https://github.com/langchain-ai/langchain-pinecone.git
synced 2026-07-18 10:47:30 -04:00
[PR #49] [MERGED] Fix Pinecone Async Performance Issue with Host Configuration #66
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langchain-ai/langchain-pinecone/pull/49
Author: @bajajku
Created: 6/6/2025
Status: ✅ Merged
Merged: 7/23/2025
Merged by: @jamescalam
Base:
james/async-perf← Head:issue#39📝 Commits (10+)
7ecebc2fix: exclude 'truncate' parameter for 'cohere-rerank-3.5' model in rerank functionality. Add respective unit test as well6ec8360Merge branch 'main' into mainb669426chore: fix lint issues00c36f2fix: apply paramsbfd1162feat: add host parameter to PineconeVectorStore to avoid unnecessary sync index creation and improve async index handling684f1c0fix: make integration tests more resilient by skipping when credentials are missing1d2aeb8Merge branch 'main' into issue#39c97a2cffix: resolve PineconeEmbeddings validation errors in tests4c1262emake format6e39a9frefactor: update Pinecone client initialization to use convert_to_secret_str for API key handling📊 Changes
5 files changed (+258 additions, -8 deletions)
View changed files
📝
libs/pinecone/README.md(+30 -0)📝
libs/pinecone/langchain_pinecone/vectorstores.py(+26 -5)📝
libs/pinecone/langchain_pinecone/vectorstores_sparse.py(+2 -0)📝
libs/pinecone/tests/integration_tests/test_embeddings.py(+33 -3)📝
libs/pinecone/tests/unit_tests/test_vectorstores.py(+167 -0)📄 Description
Pull Request: Fix Pinecone Async Performance Issue with Host Configuration
Description
Fixed a critical performance issue in the Pinecone vector store where async operations were making unnecessary synchronous network calls. The
async_indexproperty was callingself.index.config.hoston every access, which triggered sync API calls and violated Pinecone's best practices.Changes made:
hostparameter to constructor for direct host specificationPINECONE_HOSTenvironment variable as fallbackasync_indexproperty to use cached host instead of making sync callsType
🚀 Performance Enhancement / 🐛 Bug Fix
Testing
Added unit tests to verify:
Relevant Issues
Issue #39
Code Changes
Performance Impact
self.index.config.hostsync network call🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.