add vector_store

This commit is contained in:
2026-05-15 08:39:47 +00:00
parent c9f762b17e
commit b4ba5bdec5
+13
View File
@@ -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)