vectorwave 0.1.3__tar.gz → 0.1.5__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.
Files changed (65) hide show
  1. {vectorwave-0.1.3/src/vectorwave.egg-info → vectorwave-0.1.5}/PKG-INFO +141 -48
  2. {vectorwave-0.1.3 → vectorwave-0.1.5}/Readme.md +138 -47
  3. {vectorwave-0.1.3 → vectorwave-0.1.5}/pyproject.toml +4 -2
  4. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/database/test_db.py +2 -2
  5. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/models/test_db_config.py +13 -14
  6. vectorwave-0.1.5/src/tests/monitoring/alert/test_alerter.py +70 -0
  7. vectorwave-0.1.5/src/tests/monitoring/test_async_trace.py +282 -0
  8. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/monitoring/test_tracer.py +78 -3
  9. vectorwave-0.1.5/src/tests/search/test_execution_search.py +120 -0
  10. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/core/decorator.py +66 -39
  11. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/database/db.py +7 -3
  12. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/models/db_config.py +24 -1
  13. vectorwave-0.1.5/src/vectorwave/monitoring/alert/base.py +8 -0
  14. vectorwave-0.1.5/src/vectorwave/monitoring/alert/factory.py +19 -0
  15. vectorwave-0.1.5/src/vectorwave/monitoring/alert/null_alerter.py +7 -0
  16. vectorwave-0.1.5/src/vectorwave/monitoring/alert/webhook_alerter.py +69 -0
  17. vectorwave-0.1.5/src/vectorwave/monitoring/tracer.py +273 -0
  18. vectorwave-0.1.5/src/vectorwave/prediction/__init__.py +0 -0
  19. vectorwave-0.1.5/src/vectorwave/prediction/predictor.py +0 -0
  20. vectorwave-0.1.5/src/vectorwave/search/__init__.py +0 -0
  21. vectorwave-0.1.5/src/vectorwave/search/execution_search.py +148 -0
  22. vectorwave-0.1.5/src/vectorwave/search/extended_search.py +0 -0
  23. vectorwave-0.1.5/src/vectorwave/search/rag_search.py +0 -0
  24. vectorwave-0.1.5/src/vectorwave/vectorizer/__init__.py +0 -0
  25. {vectorwave-0.1.3 → vectorwave-0.1.5/src/vectorwave.egg-info}/PKG-INFO +141 -48
  26. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave.egg-info/SOURCES.txt +14 -0
  27. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave.egg-info/requires.txt +2 -0
  28. vectorwave-0.1.3/src/vectorwave/monitoring/tracer.py +0 -131
  29. {vectorwave-0.1.3 → vectorwave-0.1.5}/LICENSE +0 -0
  30. {vectorwave-0.1.3 → vectorwave-0.1.5}/MANIFEST.in +0 -0
  31. {vectorwave-0.1.3 → vectorwave-0.1.5}/NOTICE +0 -0
  32. {vectorwave-0.1.3 → vectorwave-0.1.5}/setup.cfg +0 -0
  33. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/__init__.py +0 -0
  34. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/batch/__init__.py +0 -0
  35. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/batch/test_batch.py +0 -0
  36. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/core/__init__.py +0 -0
  37. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/core/test_decorator.py +0 -0
  38. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/database/__init__.py +0 -0
  39. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/database/test_db_search.py +0 -0
  40. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/exception/__init__.py +0 -0
  41. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/models/__init__.py +0 -0
  42. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/tests/monitoring/__init__.py +0 -0
  43. {vectorwave-0.1.3/src/tests/prediction → vectorwave-0.1.5/src/tests/monitoring/alert}/__init__.py +0 -0
  44. {vectorwave-0.1.3/src/tests/vectorizer → vectorwave-0.1.5/src/tests/prediction}/__init__.py +0 -0
  45. {vectorwave-0.1.3/src/vectorwave/batch → vectorwave-0.1.5/src/tests/search}/__init__.py +0 -0
  46. {vectorwave-0.1.3/src/vectorwave/core → vectorwave-0.1.5/src/tests/vectorizer}/__init__.py +0 -0
  47. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/__init__.py +0 -0
  48. {vectorwave-0.1.3/src/vectorwave/database → vectorwave-0.1.5/src/vectorwave/batch}/__init__.py +0 -0
  49. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/batch/batch.py +0 -0
  50. {vectorwave-0.1.3/src/vectorwave/exception → vectorwave-0.1.5/src/vectorwave/core}/__init__.py +0 -0
  51. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/core/core.py +0 -0
  52. {vectorwave-0.1.3/src/vectorwave/models → vectorwave-0.1.5/src/vectorwave/database}/__init__.py +0 -0
  53. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/database/db_search.py +0 -0
  54. {vectorwave-0.1.3/src/vectorwave/monitoring → vectorwave-0.1.5/src/vectorwave/exception}/__init__.py +0 -0
  55. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/exception/exceptions.py +0 -0
  56. {vectorwave-0.1.3/src/vectorwave/prediction → vectorwave-0.1.5/src/vectorwave/models}/__init__.py +0 -0
  57. {vectorwave-0.1.3/src/vectorwave/vectorizer → vectorwave-0.1.5/src/vectorwave/monitoring}/__init__.py +0 -0
  58. /vectorwave-0.1.3/src/vectorwave/monitoring/monitoring.py → /vectorwave-0.1.5/src/vectorwave/monitoring/alert/__init__.py +0 -0
  59. /vectorwave-0.1.3/src/vectorwave/prediction/predictor.py → /vectorwave-0.1.5/src/vectorwave/monitoring/monitoring.py +0 -0
  60. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/vectorizer/base.py +0 -0
  61. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/vectorizer/factory.py +0 -0
  62. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/vectorizer/huggingface_vectorizer.py +0 -0
  63. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave/vectorizer/openai_vectorizer.py +0 -0
  64. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave.egg-info/dependency_links.txt +0 -0
  65. {vectorwave-0.1.3 → vectorwave-0.1.5}/src/vectorwave.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vectorwave
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: VectorWave: Seamless Auto-Vectorization Framework
5
5
  Author-email: junyeonggim <junyeonggim5@gmail.com>
6
6
  License-Expression: MIT
@@ -19,34 +19,37 @@ License-File: LICENSE
19
19
  License-File: NOTICE
20
20
  Requires-Dist: weaviate-client>=4.0.0
21
21
  Requires-Dist: pydantic-settings>=2.0.0
22
+ Requires-Dist: sentence-transformers
23
+ Requires-Dist: requests
22
24
  Dynamic: license-file
23
25
 
24
26
 
27
+
25
28
  # VectorWave: Seamless Auto-Vectorization Framework
26
29
 
27
- [](https://www.google.com/search?q=LICENSE)
30
+ [](https://opensource.org/licenses/MIT)
28
31
 
29
32
  ## 🌟 Overview
30
33
 
31
- **VectorWave** is an innovative framework that uses a **decorator** to automatically save and manage the output of Python functions/methods in a **Vector Database (Vector DB)**. Developers can convert function outputs into intelligent vector data with a single line of code (`@vectorize`), without worrying about the complex processes of data collection, embedding generation, or storage in a Vector DB.
34
+ **VectorWave** is an innovative framework that uses **decorators** to automatically save and manage the output of Python functions/methods in a **Vector Database (Vector DB)**. Developers can convert function outputs into intelligent vector data with just a single line of code (`@vectorize`), without worrying about the complex processes of data collection, embedding generation, and Vector DB storage.
32
35
 
33
- ---
36
+ -----
34
37
 
35
38
  ## ✨ Features
36
39
 
37
40
  * **`@vectorize` Decorator:**
38
- 1. **Static Data Collection:** Saves the function's source code, docstring, and metadata to the `VectorWaveFunctions` collection once when the script is loaded.
39
- 2. **Dynamic Data Logging:** Records the execution time, success/failure status, error logs, and 'dynamic tags' to the `VectorWaveExecutions` collection every time the function is called.
40
- * **Distributed Tracing:** By combining the `@vectorize` and `@trace_span` decorators, you can analyze the execution of complex multi-step workflows, grouped under a single **`trace_id`**.
41
- * **Search Interface:** Provides `search_functions` (for vector search) and `search_executions` (for log filtering) to facilitate the construction of RAG and monitoring systems.
41
+ 1. **Static Data Collection:** Upon script load, the function's source code, docstring, and metadata are saved once to the `VectorWaveFunctions` collection.
42
+ 2. **Dynamic Data Logging:** Each time the function is called, its execution time, success/failure status, error logs, and "dynamic tags" are recorded in the `VectorWaveExecutions` collection.
43
+ * **Distributed Tracing:** Combines `@vectorize` and `@trace_span` decorators to bundle the execution of complex, multi-step workflows under a single **`trace_id`** for analysis.
44
+ * **Search Interface:** Provides `search_functions` and `search_executions` to query the stored vector data (function definitions) and logs (execution history), facilitating the construction of RAG and monitoring systems.
42
45
 
43
- ---
46
+ -----
44
47
 
45
48
  ## 🚀 Usage
46
49
 
47
- VectorWave consists of 'storing' via decorators and 'searching' via functions, and now includes **execution flow tracing**.
50
+ VectorWave consists of "storage" via decorators and "retrieval" via functions, and now includes **execution flow tracing**.
48
51
 
49
- ### 1. (Required) Initialize the Database and Configuration
52
+ ### 1\. (Required) Database Initialization and Setup
50
53
 
51
54
  ```python
52
55
  import time
@@ -56,50 +59,50 @@ from vectorwave import (
56
59
  search_functions,
57
60
  search_executions
58
61
  )
59
- # [ADDITION] Import trace_span separately for distributed tracing.
62
+ # [New] Import trace_span separately for distributed tracing.
60
63
  from vectorwave.monitoring.tracer import trace_span
61
64
 
62
- # This only needs to be called once when the script starts.
65
+ # Needs to be called only once at script startup.
63
66
  try:
64
67
  client = initialize_database()
65
- print("VectorWave DB initialized successfully.")
68
+ print("VectorWave DB initialization successful.")
66
69
  except Exception as e:
67
70
  print(f"DB initialization failed: {e}")
68
71
  exit()
69
- ````
72
+ ```
70
73
 
71
- ### 2\. [Store] Use `@vectorize` with Distributed Tracing
74
+ ### 2\. [Storage] Using `@vectorize` and Distributed Tracing
72
75
 
73
- The `@vectorize` acts as the **Root** for tracing, and `@trace_span` is used on internal functions to group the execution flow under a single `trace_id`.
76
+ `@vectorize` acts as the **Root** of the trace, and applying `@trace_span` to internal functions bundles the workflow execution under a **single `trace_id`**.
74
77
 
75
78
  ```python
76
79
  # --- Child Span Function: Captures arguments ---
77
80
  @trace_span(attributes_to_capture=['user_id', 'amount'])
78
81
  def step_1_validate_payment(user_id: str, amount: int):
79
- """(Span) Payment validation. Records user_id and amount in the log."""
82
+ """(Span) Validates payment. Logs user_id and amount."""
80
83
  print(f" [SPAN 1] Validating payment for {user_id}...")
81
84
  time.sleep(0.1)
82
85
  return True
83
86
 
84
87
  @trace_span(attributes_to_capture=['user_id', 'receipt_id'])
85
88
  def step_2_send_receipt(user_id: str, receipt_id: str):
86
- """(Span) Sends the receipt."""
89
+ """(Span) Sends receipt."""
87
90
  print(f" [SPAN 2] Sending receipt {receipt_id}...")
88
91
  time.sleep(0.2)
89
92
 
90
93
 
91
- # --- Root Function (@trace_root role) ---
94
+ # --- Root Function (acts as @trace_root) ---
92
95
  @vectorize(
93
- search_description="Charges a user in the payment system.",
94
- sequence_narrative="Returns a receipt ID upon successful payment.",
95
- team="billing", # <-- Custom Tag (recorded in all execution logs)
96
- priority=1 # <-- Custom Tag (execution priority)
96
+ search_description="Processes a user payment and returns a receipt.",
97
+ sequence_narrative="After payment is complete, a receipt is sent via email.",
98
+ team="billing", # ⬅️ Custom tag (logged on all executions)
99
+ priority=1 # ⬅️ Custom tag (execution importance)
97
100
  )
98
101
  def process_payment(user_id: str, amount: int):
99
102
  """(Root Span) Executes the user payment workflow."""
100
103
  print(f" [ROOT EXEC] process_payment: Starting workflow for {user_id}...")
101
104
 
102
- # When calling child functions, the same trace_id is automatically inherited via ContextVar.
105
+ # When child functions are called, the same trace_id is automatically inherited via ContextVar.
103
106
  step_1_validate_payment(user_id=user_id, amount=amount)
104
107
 
105
108
  receipt_id = f"receipt_{user_id}_{amount}"
@@ -108,20 +111,20 @@ def process_payment(user_id: str, amount: int):
108
111
  print(f" [ROOT DONE] process_payment")
109
112
  return {"status": "success", "receipt_id": receipt_id}
110
113
 
111
- # --- Execute the Function ---
114
+ # --- Function Execution ---
112
115
  print("Now calling 'process_payment'...")
113
- # This single call records 3 execution logs (spans) in the DB,
114
- # all grouped under one 'trace_id'.
116
+ # This single call will record a total of 3 execution logs (spans) in the DB,
117
+ # and all three logs will be tied to a single 'trace_id'.
115
118
  process_payment("user_789", 5000)
116
119
  ```
117
120
 
118
- ### 3\. [Search ①] Function Definition Search (for RAG)
121
+ ### 3\. [Retrieval ①] Search Function Definitions (for RAG)
119
122
 
120
123
  ```python
121
- # Search for functions related to 'payment' using natural language (vector search).
122
- print("\n--- Searching for 'payment' functions ---")
124
+ # Search for functions related to 'payment' using natural language (vector).
125
+ print("\n--- Searching for 'payment' related functions ---")
123
126
  payment_funcs = search_functions(
124
- query="user payment processing",
127
+ query="User payment processing feature",
125
128
  limit=3
126
129
  )
127
130
  for func in payment_funcs:
@@ -130,9 +133,9 @@ for func in payment_funcs:
130
133
  print(f" - Similarity (Distance): {func['metadata'].distance:.4f}")
131
134
  ```
132
135
 
133
- ### 4\. [Search ②] Execution Log Search (Monitoring and Tracing)
136
+ ### 4\. [Retrieval ②] Search Execution Logs (for Monitoring & Tracing)
134
137
 
135
- The `search_executions` function can now search for all related execution logs (spans) based on the `trace_id`.
138
+ `search_executions` can now retrieve all related execution logs (spans) based on a `trace_id`.
136
139
 
137
140
  ```python
138
141
  # 1. Find the Trace ID of a specific workflow (process_payment).
@@ -144,24 +147,25 @@ latest_payment_span = search_executions(
144
147
  )
145
148
  trace_id = latest_payment_span[0]["trace_id"]
146
149
 
147
- # 2. Search all spans belonging to that Trace ID, sorted chronologically.
150
+ # 2. Retrieve all spans belonging to that Trace ID in chronological order.
148
151
  print(f"\n--- Full Trace for ID ({trace_id[:8]}...) ---")
149
152
  trace_spans = search_executions(
150
153
  limit=10,
151
154
  filters={"trace_id": trace_id},
152
155
  sort_by="timestamp_utc",
153
- sort_ascending=True # Ascending sort for workflow flow analysis
156
+ sort_ascending=True # Sort ascending to analyze workflow
154
157
  )
155
158
 
156
159
  for i, span in enumerate(trace_spans):
157
160
  print(f" - [Span {i+1}] {span['function_name']} ({span['duration_ms']:.2f}ms)")
158
- # Captured arguments (user_id, amount, etc.) are displayed for the child spans.
161
+ # Captured arguments (user_id, amount, etc.) from child spans will also be visible.
159
162
 
160
- # Example Output:
163
+ # Expected Output:
161
164
  # - [Span 1] step_1_validate_payment (100.81ms)
162
165
  # - [Span 2] step_2_send_receipt (202.06ms)
163
166
  # - [Span 3] process_payment (333.18ms)
164
167
  ```
168
+
165
169
  -----
166
170
 
167
171
  ## ⚙️ Configuration
@@ -176,10 +180,10 @@ You can select the text vectorization method via the `VECTORIZER` environment va
176
180
 
177
181
  | `VECTORIZER` Setting | Description | Required Additional Settings |
178
182
  | :--- | :--- | :--- |
179
- | **`huggingface`** | (Default Recommended) Uses the `sentence-transformers` library to vectorize on your local CPU. No API key is needed, making it great for immediate testing. | `HF_MODEL_NAME` (e.g., "sentence-transformers/all-MiniLM-L6-v2") |
180
- | **`openai_client`** | (High-Performance) Uses the OpenAI Python client to vectorize with modern models like `text-embedding-3-small`. | `OPENAI_API_KEY` (A valid OpenAI API key) |
181
- | **`weaviate_module`** | (Docker Delegate) Delegates the vectorization task to the Weaviate container's built-in module (e.g., `text2vec-openai`). | `WEAVIATE_VECTORIZER_MODULE`, `OPENAI_API_KEY` |
182
- | **`none`** | Disables vectorization. Data will be stored without vectors. | None |
183
+ | **`huggingface`** | (Default Recommended) Uses the `sentence-transformers` library to vectorize on your local CPU. No API key is needed. | `HF_MODEL_NAME` (e.g., "sentence-transformers/all-MiniLM-L6-v2") |
184
+ | **`openai_client`** | (High-Performance) Uses the OpenAI Python client to vectorize with models like `text-embedding-3-small`. | `OPENAI_API_KEY` (A valid OpenAI API key) |
185
+ | **`weaviate_module`** | (Docker Delegate) Delegates vectorization to Weaviate's built-in module (e.g., `text2vec-openai`). | `WEAVIATE_VECTORIZER_MODULE`, `OPENAI_API_KEY` |
186
+ | **`none`** | Disables vectorization. Data is stored without vectors. | None |
183
187
 
184
188
  -----
185
189
 
@@ -207,6 +211,7 @@ OPENAI_API_KEY=sk-...
207
211
 
208
212
  # --- [Advanced] Custom Properties ---
209
213
  CUSTOM_PROPERTIES_FILE_PATH=.weaviate_properties
214
+ FAILURE_MAPPING_FILE_PATH=.vectorwave_errors.json
210
215
  RUN_ID=test-run-001
211
216
  ```
212
217
 
@@ -232,6 +237,7 @@ HF_MODEL_NAME=...
232
237
 
233
238
  # --- [Advanced] Custom Properties ---
234
239
  CUSTOM_PROPERTIES_FILE_PATH=.weaviate_properties
240
+ FAILURE_MAPPING_FILE_PATH=.vectorwave_errors.json
235
241
  RUN_ID=test-run-001
236
242
  ```
237
243
 
@@ -256,11 +262,72 @@ OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
256
262
 
257
263
  # --- [Advanced] Custom Properties ---
258
264
  CUSTOM_PROPERTIES_FILE_PATH=.weaviate_properties
265
+ FAILURE_MAPPING_FILE_PATH=.vectorwave_errors.json
259
266
  RUN_ID=test-run-001
260
267
  ```
261
268
 
262
269
  -----
263
270
 
271
+ ### 🚀 Advanced Failure Tracing (Error Code)
272
+
273
+ This enhances `VectorWaveExecutions` logs beyond a simple `status: "ERROR"`. An `error_code` property is added to the schema for granular failure analysis.
274
+
275
+ When a function wrapped by `@vectorize` or `@trace_span` fails, the `error_code` is automatically determined based on three priorities:
276
+
277
+ 1. **Custom Exception Attribute (Priority 1):**
278
+ The most specific method. If the raised exception object `e` has an `e.error_code` attribute, its value is used.
279
+
280
+ ```python
281
+ class PaymentError(Exception):
282
+ def __init__(self, message, error_code):
283
+ super().__init__(message)
284
+ self.error_code = error_code # ⬅️ This attribute is detected.
285
+
286
+ @vectorize(...)
287
+ def process_payment(amount):
288
+ if amount < 0:
289
+ raise PaymentError("Amount < 0", error_code="PAYMENT_NEGATIVE_AMOUNT")
290
+
291
+ # DB Log on execution: { "status": "ERROR", "error_code": "PAYMENT_NEGATIVE_AMOUNT" }
292
+ ```
293
+
294
+ 2. **Global Mapping File (Priority 2):**
295
+ Centrally manage common exceptions. VectorWave loads a JSON file specified by `FAILURE_MAPPING_FILE_PATH` in your `.env` (default: `.vectorwave_errors.json`) and maps the exception class name to a code.
296
+
297
+ **`.vectorwave_errors.json` Example:**
298
+
299
+ ```json
300
+ {
301
+ "ValueError": "INVALID_INPUT",
302
+ "KeyError": "CONFIG_MISSING",
303
+ "TypeError": "INVALID_INPUT"
304
+ }
305
+ ```
306
+
307
+ ```python
308
+ @vectorize(...)
309
+ def get_config(key):
310
+ return os.environ[key] # ⬅️ Raises KeyError
311
+
312
+ # DB Log on execution: { "status": "ERROR", "error_code": "CONFIG_MISSING" }
313
+ ```
314
+
315
+ 3. **Default (Priority 3):**
316
+ If neither of the above applies, the exception's class name (e.g., `"ZeroDivisionError"`) is stored as the default `error_code`.
317
+
318
+ **[Usage] Searching for Failures:**
319
+ You can now filter for specific failure types using `search_executions`.
320
+
321
+ ```python
322
+ # Find all failure logs categorized as "INVALID_INPUT"
323
+ invalid_logs = search_executions(
324
+ filters={"error_code": "INVALID_INPUT"},
325
+ limit=10
326
+ )
327
+ ```
328
+
329
+ -----
330
+
264
331
  ### Custom Properties and Dynamic Execution Tagging
265
332
 
266
333
  VectorWave can store user-defined metadata in addition to static data (function definitions) and dynamic data (execution logs). This works in two steps.
@@ -304,7 +371,7 @@ When a function is executed, VectorWave adds tags to the `VectorWaveExecutions`
304
371
  VectorWave looks for environment variables matching the **UPPERCASE name** of the keys defined in Step 1 (e.g., `RUN_ID`, `EXPERIMENT_ID`). Found values are loaded as `global_custom_values` and added to *all* execution logs. Ideal for run-wide metadata.
305
372
 
306
373
  **2. Function-Specific Tags (Decorator)**
307
- You can pass tags as keyword arguments (`**execution_tags`) directly to the `@vectorize` decorator. Ideal for function-specific metadata.
374
+ You can pass tags as keyword arguments (`**execution_tags`) directly to the `@vectorize` decorator. This is ideal for function-specific metadata.
308
375
 
309
376
  ```python
310
377
  # --- .env file ---
@@ -329,9 +396,8 @@ def other_function():
329
396
  pass
330
397
  ```
331
398
 
332
- **Tag Merging and Validation Rules**
333
399
 
334
- 1. **Validation (Important):** Tags (global or function-specific) will **only** be saved to Weaviate if their key (e.g., `run_id`, `team`, `priority`) was first defined in the `.weaviate_properties` file (Step 1). Tags not defined in the schema are **ignored**, and a warning is printed at script startup.
400
+ 1. **Validation (Important):** Tags (global or function-specific) will **only** be saved to Weaviate if their key (e.g., `run_id`, `team`, `priority`) was first defined in the `.weaviate_properties` file (Step 1). Tags not defined in the schema are **ignored**, and a warning is logged at startup.
335
401
 
336
402
  2. **Priority (Override):** If a tag key is defined in both places (e.g., global `RUN_ID` in `.env` and `run_id="override-xyz"` in the decorator), the **function-specific tag from the decorator always wins**.
337
403
 
@@ -342,11 +408,38 @@ def other_function():
342
408
 
343
409
  -----
344
410
 
411
+ ### 🚀 Real-time Error Alerting (Webhook)
412
+
413
+ Beyond just logging, `VectorWave` can send **real-time notifications via webhook** the instant an error occurs. This functionality is built directly into the tracer and can be activated simply by updating your `.env` file.
414
+
415
+ **How it Works:**
416
+ 1. An exception is raised within a function decorated by `@trace_span` or `@vectorize`.
417
+ 2. The tracer catches the exception in its `except` block and immediately calls the `alerter` object.
418
+ 3. The alerter reads the `.env` configuration and uses the `WebhookAlerter` to dispatch the error details to your specified URL.
419
+ 4. The notification is optimized for **Discord Embeds**, sending a rich report including the error code, trace ID, captured attributes (`user_id`, etc.), and the full stack trace.
420
+
421
+ **How to Enable:**
422
+ Add the following two variables to your `test_ex/.env` file (or environment variables):
423
+
424
+ ```ini
425
+ # .env file
426
+
427
+ # 1. Set the alerter strategy to 'webhook'. (Default: "none")
428
+ ALERTER_STRATEGY="webhook"
429
+
430
+ # 2. Provide your webhook URL from Discord, Slack, etc.
431
+ ALERTER_WEBHOOK_URL="[https://discord.com/api/webhooks/YOUR_HOOK_ID/](https://discord.com/api/webhooks/YOUR_HOOK_ID/)..."
432
+ With just these two lines, running test_ex/example.py will now instantly send a Discord alert when the CustomValueError is raised.
433
+
434
+ Extensibility (Strategy Pattern): The alerting system is built on a Strategy Pattern. You can easily extend it by implementing the BaseAlerter interface to support other channels like email, PagerDuty, or more.
435
+
436
+ **Tag Merging and Validation Rules**
437
+ ```
438
+
345
439
  ## 🤝 Contributing
346
440
 
347
- All forms of contribution are welcome, including bug reports, feature requests, and code contributions. For details, please refer to [CONTRIBUTING.md](https://www.google.com/search?q=httpsS://www.google.com/search%3Fq%3DCONTRIBUTING.md).
441
+ Bug reports, feature requests, and code contributions are all welcome. For details, please see [CONTRIBUTING.md](https://www.google.com/search?q=httpsS://www.google.com/search%3Fq%3DCONTRIBUTING.md).
348
442
 
349
443
  ## 📜 License
350
444
 
351
- This project is distributed under the MIT License. See the [LICENSE](https://www.google.com/search?q=httpsS://www.google.com/search%3Fq%3DLICENSE) file for details.
352
-
445
+ This project is distributed under the MIT License. See the [LICENSE](https://www.google.com/search?q=LICENSE) file for details.