mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-18 10:48:00 -05:00
[PR #14532] [MERGED] perf pinecone.py Improve Performance and Maintainability Using Current Best Practices #62352
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/open-webui/open-webui/pull/14532
Author: @PVBLIC-F
Created: 5/30/2025
Status: ✅ Merged
Merged: 6/2/2025
Merged by: @tjbck
Base:
dev← Head:refac/pinecone📝 Commits (2)
4ecf2a8Update pinecone.py66bde32Update pinecone.py📊 Changes
1 file changed (+81 additions, -8 deletions)
View changed files
📝
backend/open_webui/retrieval/vector/dbs/pinecone.py(+81 -8)📄 Description
May 2025 Latest Pinecone Best Practices
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Just finished Pinecone Certification. Refactoring based on May 2025 Best Practices
Added
What pinecone[grpc] Includes:
grpcio - Core gRPC protocol library
grpcio-status - Enhanced gRPC status handling
googleapis-common-protos>=1.66.0 - Google API protocol buffers
Related gRPC dependencies for optimal Pinecone performance
Note: The [grpc] extra is optional but highly recommended for production deployments to achieve maximum performance gains.
Changed
1. gRPC Client Support
Added: Automatic detection and usage of Pinecone's high-performance gRPC client
Fallback: Graceful degradation to HTTP client if gRPC unavailable
Performance: ~2x faster vector operations compared to HTTP
2. Enhanced Connection Pooling
Client Threads: Increased to 20 concurrent threads (from default)
Index Threads: Dedicated 20-thread pool for index operations
Timeouts: Optimized 30-second operation timeouts
Benefit: Better handling of concurrent document uploads and searches
3. Intelligent Retry Logic
Method: _retry_pinecone_operation() with exponential backoff + jitter
Handles: Rate limits (429), network issues, temporary server errors (500-504)
Strategy: Max 3 retries with smart error classification
Benefit: Automatic recovery from temporary Pinecone API issues
4. Enhanced Error Handling
Smart Classification: Distinguishes retryable vs non-retryable errors
Jitter: Prevents thundering herd during retry attempts
Logging: Improved debugging and monitoring visibility
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Requirements.txt
remove pinecone==6.0.2
add pinecone[grpc]==6.0.2
remove googleapis-common-protos==1.63.2
add googleapis-common-protos>=1.66.0
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.