tidevec 0.1.0__py3-none-any.whl
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.
- tidevec/__init__.py +20 -0
- tidevec/client.py +602 -0
- tidevec/cortexdb_pb2.py +123 -0
- tidevec/cortexdb_pb2_grpc.py +635 -0
- tidevec/tidevec_pb2.py +123 -0
- tidevec/tidevec_pb2_grpc.py +635 -0
- tidevec-0.1.0.dist-info/METADATA +159 -0
- tidevec-0.1.0.dist-info/RECORD +9 -0
- tidevec-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tidevec
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for TideVec — temporally-aware causal vector database
|
|
5
|
+
Project-URL: Homepage, https://tidevec.io
|
|
6
|
+
Project-URL: Repository, https://github.com/ashishodu2023/TideVec
|
|
7
|
+
Project-URL: Documentation, https://tidevec.io/docs
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/ashishodu2023/TideVec/issues
|
|
9
|
+
Author-email: Ashish Verma <contact@getcortexops.com>
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
Keywords: ANN,RAG,agentic-AI,embeddings,vector-database
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Database
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Requires-Dist: grpcio-tools>=1.54.0
|
|
24
|
+
Requires-Dist: grpcio>=1.54.0
|
|
25
|
+
Requires-Dist: protobuf>=4.0.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: black; extra == 'dev'
|
|
28
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
31
|
+
Provides-Extra: numpy
|
|
32
|
+
Requires-Dist: numpy>=1.24; extra == 'numpy'
|
|
33
|
+
Provides-Extra: pandas
|
|
34
|
+
Requires-Dist: pandas>=2.0; extra == 'pandas'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# tidevec-py
|
|
38
|
+
|
|
39
|
+
Python SDK for [TideVec](https://github.com/ashishodu2023/TideVec) — the world's first temporally-aware, causally-indexed vector database.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install tidevec-py
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from tidevec import TideVec, HalfLife
|
|
51
|
+
|
|
52
|
+
# Connect
|
|
53
|
+
db = TideVec("localhost:6399")
|
|
54
|
+
|
|
55
|
+
# Create a collection
|
|
56
|
+
db.create_collection(
|
|
57
|
+
"docs",
|
|
58
|
+
dim=768,
|
|
59
|
+
half_life_ms=HalfLife.ONE_WEEK, # fresh vectors rank higher
|
|
60
|
+
temporal_blend=0.3, # 30% time, 70% semantic
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# Upsert vectors
|
|
64
|
+
db.upsert("docs", [
|
|
65
|
+
{
|
|
66
|
+
"id": "doc_001",
|
|
67
|
+
"embedding": [0.1, 0.2, ...], # 768-dim
|
|
68
|
+
"payload": {"source": "confluence", "team": "platform"},
|
|
69
|
+
"ttl_seconds": 86400, # expire in 24 hours
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "doc_002",
|
|
73
|
+
"embedding": [0.3, 0.4, ...],
|
|
74
|
+
"payload": {"source": "jira"},
|
|
75
|
+
"edges": [{"target_id": "doc_001", "type": "UPDATES", "weight": 0.9}],
|
|
76
|
+
},
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
# Search with temporal scoring
|
|
80
|
+
results = db.search(
|
|
81
|
+
"docs",
|
|
82
|
+
query_vector=[0.1, 0.2, ...],
|
|
83
|
+
top_k=10,
|
|
84
|
+
temporal_blend=0.3,
|
|
85
|
+
include_staleness_warnings=True,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
for hit in results:
|
|
89
|
+
print(f"{hit.id} score={hit.score:.4f} temporal={hit.temporal_score:.3f}")
|
|
90
|
+
if hit.staleness_warning:
|
|
91
|
+
print(f" ⚠️ {hit.staleness_reason}")
|
|
92
|
+
|
|
93
|
+
# Causal expansion
|
|
94
|
+
results = db.search(
|
|
95
|
+
"docs",
|
|
96
|
+
query_vector=[0.1, 0.2, ...],
|
|
97
|
+
mode="causal_expand",
|
|
98
|
+
causal_hops=2,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# Contradiction detection
|
|
102
|
+
results = db.search(
|
|
103
|
+
"docs",
|
|
104
|
+
query_vector=[0.1, 0.2, ...],
|
|
105
|
+
mode="contradiction_check",
|
|
106
|
+
)
|
|
107
|
+
for hit in results:
|
|
108
|
+
if hit.contradicted_by:
|
|
109
|
+
print(f"{hit.id} is contradicted by {hit.contradicted_by}")
|
|
110
|
+
|
|
111
|
+
# Batch search (GPU/TPU accelerated)
|
|
112
|
+
responses = db.batch_search(
|
|
113
|
+
"docs",
|
|
114
|
+
query_vectors=[[0.1, ...], [0.5, ...], [0.9, ...]],
|
|
115
|
+
top_k=5,
|
|
116
|
+
device="gpu", # "auto" | "gpu" | "tpu" | "cpu"
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
# With trace for observability (CortexOps integration)
|
|
120
|
+
results = db.search("docs", query_vector=[...], include_trace=True)
|
|
121
|
+
print(f"latency={results.latency_ms:.1f}ms strategy={results.strategy}")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Async
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
import asyncio
|
|
128
|
+
from tidevec import AsyncTideVec
|
|
129
|
+
|
|
130
|
+
async def main():
|
|
131
|
+
async with AsyncTideVec("localhost:6399") as db:
|
|
132
|
+
await db.upsert("docs", [{"id": "v1", "embedding": [...]}])
|
|
133
|
+
results = await db.search("docs", query_vector=[...], top_k=5)
|
|
134
|
+
for hit in results:
|
|
135
|
+
print(hit.id, hit.score)
|
|
136
|
+
|
|
137
|
+
asyncio.run(main())
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Context manager
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
with TideVec("localhost:6399", api_key="mykey") as db:
|
|
144
|
+
db.create_collection("agents", dim=1536, half_life_ms=HalfLife.ONE_HOUR)
|
|
145
|
+
# ... operations
|
|
146
|
+
# connection auto-closed
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## HalfLife presets
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
from tidevec import HalfLife
|
|
153
|
+
|
|
154
|
+
HalfLife.AGENT_SESSION # 1 hour — per-session agent memory
|
|
155
|
+
HalfLife.ONE_DAY # 1 day — news / feeds
|
|
156
|
+
HalfLife.ONE_WEEK # 7 days — support tickets
|
|
157
|
+
HalfLife.ONE_MONTH # 30 days — documents (default)
|
|
158
|
+
HalfLife.ONE_YEAR # 365 days — long-term knowledge base
|
|
159
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
tidevec/__init__.py,sha256=Cwg57L7eB-FVKWVh2zKuJ3HXP1ZhZsaryINdsWax60Y,344
|
|
2
|
+
tidevec/client.py,sha256=zfxLodxFw_oSaJwA8wqWycSWf0vKaSxphjE1cD9db3g,20717
|
|
3
|
+
tidevec/cortexdb_pb2.py,sha256=cSn5C8nFqoHoX_79yFulWGXhAN-4wyrk7U3dMshhMTk,14605
|
|
4
|
+
tidevec/cortexdb_pb2_grpc.py,sha256=aJPHo3MMNE4fOEIIxGZ7jZJgVJWsnQFwhCK0PVHXZCA,24047
|
|
5
|
+
tidevec/tidevec_pb2.py,sha256=EOZ9NlcIF4SIiGFjo5uQ75qbAKzY7NtgjT8sKaL61SI,14596
|
|
6
|
+
tidevec/tidevec_pb2_grpc.py,sha256=aJPHo3MMNE4fOEIIxGZ7jZJgVJWsnQFwhCK0PVHXZCA,24047
|
|
7
|
+
tidevec-0.1.0.dist-info/METADATA,sha256=4uI1iyzlIKfBiui_g2lJzVYGUkG90ahf6D9lUU_wueE,4536
|
|
8
|
+
tidevec-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
9
|
+
tidevec-0.1.0.dist-info/RECORD,,
|