feat(oss): port v3 pipeline with hybrid search, entity extraction, and additive scoring (#4805)

Co-authored-by: Soumil Rathi <soumilrathi@gmail.com>
Co-authored-by: Saket Aryan <saketaryan2002@gmail.com>
Co-authored-by: chaithanyak42 <chaithanya.kumar42a@gmail.com>
Co-authored-by: kartik-mem0 <kartik.labhshetwar@mem0.ai>
This commit is contained in:
soumil-rathi
2026-04-14 18:00:58 +05:30
committed by GitHub
co-authored by Soumil Rathi Saket Aryan chaithanyak42 kartik-mem0
parent 57f944e18a
commit a488e19044
120 changed files with 10107 additions and 17135 deletions
+12 -3
View File
@@ -4,7 +4,7 @@ import unittest
import uuid
from unittest.mock import MagicMock, patch
from qdrant_client import QdrantClient
from qdrant_client import QdrantClient, models
from qdrant_client.models import (
DatetimeRange,
Distance,
@@ -18,6 +18,7 @@ from qdrant_client.models import (
PointStruct,
PointVectors,
Range,
SparseVectorParams,
VectorParams,
)
@@ -59,8 +60,14 @@ class TestQdrant(unittest.TestCase):
expected_config = VectorParams(size=128, distance=Distance.COSINE, on_disk=True)
expected_sparse_config = {
"bm25": SparseVectorParams(modifier=models.Modifier.IDF),
}
self.client_mock.create_collection.assert_called_with(
collection_name="test_collection", vectors_config=expected_config
collection_name="test_collection",
vectors_config=expected_config,
sparse_vectors_config=expected_sparse_config,
)
def test_insert(self):
@@ -231,7 +238,9 @@ class TestQdrant(unittest.TestCase):
self.client_mock.upsert.assert_called_once()
point = self.client_mock.upsert.call_args[1]["points"][0]
self.assertEqual(point.id, vector_id)
self.assertEqual(point.vector, updated_vector)
# v3 uses named vectors: dense vector stored under "" key
self.assertIn("", point.vector)
self.assertEqual(point.vector[""], updated_vector)
self.assertEqual(point.payload, updated_payload)
def test_update_with_none_vector_uses_set_payload(self):