惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
Y
Y Combinator Blog
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Jina AI
Jina AI
B
Blog RSS Feed
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
D
Docker

Pinecone

Pinecone Assistant: A Managed Knowledge Layer for Production AI Applications Multi-domain RAG in n8n: why one knowledge base is not enough Allspice Transforms the Culinary Experience with Semantic Search Powered by Pinecone | Pinecone Building RAG workflows in n8n: choosing the right Pinecone node Knowledge needs a meta-knowledge layer Garbage Day: How Pinecone Safely Deletes Billions of Objects at Scale When "Performance" Means Two Different Things Pinecone BYOC: Pinecone in your AWS, GCP, or Azure account, no vendor access True, Relevant, and Wrong: The Applicability Problem in RAG Use the Pinecone Plugin for Claude Code to develop AI Applications Faster Millions at Stake: How Melange's High-Recall Retrieval Prevents Litigation Collapse Powering High-stakes Patent Search at Scale: How Melange Built a Reliable AI System on Pinecone | Pinecone Pinecone Assistant Node in n8n: Turn Any Data Source Into Knowledge RAG with Access Control Pinecone Dedicated Read Nodes are now in Public Preview Inside Pinecone: Slab Architecture New Bulk Data Operations: Update, Delete, and Fetch by Metadata The Hidden Cost of Building: Lessons from Aquant Simplifying Vector Embeddings with Pinecone Integrated Inference Capabilities Pinecone joins Microsoft Marketplace as a Launch Partner GTM Engineering: Clay + Pinecone for AI-powered Sales Outbound Build an AI knowledge assistant with Google Docs and Pinecone Moving Pinecone forward with Ash Ashutosh as CEO and Edo spearheading our growing AI ambitions as Chief Scientist Pinecone Founder Edo Liberty to Spearhead Pinecone’s Growing AI Ambitions; Appoints Ash Ashutosh as CEO to Expand Vector Database Market Leadership Fast, Accurate Retrieval for Creators at Scale: Delphi’s Path Toward a Million Conversational Agents with Pinecone | Pinecone Announcing Pinecone Pioneers: A Program for Builders, Organizers, and Community Leaders What is Context Engineering? Chunking Strategies for LLM Applications Beyond the hype: Why RAG remains essential for modern AI Obviant Makes 30% More Accurate Defense Acquisition Recommendations Combining Sparse and Dense Retrieval with Pinecone | Pinecone
LangChain's Pinecone upsert speed increased by 5X
Zachary Proser · 2023-09-12 · via Pinecone

In release v0.0.281 of the LangChain Python client, we’ve increased the speed of upserts to Pinecone indexes by up to 5 times, using asynchronous calls to reduce the time required to process large batches of vectors.

You can view the pull request itself here.

Benchmarking improvements

Using pyinstrument to benchmark our changes, we saw a speed increase of up to 5X for jobs with many embeddings to upsert.

Before, chunk_size and batch_size were the only values you could tweak to fine-tune LangChain methods that perform a Pinecone upsert.

We've added embeddings_chunk_size, which is helpful when you spend most of your time waiting on your embedding model.

Before optimization, using a chunk_size of 32 and a batch_size of 32, we saw:

  • 4,000 documents took between 4-5 minutes to upsert
  • 42,000 documents took around 30 minutes to upsert

Following optimization, using the newly added parameter embeddings_chunk_size of 1000 and a batch_size of 32, we saw:

  • 4,000 documents took around 1 minute to upsert
  • 42,000 documents took between 8-10 minutes to upsert

OpenAI's text-embedding-ada-002 model was used to provide embeddings.

Quality of life improvements

We also made a few other quality-of-life improvements for users of the Pinecone integration:

Consolidating from_texts and add_texts

The from_texts method now calls add_texts under the hood for more consistent performance, so both methods take advantage of the new asynchronous pattern. This will also make both methods easier to maintain going forward.

Separating batching of embeddings and index upsert

In our pre-optimization testing of Jupyter Notebooks and integrations that wrap Pinecone, such as LangChain, we found that one of the primary bottlenecks is waiting on the conversion of inputs into embeddings, which is done by whichever embedding model you choose, completely separately from your interactions with Pinecone.

One of the more commonly used embedding models is OpenAI’s text-embedding-ada-002 model.

Part of our upsert optimization involves chunking the embeddings before upserting them.

If you are using OpenAI for your embedding model, we recommend a pool_threads value of greater than 4 when constructing your Pinecone index and using an emedding_chunk_size of at least 1000 and a batch_size of 64 for ideal performance.

Automatically setting thread_pool size when instantiating Pinecone index

The pool_threads setting determines the number of threads to use for asynchronous requests. More threads means more concurrent API requests.

In general, increasing pool_threads should increase performance for asynchronous workloads, but setting this value too high could lead to API rate limits or memory issues.

By default, the Pinecone Python client now passes a pool_threads value of 4 when connecting to an Index.

The default embedding_chunk_size value of 1000 is passed to add_texts and from_texts methods

You can override this value as desired to fine-tune performance for your specific use case, but in our testing, this is a good default for most use cases.

Give it a shot!

You can try out the latest and greatest by installing the Python LangChain package of version v0.0.281 or later. If you have any feedback or encounter any issues, please file an issue against either the LangChain or Pinecone Python client repository as appropriate.