Skip to main content

🔊 EchoVector

Semantic text search over audio files — without full transcription.

CI Coverage Python License


What is EchoVector?

EchoVector indexes audio files by generating semantic embeddings directly from audio waveforms, then lets you search them with natural language text queries — all without transcribing a single word.

Traditional approach (slow & expensive)

Audio → Full Transcription → Text Embeddings → Text Search

EchoVector approach (fast & efficient)

Audio → Audio Chunks → Audio Embeddings ─┐
                                          ├─► ANN Search → Results
Text Query → Text Embedding ──────────────┘

Features

  • 🎵 Multi-format support — MP3, WAV, FLAC, M4A
  • 🧠 Direct audio embeddings — No transcription needed
  • 🔍 Semantic search — Query with natural language
  • FAISS-powered — Approximate nearest neighbor search
  • 🔌 Pluggable backends — CLAP implemented today; Whisper, wav2vec2, HuBERT, AST are stubbed for future work
  • 🧪 Offline smoke backendlocal backend for CI/Kaggle tests without model downloads
  • 📊 Rich CLI — Progress bars, colors, benchmarking mode
  • 🌐 REST API — Optional FastAPI server
  • 📦 Production-ready — Typed, tested, documented

Quick Start

Installation

pip install echo_vector

Or with uv:

uv add echo_vector

CLI Usage

# One-time indexing: split audio into timestamped chunks and embed each chunk
echovector index ./meetings

# Fast repeated search: embed only the text query and search the saved FAISS index
echovector search "discussion about transformers"

# Search with options
echovector search "pricing strategy" --top-k 10

# View index statistics
echovector stats

For a no-download smoke test, use the deterministic local backend:

echovector index ./meetings --backend local --store-dir ./ev-index
echovector search "high alarm tone" --backend local --store-dir ./ev-index
echovector stats --backend local --store-dir ./ev-index

The search command does not reopen or scan the audio files. All expensive audio processing happens during index; search loads the saved vector index, embeds the short text query, and returns the nearest timestamped chunks.

Python API

from echovector import EchoVector

ev = EchoVector()

# Index audio files
ev.index("./meetings")

# Search with natural language
results = ev.search("conversation about CUDA kernels")

for r in results:
    print(
        f"{r.filepath} "
        f"[{r.timestamp_range.start:.1f}s - {r.timestamp_range.end:.1f}s] "
        f"score={r.score:.4f}"
    )

Testing on Kaggle

Kaggle is useful for GPU-backed CLAP tests, but first check the runtime Python version:

import sys
print(sys.version)

EchoVector currently declares Python >=3.12. If the Kaggle image is older, install and test in a Python 3.12-capable environment instead, or relax the project requirement only after validating the test suite on that Python version.

Notebook smoke test without internet/model downloads

Upload this repository as a Kaggle dataset, attach it to a notebook, then run:

%cd /kaggle/input/<your-echo-vector-dataset>
!pip install -e . --no-deps
!pip install numpy soundfile librosa faiss-cpu typer rich pydantic
!python -m pytest tests/ -q

Create a tiny audio corpus and test the real CLI/index path:

import os
import numpy as np
import soundfile as sf

audio_dir = "/kaggle/working/ev-audio"
index_dir = "/kaggle/working/ev-index"
os.makedirs(audio_dir, exist_ok=True)

sr = 16000
t = np.linspace(0, 1.0, sr, endpoint=False)
sf.write(f"{audio_dir}/high_tone.wav", 0.25 * np.sin(2 * np.pi * 880 * t), sr)
sf.write(f"{audio_dir}/low_tone.wav", 0.25 * np.sin(2 * np.pi * 110 * t), sr)
!echovector index /kaggle/working/ev-audio --backend local --store-dir /kaggle/working/ev-index --reset
!echovector search "high alarm tone" --backend local --store-dir /kaggle/working/ev-index --top-k 2
!echovector stats --backend local --store-dir /kaggle/working/ev-index

This validates packaging, audio loading, FAISS persistence, metadata storage, and the CLI without depending on Hugging Face downloads.

CLAP semantic test

For actual semantic text-to-audio search, enable internet in the notebook settings and use a GPU runtime if available:

!pip install transformers torch faiss-cpu librosa soundfile
!echovector index /kaggle/input/<audio-dataset> --backend clap --device cuda --store-dir /kaggle/working/clap-index --recursive --reset
!echovector search "people discussing pricing strategy" --backend clap --device cuda --store-dir /kaggle/working/clap-index --top-k 10

If GPU is unavailable, replace --device cuda with --device cpu; it will be slower. Keep indexes under /kaggle/working so they are writable during the notebook session.

Architecture

echovector/
├── audio/        # Audio loading, chunking, streaming, metadata
├── embeddings/   # Pluggable embedding backends (CLAP, Whisper, etc.)
├── indexing/     # Vector index backends (FAISS, with pluggable design)
├── search/       # Search engine, filtering, result hydration
├── cli/          # Typer-based CLI with Rich output
├── api/          # Optional FastAPI server
├── evaluation/   # Metrics (recall@k, throughput)
├── benchmarks/   # Reproducible benchmark harness
└── utils/        # Config, logging, helpers

Supported Embedding Backends

Backend Status Notes
CLAP (default) ✅ Implemented Text+audio aligned; best for text→audio search
local ✅ Implemented Deterministic acoustic-feature backend for offline smoke tests
Whisper Encoder 🚧 Stub Raises NotImplementedError; not yet implemented
wav2vec2 🚧 Stub Raises NotImplementedError; not yet implemented
HuBERT 🚧 Stub Raises NotImplementedError; not yet implemented
Audio Spectrogram Transformer 🚧 Stub Raises NotImplementedError; not yet implemented

Development

# Clone and install
git clone https://github.com/ahron-maslin/echo_vector.git
cd echovector
uv sync --all-extras

# Run checks
make lint
make typecheck
make test
make coverage

License

MIT

Download files

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

Source Distribution

echo_vector-1.1.1.tar.gz (20.9 MB view details)

Uploaded Source

Built Distribution

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

echo_vector-1.1.1-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file echo_vector-1.1.1.tar.gz.

File metadata

  • Download URL: echo_vector-1.1.1.tar.gz
  • Upload date:
  • Size: 20.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for echo_vector-1.1.1.tar.gz
Algorithm Hash digest
SHA256 6418b9d145f43755b0a513142d5400cac0e2b5ad14c14e20eb18c87d6f5abae8
MD5 efc3cdf2b56d236c4519f260f8c1de63
BLAKE2b-256 36ecdef157b443277b0c5931d1556e4017926d290a207888b3fc561e26046c0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for echo_vector-1.1.1.tar.gz:

Publisher: workflow.yml on ahron-maslin/echo_vector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file echo_vector-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: echo_vector-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for echo_vector-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 836d0c6feb9b3a8230d5147bcce483966fb90dadd8d2a57dd66dd2315bc548d2
MD5 8620d861f159bdb5c49b4f2e1ccaa5df
BLAKE2b-256 817282f56f3adf5099412b68e97eb9f98b5c57bb18395c2d1cb1c3b91157276b

See more details on using hashes here.

Provenance

The following attestation bundles were made for echo_vector-1.1.1-py3-none-any.whl:

Publisher: workflow.yml on ahron-maslin/echo_vector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.0.0

2 files

This release

1.1.1 This release

2 files

1.0.4

2 files

1.0.3

2 files

0.1.2

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page