diff --git a/vector_store.py b/vector_store.py new file mode 100644 index 0000000..93b19f6 --- /dev/null +++ b/vector_store.py @@ -0,0 +1,13 @@ +from langchain_qdrant import QdrantStore +from langchain_ollama import OllamaEmbeddings + +class QdrantStore: + def __init__(self, url="http://localhost:6333", collection_name="rag_collection"): + self.client = QdrantStore(url=url, collection_name=collection_name) + self.embeddings = OllamaEmbeddings(model="nomic-embed-text") + + def add_documents(self, docs): + self.client.add_documents(docs, embeddings=self.embeddings) + + def search(self, query, limit=5): + return self.client.search(query, limit=limit, embeddings=self.embeddings)