Vector Search is Eating the Web
Tags: javascript, vectordatabase, webdev, ai
Published: 2024-04-30 13:08:40

The way we search for stuff on the web is changing thanks to two popular techniques that are rising with the tide of AI: Vector Search and Retrieval Augmented Generation (RAG). These techniques are reshaping the landscape of search technologies, giving rise to answering engines like [Perplexity](https://perplexity.ai) over traditional search engines like Google. 

[Orama](https://oramasearch.com/), an [open-source](https://github.com/askorama/orama), edge-first hybrid search engine highlights the industry's shift towards more efficient, accurate, and scalable solutions. Recent trends indicate a shift from traditional search solutions to more modern and efficient answering engines like Orama, evidenced by the search features on both [Node.js](https://nodejs.org/en/docs) and [SolidJS](https://docs.solidjs.com/) that were formerly powered by Algolia, but are now powered by Orama. 

Orama, designed to be lightweight with zero dependencies, is a hybrid search engine: it uses a combination of vector search *and* full-text search to deliver the most meaningful results in nanoseconds. This post delves into these technologies, their implications, and how they are being integrated into various platforms.

## Understanding Vector Search

Vector Search, sometimes referred to as semantic search, utilizes vectors: numerical representations of data, to perform similarity searches. Unlike traditional keyword-based searches, Vector Search understands the context and nuances of the query, providing more relevant results even when exact words are not used. This method is particularly effective in handling complex datasets where relationships between data points can be more effectively represented in multi-dimensional space. The technology has been embraced by various platforms, leveraging embedding vectors to enhance the accuracy and relevance of search results.

## Retrieval Augmented Generation (RAG)

Retrieval Augmented Generation (RAG) is a sophisticated framework that enhances the capabilities of large language models (LLMs) by integrating them with external knowledge bases. I made a [YouTube video](https://www.youtube.com/watch?v=zusVHcThinM) about this if you're interested in going into more detail, including a tutorial on how to build your own RAG application. RAG addresses several limitations of LLMs, such as their static knowledge base and the tendency to produce hallucinated content. By dynamically retrieving relevant information at runtime, RAG ensures that the responses generated by LLMs are both accurate and up-to-date, making it invaluable for applications requiring high levels of reliability and specificity in their responses.

A great example of RAG at scale, this is [Perplexity](https://perplexity.ai)'s entire product for the time being, enabling users to **retrieve** results from the web and use them to **augment** **generation** from a selection of language models, including Mistral, GPT-4, Claude 3, and more.

## RAG Building Blocks

When it comes to building one's own RAG applications, [DataStax](https://datastax.com)'s [Astra](https://astra.datastax.com) seems to be the preferred database solution for deploying RAG applications, thanks to its robust API and integrations that facilitate the development of high-performance RAG applications. Astra DB's architecture supports the high demands of RAG by providing low latency and high relevancy in data retrieval, which are pretty important for the real-time performance of RAG-enabled applications.

Given the robustness of Apache Cassandra (under the hood of Astra DB) at scale and the volume of data that can be used with Astra's vector search capabilities for RAG, it seems to be a natural fit for the technology. This is why Astra DB has been recognized as a top-rated database solution by [TrustRadius in multiple categories](https://www.datastax.com/blog/datastax-astra-db-nabs-three-prestigious-2023-trustradius-best-of-awards-dominates-the-vector-databases-category), including Vector Databases.

## Conclusion

The advancements in Vector Search and RAG, combined with the strategic implementation of technologies like DataStax Astra and Orama, are setting new benchmarks in the field of search and information retrieval. These technologies not only enhance the accuracy and efficiency of search functions but also pave the way for more intelligent and responsive systems. As we continue to witness the integration of these technologies across different platforms, the future of search looks promising, with vast potential for innovation and improvement.

## Further Reading

To keep reading and learning, here are some resources that may help you:

- https://www.databricks.com/glossary/retrieval-augmented-generation-rag
- https://www.nightfall.ai/ai-security-101/retrieval-augmented-generation-rag
- https://thezal.dev/article_orama_astro/
- https://www.datastax.com/blog/vector-search-is-generally-available
- https://portal.gitnation.org/contents/javascript-based-full-text-search-with-orama-everywhere
- https://askorama.ai
- https://www.techtarget.com/whatis/definition/vector-search
- https://www.bavest.co/en/post/what-is-rag-retrieval-augmented-generation-explained
- https://aws.amazon.com/what-is/retrieval-augmented-generation/
- https://opster.com/guides/opensearch/opensearch-machine-learning/introduction-to-vector-search/
- https://blogs.nvidia.com/blog/what-is-retrieval-augmented-generation/
- https://www.youtube.com/watch?v=q2AxKzjM9vg
- https://www.pinecone.io/learn/vector-search-basics/
- https://research.ibm.com/blog/retrieval-augmented-generation-RAG
- https://www.algolia.com/blog/ai/what-is-vector-search/
- https://stackoverflow.blog/2023/10/18/retrieval-augmented-generation-keeping-llms-relevant-and-current/
- https://qwik.dev/docs/integrations/orama/
- https://www.algolia.com/blog/product/algolia-vs-open-source-search/