VectorWave: Seamless Auto-Vectorization Framework
Project description
Need more information? Visit here
VectorWave
Seamless Auto-Vectorization Framework
We transform volatile data that disappears the moment code is executed into a Searchable and Reusable permanent knowledge asset.
Requirements
- Python: 3.10 ~ 3.13
- Docker: Required to run the Weaviate database.
- (Optional) OpenAI API Key: Required for AI auto-documentation and high-performance embedding.
How to reach us
Have questions or found a bug? Please join our community.
- GitHub Issues: https://github.com/cozymori/vectorwave/issues
Contributors
See the contributors of vectorwave
VectorWave is an open-source project and we welcome your contributions.
Please refer to CONTRIBUTING.md in the GitHub repository.
🚀 What is VectorWave?
VectorWave is a unified framework designed to solve the "Efficiency vs. Reliability" dilemma in LLM-integrated applications. It introduces a new paradigm of Execution-Level Semantic Optimization combined with Autonomous Self-Healing.
Unlike conventional semantic caching tools that primarily focus on text similarity, VectorWave captures the entire Function Execution Context. It creates a permanent "Golden Dataset" from your successful executions and uses it to:
- Slash Costs: Serve cached results for semantically similar inputs, bypassing expensive computations.
- Fix Bugs: Automatically diagnose runtime errors and generate GitHub PRs using LLM.
- Monitor Quality: Detect when user inputs start drifting away from known patterns (Semantic Drift).
Architecture
VectorWave operates as a transparent layer between your application and the LLM/Infrastructure, handling everything from vectorization to GitOps automation.
Core Components
- Optimization Engine: Intercepts function calls to check for semantic cache hits using HNSW indexes.
- Trace Context Manager: Collects execution logs, inputs, and outputs without modifying your code structure.
- Self-Healing Pipeline: An autonomous agent that wakes up on errors, diagnoses the root cause, and submits patches.
😊 Quick Start
You can attach VectorWave to any Python function using a simple decorator.
1. Prerequisites (Start Vector DB)
VectorWave requires a Vector Database (Weaviate) to store execution contexts.
Create a docker-compose.yml file and start the service:
# docker-compose.yml
version: '3.4'
services:
weaviate:
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
image: semitechnologies/weaviate:1.26.1
ports:
- 8080:8080
- 50051:50051
restart: on-failure:0
environment:
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
DEFAULT_VECTORIZER_MODULE: 'none'
ENABLE_MODULES: 'text2vec-openai,generative-openai'
CLUSTER_HOSTNAME: 'node1'
Run the container:
docker-compose up -d
2. Install VectorWave
pip install vectorwave
3. Basic Usage (Semantic Caching)
Now, apply the @vectorize decorator to your functions.
import time
from vectorwave import vectorize, initialize_database
# 1. (Optional) Set up your OpenAI Key for vectorization
# os.environ["OPENAI_API_KEY"] = "sk-..."
initialize_database()
# 2. Just add the @vectorize decorator!
@vectorize(semantic_cache=True, cache_threshold=0.95, auto=True)
def expensive_llm_task(query: str):
# Simulate a slow and expensive API call
time.sleep(2)
return f"Processed result for: {query}"
# First call: Runs the function (Cache Miss) -> Took 2.0s
print(expensive_llm_task("How do I fix a Python bug?"))
# Second call: Returns from Weaviate DB (Cache Hit) -> Took 0.02s!
# Even if the query is slightly different but semantically same.
print(expensive_llm_task("Tell me how to debug Python code."))
4. Self-Healing in Action
When your code breaks, VectorWave actively fixes it.
# Suppose this function has a bug (ZeroDivisionError)
@vectorize(auto=True)
def risky_calculation(a, b):
return a / b
# Triggering an error
risky_calculation(10, 0)
What happens next?
- Detection: The
AutoHealerBotdetects theZeroDivisionError. - Diagnosis: It retrieves the source code and error stack trace.
- Fix: It uses an LLM to generate a patch (adding
try-exceptor input validation). - Action: A Pull Request is automatically created in your GitHub repository.
Key Features
⚡ Optimization Engine (Semantic Caching)
Don't pay for the same computation twice. VectorWave uses Weaviate vector database to store and retrieve function results based on meaning, not just exact string matching.
- Latency: Reduced from seconds to milliseconds.
- Cost: Up to 90% reduction in LLM token usage.
Self-Healing & GitOps
VectorWave doesn't just log errors; it acts on them.
- Automated Root Cause Analysis (RCA) using RAG.
- GitOps Integration: Generates actual code fixes and pushes them to a new branch.
- Cooldown Mechanism: Prevents spamming PRs for the same error.
Semantic Drift Radar
Detect when your users are asking things your model wasn't designed for.
- Anomaly Detection: Calculates the distance between new queries and your "Golden Dataset".
- Alerting: Sends notifications (e.g., Discord) when drift exceeds the threshold (default 0.25).
How does it work?
Unlike traditional Key-Value caching (e.g., Redis), VectorWave understands Context.
- Vectorization: It converts function arguments into high-dimensional vectors using OpenAI or HuggingFace models.
- Search: It performs an Approximate Nearest Neighbor (ANN) search in the vector store.
- Decision:
- If a neighbor is found within the
threshold-> Return Cached Result. - If not -> Execute Function -> Async Log to DB.
Performance Benchmark
| Metric | Direct Execution | With VectorWave | Improvement |
|---|---|---|---|
| Latency (Hit) | ~2.5s (LLM API) | ~0.02s | 125x Faster |
| Cost (Hit) | $0.03 / call | $0.00 | 100% Savings |
| Reliability | Manual Fix Required | Auto-PR Created | Autonomous |
Feature Comparison
Why choose VectorWave over traditional semantic caches?
| Feature | Traditional Tools (e.g., GPTCache) | VectorWave |
|---|---|---|
| Semantic Caching | O (Text-based) | O (Execution Context) |
| Self-Healing (Auto-Fix) | X | O (Autonomous) |
| GitOps (Auto-PR) | X | O (Seamless) |
| Semantic Drift Detection | X | O (Drift Radar) |
| Zero-Config Setup | △ (Setup Required) | O (Decorator) |
😍 Contributing
We are extremely open to contributions! Whether it's a new vectorizer, a better healing prompt, or just a typo fix. Please check our Contribution Guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vectorwave-0.2.9.tar.gz.
File metadata
- Download URL: vectorwave-0.2.9.tar.gz
- Upload date:
- Size: 48.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60c392a4fb4ed92d89a0de275f05e2ab14d6b37b921a873ae348c3b79ef89156
|
|
| MD5 |
39a505362e1dd0d80876c637f1b349f8
|
|
| BLAKE2b-256 |
0a35f2ffa72d20bd6cf6c73eb2aa0144f50c658198c3354f1eb0569d5c633aba
|
File details
Details for the file vectorwave-0.2.9-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: vectorwave-0.2.9-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 665.0 kB
- Tags: CPython 3.14, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e814ead186aecd080d7c5942d1c2de856c272cfd0e61c8f38a2e6a4d08fc731b
|
|
| MD5 |
0602d9a6e0f599a4c8e92e00726ce8e3
|
|
| BLAKE2b-256 |
0773fc842f8c6d1aa3dc77f6a4acfd7b04c785ff8298ddd52f920ebb2e071743
|
File details
Details for the file vectorwave-0.2.9-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: vectorwave-0.2.9-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 249.2 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85af191612623f939b492203d0118b3ffb370d009a381cdf3dae7a8640b7adbc
|
|
| MD5 |
c286f6d5d9805ff0c745a14a37950b2e
|
|
| BLAKE2b-256 |
f49e069a4ec5d5c868e36228555b87c312267baeff5ffaa37e1e843cb41e6beb
|
File details
Details for the file vectorwave-0.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: vectorwave-0.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 404.2 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab7e4787b521de2ccb30271b758198db35f285d481aa054f687c5da995863756
|
|
| MD5 |
bcc2e1e23b38ef67c3e0dcda1c673c38
|
|
| BLAKE2b-256 |
ee0c1ba1c3c64252ff8c327f0ad8bf8a238839541bb63a78bee6136da882cd37
|