Skip to content

Commit

Permalink
Merge pull request #73 from KruxAI/qdrant-weaviate
Browse files Browse the repository at this point in the history
VectorDB Support: Qdrant & Weaviate
  • Loading branch information
ashwinzyx authored Oct 19, 2024
2 parents 1f760e9 + 2e30edc commit ebaca9e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,7 @@ rerankers
rerankers[flashrank]
rerankers[gpt]
gensim
ragatouille
ragatouille
langchain-qdrant
fastembed
langchain-weaviate
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
long_description = fh.read()
setup(
name='ragbuilder',
version='0.0.19',
version='0.0.21',
author='Ashwin Aravind, Aravind Parameswaran',
author_email='[email protected], [email protected]',
description='RagBuilder is a toolkit designed to help you create optimal Production-ready Retrieval-Augmented Generation (RAG) pipeline for your data',
Expand Down Expand Up @@ -95,7 +95,10 @@
'rerankers[flashrank]',
'rerankers[gpt]',
'gensim',
'ragatouille'
'ragatouille',
'langchain-qdrant',
'fastembed',
'langchain-weaviate'
# 'llama-index',
# 'llama-index-vector-stores-chroma',
# 'llama-index-readers-web',
Expand Down
3 changes: 3 additions & 0 deletions src/ragbuilder/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
SelfQueryRetriever,
TimeWeightedVectorStoreRetriever
)
import weaviate
from langchain_weaviate.vectorstores import WeaviateVectorStore
from langchain_qdrant import QdrantVectorStore, RetrievalMode, FastEmbedSparse
from rerankers import Reranker
from langchain_core.documents import Document
from langchain.retrievers.document_compressors import *
Expand Down
12 changes: 12 additions & 0 deletions src/ragbuilder/langchain_module/vectordb/vectordb.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ def getVectorDB(db_type,embedding_model):
code_string= f"""c = Milvus.from_documents(splits,embedding,collection_name='{index_name}',connection_args={{"uri": MILVUS_CONNECTION_STRING}},)"""
print(code_string)
import_string = f"""from langchain_milvus import Milvus"""
elif db_type == "qdrantDB":
logger.info("qdrant DB Loaded")
code_string= f"""sparse_embeddings = FastEmbedSparse(model_name="Qdrant/bm25")
c = QdrantVectorStore.from_documents(splits,embedding,location=":memory:",collection_name='{index_name}',retrieval_mode=RetrievalMode.HYBRID,sparse_embedding=sparse_embeddings)"""
import_string = f"""from langchain_qdrant import QdrantVectorStore, RetrievalMode, FastEmbedSparse
from qdrant_client import QdrantClient"""
elif db_type == "weaviateDB":
logger.info("weaviate DB Loaded")
code_string= f"""weaviate_client = weaviate.connect_to_local()
c = WeaviateVectorStore.from_documents(docs, embedding, client=weaviate_client)"""
import_string = f"""import weaviate
from langchain_weaviate.vectorstores import WeaviateVectorStore"""
elif db_type == "singleStoreDB":
index_name = "testindex_ragbuilder"
logger.info("Singlestore DB Loaded")
Expand Down
8 changes: 8 additions & 0 deletions src/ragbuilder/templates/layouts.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ <h6 class="h6">Vector DB</h6>
<input type="radio" class="form-check-input" name="vectorDB" id="singleStoreDB" unchecked>
<label class="form-check-label" for="singleStoreDB">Singlestore DB</label>
</div>
<div class="form-group form-check mx-3">
<input type="radio" class="form-check-input" name="vectorDB" id="qdrantDB" unchecked>
<label class="form-check-label" for="qdrantDB">Qdrant DB</label>
</div>
<div class="form-group form-check mx-3">
<input type="radio" class="form-check-input" name="vectorDB" id="weaviateDB" unchecked>
<label class="form-check-label" for="weaviateDB">Weaviate DB</label>
</div>
</div>

<div class="col-md-6 mt-5">
Expand Down

0 comments on commit ebaca9e

Please sign in to comment.