waveflowdb-client 0.0.2__tar.gz → 0.0.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.
- waveflowdb_client-0.0.4/PKG-INFO +597 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/pyproject.toml +1 -1
- waveflowdb_client-0.0.4/readme.md +559 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client/__init__.py +1 -1
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client/client.py +99 -61
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client/config.py +13 -1
- waveflowdb_client-0.0.4/waveflowdb_client.egg-info/PKG-INFO +597 -0
- waveflowdb_client-0.0.2/PKG-INFO +0 -201
- waveflowdb_client-0.0.2/readme.md +0 -163
- waveflowdb_client-0.0.2/waveflowdb_client.egg-info/PKG-INFO +0 -201
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/LICENSE +0 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/setup.cfg +0 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client/exceptions.py +0 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client/models.py +0 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client/utils.py +0 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client.egg-info/SOURCES.txt +0 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client.egg-info/dependency_links.txt +0 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client.egg-info/requires.txt +0 -0
- {waveflowdb_client-0.0.2 → waveflowdb_client-0.0.4}/waveflowdb_client.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: waveflowdb_client
|
|
3
|
+
Version: 0.0.4
|
|
4
|
+
Summary: VectorLake SDK — Deterministic backend engine powering agent workflows
|
|
5
|
+
Author-email: "agentanalytics.ai" <nitin@agentanalytics.ai>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 agentanalytics.ai
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://agentanalytics.ai
|
|
29
|
+
Project-URL: Documentation, https://www.agentanalytics.ai/docs/waveflow-db
|
|
30
|
+
Keywords: vector db,VECTOR QUERY LANGUAGE,waveflow,agentanalytics,VQL
|
|
31
|
+
Requires-Python: >=3.8
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
Requires-Dist: requests
|
|
35
|
+
Requires-Dist: numpy
|
|
36
|
+
Requires-Dist: tqdm
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# WaveflowDB SDK Starter
|
|
40
|
+
|
|
41
|
+
A lightweight launcher script for interacting with **WaveflowDB** and performing **WaveQL (VQL) brace-based semantic retrieval**.
|
|
42
|
+
|
|
43
|
+
This starter project demonstrates how to:
|
|
44
|
+
* Configure and initialize a Vector Lake client
|
|
45
|
+
* Ingest documents (direct or path-based)
|
|
46
|
+
* Refresh documents
|
|
47
|
+
* Run semantic chat (static + dynamic)
|
|
48
|
+
* Retrieve matching documents
|
|
49
|
+
* Query namespaces
|
|
50
|
+
* Use **WaveQL-style logical filtering** for agentic retrieval
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 📌 Overview
|
|
55
|
+
|
|
56
|
+
Vector Lake is an **agentic backend for enterprises to create AI products** enabling:
|
|
57
|
+
* Natural-language structured filtering through **WaveQL (VQL)**
|
|
58
|
+
* Hybrid ranking (Filter + Semantic)
|
|
59
|
+
* Zero-schema ingestion (no JSON schemas required)
|
|
60
|
+
* SQL-like logical joins on raw text
|
|
61
|
+
* Automatic semantic fallback when filters are absent
|
|
62
|
+
|
|
63
|
+
The included client class provides methods to interact with the **Vector Lake API**.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🚀 Getting Started
|
|
68
|
+
|
|
69
|
+
### 1. Install Dependencies
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pip install waveflowdb_client
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 2. Configure API Credentials
|
|
76
|
+
|
|
77
|
+
Edit the configuration settings in your client application (e.g., `run.py`):
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
API_KEY = "your_api_key_here" # Get from https://db.agentanalytics.ai/signup
|
|
81
|
+
HOST = "https://waveflow-analytics.com"
|
|
82
|
+
VECTOR_LAKE_PATH = "/path/to/your/documents" # folder for path-based ingestion
|
|
83
|
+
USER_ID = "your_email@example.com" # your email id used for registration
|
|
84
|
+
NAMESPACE = "your_namespace" # database created via UI
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 🧠 Using WaveQL (VQL) Queries
|
|
90
|
+
|
|
91
|
+
WaveQL enables natural language filtering using brace-based logical groups:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
{clinical trials or observational studies} {type 2 diabetes} {India}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Key Rules
|
|
98
|
+
|
|
99
|
+
✔ Each `{}` is a logical filter group
|
|
100
|
+
✔ Groups combine with implicit AND
|
|
101
|
+
✔ Use AND, OR, () inside braces
|
|
102
|
+
✔ Multi-word phrases must use parentheses when operators are used
|
|
103
|
+
|
|
104
|
+
### Examples
|
|
105
|
+
|
|
106
|
+
| Correct | Incorrect |
|
|
107
|
+
|---------|-----------|
|
|
108
|
+
| `{(machine learning) or (deep learning)}` | `{machine learning or deep learning}` |
|
|
109
|
+
| `{(product manager) or (data scientist)}` | `{product manager or Delhi}` |
|
|
110
|
+
|
|
111
|
+
### Three-Tier Hybrid Ranking
|
|
112
|
+
|
|
113
|
+
WaveQL supports three-tier hybrid ranking:
|
|
114
|
+
|
|
115
|
+
- **Tier 1** — Filter + Semantic match (best)
|
|
116
|
+
- **Tier 2** — Filter-only match
|
|
117
|
+
- **Tier 3** — Semantic-only fallback
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 🧪 Using the Starter Script Functions
|
|
122
|
+
|
|
123
|
+
The provided `run.py` script contains ready-to-use function wrappers for all API calls.
|
|
124
|
+
|
|
125
|
+
### run.py Code Example
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
"""
|
|
129
|
+
run.py
|
|
130
|
+
Simple launcher for Vector Lake SDK (v1.0.0)
|
|
131
|
+
|
|
132
|
+
Allows you to:
|
|
133
|
+
- configure client (host, port, key)
|
|
134
|
+
- call ANY API: add, refresh, chat, match, health, namespace info, etc.
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
from waveflowdb_client import Config, VectorLakeClient
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
# -------------------------------------------------------
|
|
141
|
+
# CONFIGURATION (EDIT THIS ONCE)
|
|
142
|
+
# -------------------------------------------------------
|
|
143
|
+
API_KEY = "your_api_key" # visit https://db.agentanalytics.ai/signup
|
|
144
|
+
HOST = "https://waveflow-analytics.com" # OR "http://localhost"
|
|
145
|
+
VECTOR_LAKE_PATH = "/path/to/documents" # folder for path-based ingestion
|
|
146
|
+
USER_ID = "your_email@example.com" # your email id used for registration
|
|
147
|
+
NAMESPACE = "your_namespace" # database created via UI
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
# -------------------------------------------------------
|
|
151
|
+
# INITIALIZE CLIENT
|
|
152
|
+
# -------------------------------------------------------
|
|
153
|
+
def get_client():
|
|
154
|
+
cfg = Config(
|
|
155
|
+
api_key=API_KEY,
|
|
156
|
+
host=HOST,
|
|
157
|
+
vector_lake_path=VECTOR_LAKE_PATH
|
|
158
|
+
)
|
|
159
|
+
return VectorLakeClient(cfg)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
client = get_client()
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
# -------------------------------------------------------
|
|
166
|
+
# READY-TO-USE ACTION FUNCTIONS
|
|
167
|
+
# -------------------------------------------------------
|
|
168
|
+
|
|
169
|
+
def run_health():
|
|
170
|
+
"""Health check"""
|
|
171
|
+
print("\n--- HEALTH CHECK ---")
|
|
172
|
+
res = client.health_check(USER_ID, NAMESPACE)
|
|
173
|
+
print(res)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def run_add_direct():
|
|
177
|
+
"""Add docs using files_name + files_data"""
|
|
178
|
+
print("\n--- ADD DOCUMENTS (Direct Payload Mode) ---")
|
|
179
|
+
res = client.add_documents(
|
|
180
|
+
user_id=USER_ID,
|
|
181
|
+
vector_lake_description=NAMESPACE,
|
|
182
|
+
files_name=["test1.txt", "test2.txt"],
|
|
183
|
+
files_data=["hello world", "this is test doc 2"]
|
|
184
|
+
)
|
|
185
|
+
print(res)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def run_add_path():
|
|
189
|
+
"""Add docs by reading actual files from disk"""
|
|
190
|
+
print("\n--- ADD DOCUMENTS (Disk Path Mode) ---")
|
|
191
|
+
res = client.add_documents(
|
|
192
|
+
user_id=USER_ID,
|
|
193
|
+
vector_lake_description=NAMESPACE,
|
|
194
|
+
files=["file1.pdf"] # must exist inside VECTOR_LAKE_PATH
|
|
195
|
+
)
|
|
196
|
+
print(res)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def run_refresh_direct():
|
|
200
|
+
"""Refresh docs using direct data (no disk read)"""
|
|
201
|
+
print("\n--- REFRESH DOCUMENTS (Direct Data Mode) ---")
|
|
202
|
+
res = client.refresh_documents(
|
|
203
|
+
user_id=USER_ID,
|
|
204
|
+
vector_lake_description=NAMESPACE,
|
|
205
|
+
files_name=["test1.txt"],
|
|
206
|
+
files_data=["UPDATED CONTENT FOR TEST1"]
|
|
207
|
+
)
|
|
208
|
+
print(res)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def run_refresh_path():
|
|
212
|
+
"""Refresh docs by reading actual files"""
|
|
213
|
+
print("\n--- REFRESH DOCUMENTS (Path Mode) ---")
|
|
214
|
+
res = client.refresh_documents(
|
|
215
|
+
user_id=USER_ID,
|
|
216
|
+
vector_lake_description=NAMESPACE,
|
|
217
|
+
files=["file1.pdf"] # must exist
|
|
218
|
+
)
|
|
219
|
+
print(res)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def run_chat_static(query):
|
|
223
|
+
"""Chat with stored index"""
|
|
224
|
+
print("\n--- CHAT (STATIC MODE) ---")
|
|
225
|
+
res = client.get_matching_docs(
|
|
226
|
+
query=query,
|
|
227
|
+
user_id=USER_ID,
|
|
228
|
+
vector_lake_description=NAMESPACE,
|
|
229
|
+
pattern="static",
|
|
230
|
+
top_docs=5,
|
|
231
|
+
with_data=True # Typically necessary for a chat response
|
|
232
|
+
)
|
|
233
|
+
print(res)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
def run_chat_dynamic(query):
|
|
237
|
+
"""Chat using temporary files (dynamic mode)"""
|
|
238
|
+
print("\n--- CHAT (DYNAMIC MODE) ---")
|
|
239
|
+
res = client.get_matching_docs(
|
|
240
|
+
query=query,
|
|
241
|
+
user_id=USER_ID,
|
|
242
|
+
vector_lake_description=NAMESPACE,
|
|
243
|
+
pattern="dynamic",
|
|
244
|
+
files_name=["dyn1.txt"],
|
|
245
|
+
files_data=["This is dynamic content to summarize."],
|
|
246
|
+
with_data=True
|
|
247
|
+
)
|
|
248
|
+
print(res)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def run_match_static(query):
|
|
252
|
+
"""Top matching docs (static mode)"""
|
|
253
|
+
print("\n--- TOP MATCHING DOCS (STATIC) ---")
|
|
254
|
+
res = client.get_matching_docs(
|
|
255
|
+
query=query,
|
|
256
|
+
user_id=USER_ID,
|
|
257
|
+
vector_lake_description=NAMESPACE,
|
|
258
|
+
pattern="static",
|
|
259
|
+
top_docs=5,
|
|
260
|
+
threshold=0.1
|
|
261
|
+
)
|
|
262
|
+
print(res)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def run_match_dynamic(query):
|
|
266
|
+
"""Top matching docs (dynamic mode)"""
|
|
267
|
+
print("\n--- TOP MATCHING DOCS (DYNAMIC) ---")
|
|
268
|
+
res = client.get_matching_docs(
|
|
269
|
+
query=query,
|
|
270
|
+
user_id=USER_ID,
|
|
271
|
+
vector_lake_description=NAMESPACE,
|
|
272
|
+
pattern="dynamic",
|
|
273
|
+
files_name=["temp.txt"],
|
|
274
|
+
files_data=["Sample dynamic content"]
|
|
275
|
+
)
|
|
276
|
+
print(res)
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def run_match_with_data(query):
|
|
280
|
+
"""Top matching docs including chunk data"""
|
|
281
|
+
print("\n--- TOP MATCHING DOCS (WITH DATA) ---")
|
|
282
|
+
res = client.get_matching_docs(
|
|
283
|
+
query=query,
|
|
284
|
+
user_id=USER_ID,
|
|
285
|
+
vector_lake_description=NAMESPACE,
|
|
286
|
+
pattern="static",
|
|
287
|
+
top_docs=5,
|
|
288
|
+
with_data=True
|
|
289
|
+
)
|
|
290
|
+
print(res)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
def run_namespace_details():
|
|
294
|
+
"""Get namespace information"""
|
|
295
|
+
print("\n--- GET NAMESPACE DETAILS ---")
|
|
296
|
+
res = client.get_namespace_details(USER_ID, vector_lake_description=NAMESPACE)
|
|
297
|
+
print(res)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def run_docs_info():
|
|
301
|
+
"""List all stored docs + info"""
|
|
302
|
+
print("\n--- GET DOCS INFORMATION ---")
|
|
303
|
+
res = client.get_docs_information(USER_ID, NAMESPACE)
|
|
304
|
+
print(res)
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
# -------------------------------------------------------
|
|
308
|
+
# MAIN SELECTOR – RUN ANY FUNCTION YOU WANT
|
|
309
|
+
# -------------------------------------------------------
|
|
310
|
+
if __name__ == "__main__":
|
|
311
|
+
query = "YOUR QUERY HERE" # Replace with a test query
|
|
312
|
+
|
|
313
|
+
# --- UNCOMMENT ANY ONE OF THESE TO RUN THAT OPERATION ---
|
|
314
|
+
# run_health()
|
|
315
|
+
# run_add_direct()
|
|
316
|
+
# run_add_path()
|
|
317
|
+
# run_refresh_direct()
|
|
318
|
+
# run_refresh_path()
|
|
319
|
+
# run_chat_static(query)
|
|
320
|
+
# run_chat_dynamic(query)
|
|
321
|
+
# run_match_static(query)
|
|
322
|
+
# run_match_dynamic(query)
|
|
323
|
+
# run_match_with_data(query)
|
|
324
|
+
run_namespace_details()
|
|
325
|
+
# run_docs_info()
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## 📚 VectorLake Client API Reference
|
|
331
|
+
|
|
332
|
+
The `VectorLakeClient` handles request construction, API key authentication (x-api-key header), and implements retries with exponential backoff for rate limit handling. All requests use the POST method.
|
|
333
|
+
|
|
334
|
+
### 1. get_matching_docs
|
|
335
|
+
|
|
336
|
+
Retrieves documents semantically similar to a query, supporting both static (indexed) and dynamic (user-provided) data.
|
|
337
|
+
|
|
338
|
+
| Parameter | Type | Required | Description |
|
|
339
|
+
|-----------|------|----------|-------------|
|
|
340
|
+
| `query` | str | Yes | The natural language query string to search for. |
|
|
341
|
+
| `user_id` | str | Yes | The unique identifier for the user. |
|
|
342
|
+
| `vector_lake_description` | str | Yes | The target namespace (vector lake) identifier. |
|
|
343
|
+
| `pattern` | str | No (Default: "static") | Search mode: "static" for indexed docs, "dynamic" for user-provided files. |
|
|
344
|
+
| `top_docs` | int | No (Default: 10) | The maximum number of matching documents to retrieve. |
|
|
345
|
+
| `threshold` | float | No (Default: 0.2) | The similarity score threshold for filtering results. |
|
|
346
|
+
| `files_name`/`files_data` | List[str] | No (Direct Mode) | Lists of file names and corresponding contents for dynamic search. |
|
|
347
|
+
| `with_data` | bool | No (Default: False) | If True, the response includes the raw text content of the matching documents. |
|
|
348
|
+
|
|
349
|
+
**HTTP Method:** POST
|
|
350
|
+
**URL Path:** Variable (ends with `/top_matching_docs` or `/top_matching_docs_with_data`)
|
|
351
|
+
|
|
352
|
+
### 2. add_documents
|
|
353
|
+
|
|
354
|
+
Uploads and processes new documents to be indexed. Supports direct upload of data or batched processing from the local filesystem.
|
|
355
|
+
|
|
356
|
+
| Parameter | Type | Required | Description |
|
|
357
|
+
|-----------|------|----------|-------------|
|
|
358
|
+
| `user_id` | str | Yes | The unique identifier for the user. |
|
|
359
|
+
| `vector_lake_description` | str | Yes | The target namespace for document addition. |
|
|
360
|
+
| `intelligent_segmentation` | bool | No (Default: True) | If True, the service segments the documents before embedding. |
|
|
361
|
+
| `files_name`/`files_data` | List[str] | No (Direct Mode) | Names and contents for a single-request upload. Returns raw server response. |
|
|
362
|
+
| `files` | List[str] | No (Batch Mode) | File paths to read from the local filesystem for concurrent processing. Returns a Batch Envelope. |
|
|
363
|
+
| `max_workers` | int | No (Default: 5) | For batch mode, the maximum number of concurrent threads. |
|
|
364
|
+
|
|
365
|
+
**HTTP Method:** POST
|
|
366
|
+
**URL Path:** Determined by `self.config.endpoints["add_docs"]`
|
|
367
|
+
|
|
368
|
+
### 3. refresh_documents
|
|
369
|
+
|
|
370
|
+
Updates existing documents in the VectorLake. Operates identically to `add_documents`.
|
|
371
|
+
|
|
372
|
+
| Parameter | Type | Required | Description |
|
|
373
|
+
|-----------|------|----------|-------------|
|
|
374
|
+
| `user_id` | str | Yes | The unique identifier for the user. |
|
|
375
|
+
| `vector_lake_description` | str | Yes | The target namespace for document refreshment. |
|
|
376
|
+
| Others | Varies | Varies | Identical to add_documents. |
|
|
377
|
+
|
|
378
|
+
**HTTP Method:** POST
|
|
379
|
+
**URL Path:** Determined by `self.config.endpoints["refresh_docs"]`
|
|
380
|
+
**Description:** Updates or re-indexes documents in the specified vector lake namespace.
|
|
381
|
+
|
|
382
|
+
### 4. health_check
|
|
383
|
+
|
|
384
|
+
Checks the operational status of the VectorLake service.
|
|
385
|
+
|
|
386
|
+
| Parameter | Type | Required | Description |
|
|
387
|
+
|-----------|------|----------|-------------|
|
|
388
|
+
| `user_id` | str | Yes | The unique identifier for the user. |
|
|
389
|
+
| `vector_lake_description` | str | Yes | The namespace to check the health for. |
|
|
390
|
+
|
|
391
|
+
**HTTP Method:** POST
|
|
392
|
+
**URL Path:** Determined by `self.config.endpoints["health"]`
|
|
393
|
+
**Description:** Pings the backend service to check connectivity and status.
|
|
394
|
+
|
|
395
|
+
### 5. get_namespace_details
|
|
396
|
+
|
|
397
|
+
Retrieves information about the vector lake namespaces associated with a given user.
|
|
398
|
+
|
|
399
|
+
| Parameter | Type | Required | Description |
|
|
400
|
+
|-----------|------|----------|-------------|
|
|
401
|
+
| `user_id` | str | Yes | The unique identifier for the user. |
|
|
402
|
+
| `vector_lake_description` | str | No | If provided, details for only this specific namespace are returned. |
|
|
403
|
+
|
|
404
|
+
**HTTP Method:** POST
|
|
405
|
+
**URL Path:** Determined by `self.config.endpoints["get_namespace_details_by_userid"]`
|
|
406
|
+
**Description:** Fetches metadata about one or all vector lake namespaces belonging to the user.
|
|
407
|
+
|
|
408
|
+
### 6. get_docs_information
|
|
409
|
+
|
|
410
|
+
Retrieves metadata and information about the documents within a specified namespace, optionally filtered by a keyword.
|
|
411
|
+
|
|
412
|
+
| Parameter | Type | Required | Description |
|
|
413
|
+
|-----------|------|----------|-------------|
|
|
414
|
+
| `user_id` | str | Yes | The unique identifier for the user. |
|
|
415
|
+
| `vector_lake_description` | str | Yes | The namespace to query. |
|
|
416
|
+
| `keyword` | str | No | An optional keyword to filter the returned documents. |
|
|
417
|
+
| `threshold` | int | No (Default: 70) | A threshold used for filtering documents. |
|
|
418
|
+
|
|
419
|
+
**HTTP Method:** POST
|
|
420
|
+
**URL Path:** Determined by `self.config.endpoints["get_docs_information"]`
|
|
421
|
+
**Description:** Fetches document-level information within a specific vector lake.
|
|
422
|
+
|
|
423
|
+
### 7. full_corpus_search
|
|
424
|
+
|
|
425
|
+
Performs a simple keyword-based search across the documents in a namespace.
|
|
426
|
+
|
|
427
|
+
| Parameter | Type | Required | Description |
|
|
428
|
+
|-----------|------|----------|-------------|
|
|
429
|
+
| `user_id` | str | Yes | The unique identifier for the user. |
|
|
430
|
+
| `vector_lake_description` | str | Yes | The namespace to search within. |
|
|
431
|
+
| `keyword` | str | Yes | The search term to find in the document content or metadata. |
|
|
432
|
+
| `top_docs` | int | No (Default: 10) | The maximum number of documents to return. |
|
|
433
|
+
|
|
434
|
+
**HTTP Method:** POST
|
|
435
|
+
**URL Path:** Determined by `self.config.endpoints["full_corpus_search"]`
|
|
436
|
+
**Description:** Executes a full-text or keyword search across the entire document corpus.
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## 🔍 WaveQL Query Syntax Guide
|
|
441
|
+
|
|
442
|
+
### Syntax Rules
|
|
443
|
+
|
|
444
|
+
#### Within Braces: Logical Operations
|
|
445
|
+
|
|
446
|
+
| Pattern | Meaning | Valid? |
|
|
447
|
+
|---------|---------|--------|
|
|
448
|
+
| `{A and B}` | Both A and B must match | ✅ Yes |
|
|
449
|
+
| `{A or B}` | Either A or B must match | ✅ Yes |
|
|
450
|
+
| `{(A B) or C}` | Multi-word phrase A B, or C | ✅ Yes |
|
|
451
|
+
| `{A B}` | Implicit AND: A and B | ✅ Yes |
|
|
452
|
+
| `{product manager or Delhi}` | INCORRECT | ❌ No |
|
|
453
|
+
| `{(product manager) or Delhi}` | Correct: phrase or term | ✅ Yes |
|
|
454
|
+
|
|
455
|
+
**Critical Rule:** Multi-word phrases MUST be wrapped in parentheses when combined with OR/AND operators.
|
|
456
|
+
|
|
457
|
+
**Examples:**
|
|
458
|
+
|
|
459
|
+
✅ Correct:
|
|
460
|
+
- `{(machine learning) or (deep learning)}`
|
|
461
|
+
- `{(clinical trials) and diabetes}`
|
|
462
|
+
- `{(product manager) or (data scientist)}`
|
|
463
|
+
|
|
464
|
+
❌ Wrong:
|
|
465
|
+
- `{machine learning or deep learning}` — Treats "machine" as separate term
|
|
466
|
+
- `{product manager or Delhi}` — Ambiguous parsing
|
|
467
|
+
|
|
468
|
+
#### Across Braces: Default AND Logic
|
|
469
|
+
|
|
470
|
+
Multiple brace groups automatically combine with AND:
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
{(clinical trials) or (observational studies)} {type 2 diabetes} {India}
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Evaluates as: `(Group1) AND (Group2) AND (Group3)`
|
|
477
|
+
|
|
478
|
+
#### Implicit AND for Simple Phrases
|
|
479
|
+
|
|
480
|
+
Without operators, multi-word terms are treated as AND:
|
|
481
|
+
|
|
482
|
+
```
|
|
483
|
+
{type 2 diabetes} → {type AND 2 AND diabetes}
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
This preserves the contextual meaning of multi-token phrases.
|
|
487
|
+
|
|
488
|
+
### Three-Tier Result Prioritization
|
|
489
|
+
|
|
490
|
+
The system combines filter matching with semantic search to produce ranked results:
|
|
491
|
+
|
|
492
|
+
**Tier 1: Filter + Semantic Match (Highest Priority)**
|
|
493
|
+
- Documents match BOTH filter criteria AND semantic relevance
|
|
494
|
+
- Common chunks found in filter results AND semantic search
|
|
495
|
+
- Highest confidence: Structure + Meaning aligned
|
|
496
|
+
|
|
497
|
+
**Tier 2: Filter Match Only**
|
|
498
|
+
- Documents match filter criteria
|
|
499
|
+
- May have lower semantic relevance
|
|
500
|
+
- Structured matches without semantic alignment
|
|
501
|
+
|
|
502
|
+
**Tier 3: Semantic Match Only**
|
|
503
|
+
- Documents are semantically relevant
|
|
504
|
+
- Don't match filter criteria (or no filters applied)
|
|
505
|
+
- Meaning-based matches without structural alignment
|
|
506
|
+
|
|
507
|
+
### Query Examples by Domain
|
|
508
|
+
|
|
509
|
+
**Healthcare:**
|
|
510
|
+
```
|
|
511
|
+
{diabetes} {(clinical trial)} {India}
|
|
512
|
+
{(gene therapy)} {cancer}
|
|
513
|
+
{antibiotics} {(respiratory infections)}
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
**Recruitment:**
|
|
517
|
+
```
|
|
518
|
+
{Python} {(machine learning)} {Delhi}
|
|
519
|
+
{MBA} {(5 years)} {(product manager)}
|
|
520
|
+
{(data engineer)} {AWS}
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
**Research:**
|
|
524
|
+
```
|
|
525
|
+
{genomics} {cancer}
|
|
526
|
+
{CRISPR} {(plant biology)}
|
|
527
|
+
{(drug discovery)} {2024}
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
**Business Intelligence:**
|
|
531
|
+
```
|
|
532
|
+
{(EV adoption)} {India}
|
|
533
|
+
{(supply chain)} {pharma}
|
|
534
|
+
{(AI investments)} {Europe}
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### Filter Design Best Practices
|
|
538
|
+
|
|
539
|
+
**DO:**
|
|
540
|
+
- Use 1-2 keywords per brace
|
|
541
|
+
- Wrap multi-word phrases in parentheses with operators
|
|
542
|
+
- Keep filters domain-consistent
|
|
543
|
+
- Trust semantic fallback for edge cases
|
|
544
|
+
|
|
545
|
+
**DON'T:**
|
|
546
|
+
- Use 5+ word phrases in filters
|
|
547
|
+
- Mix unrelated domains (`{resume} {clinical trials}`)
|
|
548
|
+
- Forget parentheses around multi-word phrases with OR/AND
|
|
549
|
+
- Over-specify filters (system will fall back gracefully)
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
## 🎯 Key Advantages
|
|
554
|
+
|
|
555
|
+
### No Schema Required: SQL-Like Queries on Unstructured Data
|
|
556
|
+
|
|
557
|
+
Traditional systems (Azure Cognitive Search, Elasticsearch) require:
|
|
558
|
+
1. Define rigid JSON schemas before ingestion
|
|
559
|
+
2. Extract and map every field (skills, locations, dates)
|
|
560
|
+
3. Maintain schema consistency across all documents
|
|
561
|
+
4. Update schemas when new fields emerge
|
|
562
|
+
|
|
563
|
+
**WaveflowDB Approach:**
|
|
564
|
+
1. Upload raw, unstructured documents (PDFs, text, Word docs)
|
|
565
|
+
2. No schema definition needed
|
|
566
|
+
3. Query with SQL-like joins using natural language
|
|
567
|
+
|
|
568
|
+
**Example Query:**
|
|
569
|
+
```
|
|
570
|
+
Find {(product manager) or (data scientist)} with {Python} and {MBA} in {Delhi}
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
This performs SQL-like logic WITHOUT requiring field extraction or schema definition.
|
|
574
|
+
|
|
575
|
+
### Feature Comparison
|
|
576
|
+
|
|
577
|
+
| Feature | Traditional JSON-Based | Brace-Based Filtering |
|
|
578
|
+
|---------|------------------------|----------------------|
|
|
579
|
+
| Data Ingestion | Extract, map, validate | Direct upload, no preprocessing |
|
|
580
|
+
| Schema Definition | Required upfront | Not required |
|
|
581
|
+
| Query Capability | Exact field matching | Semantic understanding + logical filtering |
|
|
582
|
+
| Flexibility | Rigid, schema-bound | Adapts to any document structure |
|
|
583
|
+
| Maintenance | High (schema updates) | Low (works on raw text) |
|
|
584
|
+
| New Document Types | Requires schema update | Works immediately |
|
|
585
|
+
|
|
586
|
+
---
|
|
587
|
+
|
|
588
|
+
## 📧 Support
|
|
589
|
+
|
|
590
|
+
For API or platform support, visit:
|
|
591
|
+
**https://db.agentanalytics.ai**
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
595
|
+
## 📄 License
|
|
596
|
+
|
|
597
|
+
Copyright DIBR tech private ltd.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "waveflowdb_client" # pip install name
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.4"
|
|
8
8
|
description = "VectorLake SDK — Deterministic backend engine powering agent workflows"
|
|
9
9
|
readme = "readme.md"
|
|
10
10
|
requires-python = ">=3.8"
|