Cooking up faster RAG using in-database embeddings in SurrealDB
Blog post from SurrealDB
The blog post discusses the advantages of using SurrealDB for building Retrieval Augmented Generation (RAG) pipelines by generating in-database embeddings, thus eliminating the reliance on external APIs. Traditional RAG pipelines face issues like latency, cost, complexity, and security risks due to external API usage for generating vector embeddings. SurrealDB, a multi-model database, integrates SurrealML to store and execute machine learning models, allowing developers to create embeddings directly within the database using SurrealQL functions. This approach reduces dependencies, enhances security, and lowers costs, facilitating more efficient semantic searches. By storing word embeddings in a simple table structure, SurrealDB enables quick and seamless retrieval of semantically similar data, akin to a well-organized spice rack. The database's ability to handle various data types and its user-defined functions for averaging word vectors into sentence embeddings streamline the process of retrieving relevant information for LLMs, fostering the development of secure and cost-effective RAG applications without the complexities of external embedding calls.