Skip to main content

VectorWave: Seamless Auto-Vectorization Framework

Project description

VectorWave Logo

Need more information? Visit here

VectorWave

Star Release Tag Commit Contributors OpenPrs MergedPrs Checks Pypi
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.

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:

  1. Slash Costs: Serve cached results for semantically similar inputs, bypassing expensive computations.
  2. Fix Bugs: Automatically diagnose runtime errors and generate GitHub PRs using LLM.
  3. 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.

VectorWave Architecture

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?

  1. Detection: The AutoHealerBot detects the ZeroDivisionError.
  2. Diagnosis: It retrieves the source code and error stack trace.
  3. Fix: It uses an LLM to generate a patch (adding try-except or input validation).
  4. Action: A Pull Request is automatically created in your GitHub repository.

VectorWave Healer Architecture

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.

VectorWave Semantic Caching Architecture

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).

VectorWave Drift Architecture

How does it work?

Unlike traditional Key-Value caching (e.g., Redis), VectorWave understands Context.

  1. Vectorization: It converts function arguments into high-dimensional vectors using OpenAI or HuggingFace models.
  2. Search: It performs an Approximate Nearest Neighbor (ANN) search in the vector store.
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vectorwave-1.0.0.tar.gz (76.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vectorwave-1.0.0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (437.7 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

vectorwave-1.0.0-cp314-cp314-manylinux_2_28_x86_64.whl (437.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

vectorwave-1.0.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (693.6 kB view details)

Uploaded CPython 3.14macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

vectorwave-1.0.0-cp313-cp313-manylinux_2_28_x86_64.whl (437.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

vectorwave-1.0.0-cp312-cp312-win_amd64.whl (288.5 kB view details)

Uploaded CPython 3.12Windows x86-64

vectorwave-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl (437.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

vectorwave-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl (437.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

vectorwave-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl (440.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

File details

Details for the file vectorwave-1.0.0.tar.gz.

File metadata

  • Download URL: vectorwave-1.0.0.tar.gz
  • Upload date:
  • Size: 76.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for vectorwave-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ea098ec4137d3a035f93037a46c96a9c2de8adb98e9cd9f49bbfba9c1d096ad9
MD5 18702f734d972d4ed93fd3ddec782903
BLAKE2b-256 9e07f36662c5272b9843216e6ed0455e3b46204ba1ac3507ea83896e3cc7c695

See more details on using hashes here.

File details

Details for the file vectorwave-1.0.0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vectorwave-1.0.0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f71ce2291f3f2466f736f2378e8b0eb56dd175c95e78ecddb40da60ebc2a7030
MD5 717ef6e33c7ea942b260c3fb48f96d15
BLAKE2b-256 c0da60b398b5279dc75dde23ed08a3966b3cce7006ec805adfb0a33102741086

See more details on using hashes here.

File details

Details for the file vectorwave-1.0.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vectorwave-1.0.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f763f858958933ff7781460b31e65f6ed1a33c86373a456fa9180b7ef305fcbe
MD5 6dfdca47c6d8b594c0633389f9a28aa7
BLAKE2b-256 b6504bafdad190d29ff6f47a3f46fc5ccf45a36cbc261ff1c0e5293149f8f95d

See more details on using hashes here.

File details

Details for the file vectorwave-1.0.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for vectorwave-1.0.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 056ceae33761b6cd89acf4b9745a9ed9f3f14f2b2a4fc3e08097215286c4f6f9
MD5 f8b8e45a61c05f0210d03009ba802119
BLAKE2b-256 349afba7378a0b78ff51f3f1c42399efc30899c1e733a31277cd6f3aedc931c1

See more details on using hashes here.

File details

Details for the file vectorwave-1.0.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vectorwave-1.0.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 807aacd5f5b17ca1b50d5ee1136739db08aa10767589aa284e67dffbd5469af1
MD5 49e87ecdefe05049cdfb69109fa8c111
BLAKE2b-256 f7bf6d5a357abd44807550887acf47d8a3b9531b1020612e119c3c04d1e3fb94

See more details on using hashes here.

File details

Details for the file vectorwave-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for vectorwave-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5d0ab0affe2af374e39a712131ba1e384b898382bf44d86f6dae28c156b93da2
MD5 370ea29ab5e0aa14f9e162896d8745bb
BLAKE2b-256 3a9243fa36bf0fff3929fc283086ec6a4fdbc20be6cd52fdd4d6cb4f794a7d90

See more details on using hashes here.

File details

Details for the file vectorwave-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vectorwave-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 afd6abbefc23772725219fd15e49ed8ebdea8bb6e9788d14958ec7fe862b774d
MD5 25aae54e307108dc28d1e25563b7b41f
BLAKE2b-256 8b132c221397361ace9f5c7a55896bfba7760a590f494cc58021dd20e49e3d80

See more details on using hashes here.

File details

Details for the file vectorwave-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vectorwave-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0ff74273ecf3596a42dca6398e3fca0a278e27eb943f141ebdb1c89707e448de
MD5 b1fdfa5074e049f3b87b0c97d9403c97
BLAKE2b-256 a6776c9bc0f6f83bd128e6654e86aec250777c4d7531d006eb2ea0e724e4c09c

See more details on using hashes here.

File details

Details for the file vectorwave-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vectorwave-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9893e14bac1c826a901f41ba40e59a56561d53222049004715ed29e3121aaefc
MD5 f46a0998309287e5780d52801e0c2190
BLAKE2b-256 53d0294c494e1a589d072580b0000fc4facd346d030140988e4a8634ab93e598

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page