6 open-source Pinecone alternatives for LLMs
Tags: ai, llms, integration
Published: 2023-10-10 06:53:07

---
title: 6 open-source Pinecone alternatives for LLMs
published: true
date: 2023-06-28 22:00:00 UTC
tags: AI, LLMs, integration
canonical_url: https://blog.apify.com/pinecone-alternatives/
---

 **Were** [**Apify**](https://apify.it/data-for-ai) **, and our mission is to make the web more programmable. This article about alternatives to Pinecone was inspired by our work on getting better data for AI.** [**Check us out**](https://apify.it/data-for-ai) **.**

In a previous blog post, I introduced you to [Pinecone](https://blog.apify.com/what-is-pinecone-why-use-it-with-llms/), which is one of the most popular [vector databases](https://blog.apify.com/what-is-a-vector-database/) around. If you want to know more about Pinecone or vector databases in general, I suggest you read those blog posts I just linked to.

Oh, youre still here? Then I guess youre already familiar with Pinecone and vector databases. But that doesnt mean I wont subject you to some preamble. Before we get to our list of open-source alternatives, lets at least touch upon why theyre so important for large language models.

{% embed https://youtu.be/8uvHH-ocSes %}

## **How do vector databases help with LLMs?**

[Large language models have brought generative AI into the mainstream](https://blog.apify.com/what-is-generative-ai/), but they have a couple of drawbacks:

### **1) Large language models have a word limit**

LLMs have limited memory, so they can accept only a [certain number of tokens](https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them) as input. If you want to fit more than a few thousand words into an LLM at once, you need to fine-tune the model by training it on new data or extracting only the relevant text for your prompt.

Thats where vector embeddings come in. Embedding is an AI term for a group of vectors that represent text to capture and map the semantic meaning of words. These embeddings can break up content into manageable chunks that can be fed into the limited context of a language model like ChatGPT. However, this creates a new problem. Where do you store these embeddings? Vector databases are the answer.

> 🤖 **Fast, reliable data for ChatGPT and LLMs**  
> Use data extraction tools to get the data you need to [**feed your vector databases**](https://apify.com/data-for-generative-ai)

### **2) Large language models are stuck in the past**

Its well-known that LLMs were trained on data from before 2022. Want ChatGPT to help you with content related to current news or finding the best available properties on Airbnb this summer? It will do one of two things: throw its hands up and bleat on about its identity as an AI language model to justify its inability to do what you want, or - worse - [hallucinate a fake answer](https://en.wikipedia.org/wiki/Hallucination_(artificial_intelligence)).

> 📢 **Update!** As of September 27, 2023, GPT-4's knowledge is no longer limited to data before September 2021

Recently, paying users of [ChatGPT gained access to the internet](https://blog.apify.com/gpt-scraper-chatgpt-access-internet/) through third-party tools and the use of [OpenAI plugins](https://openai.com/blog/chatgpt-plugins), but an even better solution is to use [web scraping](https://apify.com/web-scraping) to provide GPT or whatever LLM youre using with the information needed to answer your questions. But this creates another problem: if you have a huge dataset for your LLM, you need a way to store it and pass it on to your language model. Vector databases are again the solution.

> ✍🏻 **Need a tool to extract data for LLMs?**  
> [**Website Content Crawler**](https://apify.com/apify/website-content-crawler) automatically removes headers, footers, menus, ads, and other noise from web pages in order to return only text content that can be directly fed to language models to create chatbots and other useful AI tools.

## **Why use a Pinecone alternative?**

Pinecone is a service that stores vector data in a cloud-based Pinecone-managed database. Your applications interact with the Pinecone service through APIs to store and retrieve vector data. And while Pinecone is the industry leader when it comes to vector databases, theres one thing about it that some developers arent too keen on: it isnt open source, which means you don't have the option to host your own instance.

We love open source at Apify (check out our open-source web scraping and automation library, [Crawlee](https://crawlee.dev/)), and Im willing to bet many of you do, too. So here are six popular open-source Pinecone alternatives you might want to explore (all links to these alternatives will take you to their GitHub repo).

> 🔗Simplify data retrieval and enable advanced data analysis operations with this [**Apify - Pinecone integration**](https://apify.com/jan.turon/dataset-to-pinecone-python)

## **6 Pinecone alternatives that are open source**

### [**Weaviate**](https://github.com/weaviate/weaviate)

In early 2022, Weaviates series A funding saw open-source downloads pass the two million mark. In April this year, its [series B funding raised $50 million](https://www.prnewswire.com/news-releases/weaviate-raises-50-million-series-b-funding-to-meet-soaring-demand-for-ai-native-vector-database-technology-301803296.html)! That's certainly enough to make us pay attention to Weaviate as a Pinecone alternative. Apart from being open source, theres another difference between Pinecone and Weaviate. Pinecone is a more general-purpose vector database that can be used for multiple data types (images, audio, sensory data), while Weaviate is designed specifically for natural language or numerical data based on [contextualized word embeddings](https://www.cs.princeton.edu/courses/archive/spring20/cos598C/lectures/lec3-contextualized-word-embeddings.pdf).

### [**Milvus**](https://github.com/milvus-io/milvus)

Like Weaviate, Milvus is an open-source vector database written in Go. It was founded by the startup, Zilliz, which reached [$113 million in investment](https://www.businesswire.com/news/home/20220824005057/en/Vector-Database-Company-Zilliz-Raises-60-Million-Series-B-Extension-to-Expand-Its-Operations-in-Silicon-Valley) last year. The Milvus vector database is specifically designed from the bottom up to handle embedding vectors converted from unstructured data. It can handle queries over input vectors and is capable of indexing vectors on a huge scale.

### [**Chroma**](https://github.com/chroma-core/chroma)

Another provider that got lots of [investors for its embedding database](https://siliconangle.com/2023/04/06/chroma-bags-18m-speed-ai-models-embedding-database/) this year. Chroma lets you build Python or JavaScript LLM apps with memory and provides a local ephemeral storage option. That means that the vector data is stored on your local machine or the machine running your application. It doesnt require any external service or database to store the data.

### [**Qdrant**](https://github.com/qdrant/qdrant)

Qdrant is a vector similarity engine developed entirely in Rust, making it fast and reliable even under high load. Its vector payload supports a large variety of data types and query conditions, and filtering conditions make it useful for all sorts of neural-net or semantic-based matching, faceted search, and other applications.

### [**Faiss**](https://github.com/facebookresearch/faiss)

Faiss stands for Facebook AI similarity search. It's a library that lets you quickly search for similar multimedia documents using nearest-neighbor search implementation on a huge scale. Faiss is fundamentally an index rather than a database. It solves the approximate nearest neighbor problem rather than the storage problem.

### [**LlamaIndex**](https://github.com/jerryjliu/llama_index)

Formerly known as GPT Index, LlamaIndex is a data framework for building LLM applications. It provides tools for [data ingestion](https://blog.apify.com/what-is-data-ingestion-for-large-language-models/), structuring, retrieval, and integration with multiple application frameworks. LlamaIndex gives you the ability to query your data for any downstream LLM use case, whether its question-answering, summarization, or a component in a chatbot.

> ✍🏻  **Need to load data into LlamaIndex?**  
> [**Apify Actor Loader**](https://llamahub.ai/l/apify-actor?ref=blog.apify.com) is designed to do just that and can be subsequently used as a Tool in a LangChain Agent. View it on [GitHub](https://github.com/emptycrown/llama-hub/tree/main/llama_hub/apify/actor?ref=blog.apify.com).

## **Combine vector databases with LangChain**

I can't leave the subject of vector databases without saying a few words about [LangChain](https://blog.apify.com/what-is-langchain/), which has quickly become the library of choice for building on top of generative AI models.

Unlike the aforementioned libraries, which are specifically designed for their vector database services or indexes, LangChain is a more generic library that simplifies the process of integrating different vector databases into an application. That means you can use multiple databases and switch between them without committing to one specific service or its implementation.

You can integrate LangChain with Pinecone and all the vector databases mentioned above. You can also [integrate LangChain with Apify](https://docs.apify.com/platform/integrations/langchain), which you can use to collect data for your vector databases.

{% embed https://youtu.be/zcfeiVdiGJg %}
_How to use LangChain with Apify for large language models_