Auto-Retrieval from a Vector Database - LlamaIndex 🦙 0.8.15
Many popular vector dbs support a set of metadata filters in addition to a query string for semantic search. Given a natural language query, we first use the LLM to infer a set of metadata filters as well as the right query string to pass to the vector db (either can also be blank). This overall query bundle is then executed against the vector db. This allows for more dynamic, expressive forms of retrieval beyond top-k semantic search. The relevant context for a given query may only require filtering on a metadata tag, or require a joint combination of filtering + semantic search within the filtered set, or just raw semantic search. We demonstrate an example with Chroma, but auto-retrieval is also implemented with many other vector dbs (e.g. Pinecone, Weaviate, and more). We first define imports and define an empty Chroma collection. We insert some sample nodes containing text chunks into the vector database. Note that each TextNode not only contains the text, but also metadata e.g. ca
This guide shows how to perform auto-retrieval in LlamaIndex. Many popular vector dbs support a set of metadata filters in addition to a query string for semantic search. Given a natural language query, we first use the LLM to infer a set of metadata filters as well as the right query string to pass to the vector db (either can also be blank). This overall query bundle is then executed against the vector db. This allows for more dynamic, expressive forms of retrieval beyond top-k semantic search. The relevant context for a given query may only require filtering on a metadata tag, or…
saved by
related reading
- GitHub - getmetal/motorhead: 🧠 Motorhead is a memory and information retrieval server for LLMs.github.com
- The vector database to build knowledgeable AI | Pineconepinecone.io
- Voyage AI | Homevoyageai.com
- Advanced Retriever Techniques to Improve Your RAGs | Towards Data Sciencetowardsdatascience.com
- Read in smrysmry.ai
- Retrieval | OpenAI APIplatform.openai.com
- turbopufferturbopuffer.com
- Not All Vector Databases Are Made Equal | Towards Data Sciencetowardsdatascience.com
- From prototype to production: Vector databases in generative AI applications - Stack Overflowstackoverflow.blog
- Building Performant RAG Applications for Production | Developer Documentationdocs.llamaindex.ai
- Semantic Search - Sentence Transformers documentationsbert.net
- Vector databases explained | Lantern Bloglantern.dev