massengine 1.1.3__tar.gz → 1.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: massengine
3
- Version: 1.1.3
4
- Summary: Official Python SDK for the MassEngine vector and hybrid search database.
3
+ Version: 1.1.4
4
+ Summary: Official Python SDK for the MassEngine filtered vector search database.
5
5
  Project-URL: Homepage, https://massengine.com
6
6
  Project-URL: Documentation, https://massengine.com/docs
7
7
  Project-URL: Repository, https://github.com/massengine-dev/massengine-python
8
8
  Author-email: MassEngine <dev@massengine.com>
9
9
  License-Expression: Apache-2.0
10
10
  License-File: LICENSE
11
- Keywords: bm25,embeddings,hybrid-search,massengine,rag,vector-database
11
+ Keywords: embeddings,massengine,rag,vector-database,vector-search
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Programming Language :: Python :: 3
@@ -24,7 +24,7 @@ Description-Content-Type: text/markdown
24
24
 
25
25
  # MassEngine Python SDK (`massengine`)
26
26
 
27
- Official zero-dependency Python client for [MassEngine](https://massengine.com) — the sub-5ms filtered and hybrid vector search database.
27
+ Official zero-dependency Python client for [MassEngine](https://massengine.com) — the sub-5ms filtered vector search database.
28
28
 
29
29
  ## Installation
30
30
 
@@ -43,12 +43,12 @@ client = MassEngineClient(
43
43
  api_key="mk_your_tenant_or_meadm_admin_key",
44
44
  )
45
45
 
46
- # 1. Ingest vectors + structured metadata
46
+ # 1. Ingest dense vectors + structured metadata
47
47
  client.ingest(
48
48
  "acme-prod",
49
49
  [
50
50
  Doc(
51
- id="doc-1",
51
+ id="docs/2026/policy-1",
52
52
  vector=[0.12, -0.44, 0.88, 0.05],
53
53
  category=1,
54
54
  metadata={"department": "security", "clearance": 3, "tags": ["soc2", "policy"]},
@@ -56,12 +56,10 @@ client.ingest(
56
56
  ],
57
57
  )
58
58
 
59
- # 2. Hybrid dense + BM25 search with rich metadata filter operators
59
+ # 2. Dense vector search with rich metadata filter operators
60
60
  res = client.search(
61
61
  "acme-prod",
62
62
  vector=[0.12, -0.44, 0.88, 0.05],
63
- query_text="soc2 policy",
64
- hybrid_alpha=0.7,
65
63
  k=10,
66
64
  min_score=0.5,
67
65
  metadata_filter={
@@ -75,7 +73,7 @@ print(res["hits"])
75
73
  # 3. In-place metadata patching without re-embedding
76
74
  client.patch_doc(
77
75
  "acme-prod",
78
- "doc-1",
76
+ "docs/2026/policy-1",
79
77
  metadata={"clearance": 4, "reviewed": True},
80
78
  )
81
79
 
@@ -84,6 +82,22 @@ usage = client.get_tenant_usage("acme-prod")
84
82
  print(usage)
85
83
  ```
86
84
 
85
+ ## Multi-Database Scoping
86
+
87
+ Create isolated databases within a tenant and scope operations using `database=` (pass `tenant=""` when authenticating with a tenant-scoped `mk_...` key):
88
+
89
+ ```python
90
+ client.create_database("", "analytics", data_type="int8")
91
+
92
+ client.ingest(
93
+ "",
94
+ [Doc(id="event-1", vector=[0.1, 0.2, 0.3, 0.4])],
95
+ database="analytics",
96
+ )
97
+
98
+ hits = client.search("", vector=[0.1, 0.2, 0.3, 0.4], database="analytics", k=5)
99
+ ```
100
+
87
101
  ## License
88
102
 
89
103
  Apache License 2.0
@@ -1,6 +1,6 @@
1
1
  # MassEngine Python SDK (`massengine`)
2
2
 
3
- Official zero-dependency Python client for [MassEngine](https://massengine.com) — the sub-5ms filtered and hybrid vector search database.
3
+ Official zero-dependency Python client for [MassEngine](https://massengine.com) — the sub-5ms filtered vector search database.
4
4
 
5
5
  ## Installation
6
6
 
@@ -19,12 +19,12 @@ client = MassEngineClient(
19
19
  api_key="mk_your_tenant_or_meadm_admin_key",
20
20
  )
21
21
 
22
- # 1. Ingest vectors + structured metadata
22
+ # 1. Ingest dense vectors + structured metadata
23
23
  client.ingest(
24
24
  "acme-prod",
25
25
  [
26
26
  Doc(
27
- id="doc-1",
27
+ id="docs/2026/policy-1",
28
28
  vector=[0.12, -0.44, 0.88, 0.05],
29
29
  category=1,
30
30
  metadata={"department": "security", "clearance": 3, "tags": ["soc2", "policy"]},
@@ -32,12 +32,10 @@ client.ingest(
32
32
  ],
33
33
  )
34
34
 
35
- # 2. Hybrid dense + BM25 search with rich metadata filter operators
35
+ # 2. Dense vector search with rich metadata filter operators
36
36
  res = client.search(
37
37
  "acme-prod",
38
38
  vector=[0.12, -0.44, 0.88, 0.05],
39
- query_text="soc2 policy",
40
- hybrid_alpha=0.7,
41
39
  k=10,
42
40
  min_score=0.5,
43
41
  metadata_filter={
@@ -51,7 +49,7 @@ print(res["hits"])
51
49
  # 3. In-place metadata patching without re-embedding
52
50
  client.patch_doc(
53
51
  "acme-prod",
54
- "doc-1",
52
+ "docs/2026/policy-1",
55
53
  metadata={"clearance": 4, "reviewed": True},
56
54
  )
57
55
 
@@ -60,6 +58,22 @@ usage = client.get_tenant_usage("acme-prod")
60
58
  print(usage)
61
59
  ```
62
60
 
61
+ ## Multi-Database Scoping
62
+
63
+ Create isolated databases within a tenant and scope operations using `database=` (pass `tenant=""` when authenticating with a tenant-scoped `mk_...` key):
64
+
65
+ ```python
66
+ client.create_database("", "analytics", data_type="int8")
67
+
68
+ client.ingest(
69
+ "",
70
+ [Doc(id="event-1", vector=[0.1, 0.2, 0.3, 0.4])],
71
+ database="analytics",
72
+ )
73
+
74
+ hits = client.search("", vector=[0.1, 0.2, 0.3, 0.4], database="analytics", k=5)
75
+ ```
76
+
63
77
  ## License
64
78
 
65
79
  Apache License 2.0