Skip to main content

A flexible toolkit for semantic search across text, audio, and image data, featuring customizable embedding model support.

Project description

📚 Mono-Kit Library Documentation

mono-kit is a lightweight library that lets you build your own Google Lens, hum-to-search, and RAG-style applications. It supports text, audio, and image embeddings using both default and custom-trained models — with simple tools for processing single or batch data across modalities.


📦 Installation

Install the library via pip:

pip install mono-kit

🔧 Initialization

Start by initializing a chromadb client:

import chromadb

client = chromadb.PersistentClient(path="path_to_save")

You can use any chromadb client (e.g., EphemeralClient, HttpClient, etc.), not just PersistentClient.

⚠️ Collection Name Constraint: Each of mono_document, mono_audio, and mono_image must use unique collection names. You can reuse a collection name across default and custom models.


📝 Text Search: mono_document

1. Initialize Document Handler

mono_docs = mono_document(client, "unique_text_collection")

2. Text Splitting and Mounting

text = """Your long text block here..."""
docs = mono_docs.text_splitter(text, (150, 200), 20, False)

for id, doc in enumerate(docs):
    mono_docs.mount_document(doc, str(id))
  • (150, 200): Min/max character chunk size
  • 20: Overlap in characters
  • False: If True, will retain sentence boundaries (optional feature)

3. Semantic Search

result = mono_docs.find_similar_documents("search query here", k=3)
print(result)

🔊 Audio Search: mono_audio

1. Initialize Audio Handler

mono_aud = mono_audio(client, "unique_audio_collection")

2. Mount Audio Files

mono_aud.mount_audio("path/to/audio1.mp3")
mono_aud.mount_audio("path/to/audio2.mp3")

3. Batch Mounting

mono_aud.mount_audio_batch("path/to/audio_directory")

4. Find Similar Audio

result = mono_aud.find_similar_audio("path/to/query.mp3", k=3)
print(result)

✅ With Custom Audio Model

1. Train Custom Audio Model

x = "path/to/reference_audio"
y = "path/to/target_audio"
mono_aud.create_audio_model(directory_x=x, directory_y=y)

2. Mount and Search with Custom Model

model_path = "custom_trained_audio_embedding_model/audio_model.keras"

mono_aud.mount_audio("audio.mp3", model_path=model_path)
mono_aud.mount_audio_batch("audio_directory", model_path=model_path)

result = mono_aud.find_similar_audio("query.mp3", k=2, model_path=model_path)
print(result)

🖼️ Image Search: mobo_image

1. Initialize Image Handler

mono_img = mono_image(client, "unique_image_collection")

2. Mount Images

mono_img.mount_image("path/to/image.jpg")

3. Batch Mounting

mono_img.mount_image_batch("path/to/image_directory")

4. Find Similar Images

result = mono_img.find_similar_image("path/to/query_image.jpg", k=3)
print(result)

✅ With Custom Image Model

1. Train Custom Image Model

x = "path/to/reference_images"
y = "path/to/target_images"
mono_img.create_image_model(directory_x=x, directory_y=y)

2. Mount and Search with Custom Model

model = "/path/to/custom_trained_image_embedding_model/image_model.keras"

mono_img.mount_image_batch("image_directory", model_path=model)

result = mono_img.find_similar_image("query.jpg", k=3, model_path=model)
print(result)


✅ Summary of Key Functions

Operation Document Audio Image
Mount file mount_document mount_audio mount_image
Mount batch mount_audio_batch mount_image_batch
Similarity search find_similar_documents find_similar_audio find_similar_image
Train custom model create_audio_model create_image_model
Use custom model via model_path via model_path

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

mono_kit-0.1.3.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

mono_kit-0.1.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file mono_kit-0.1.3.tar.gz.

File metadata

  • Download URL: mono_kit-0.1.3.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for mono_kit-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1440870b44615ba85a6a26b27ea0380ddc2c91091e4180cf170be83a4a4346b2
MD5 3f1a79b16a347b25fc5323ee82ca7413
BLAKE2b-256 b50226bdb1e3d93c64007b2c987388ea192d41ee1870c39f0f1fccfa4622fa50

See more details on using hashes here.

File details

Details for the file mono_kit-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mono_kit-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for mono_kit-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9fd4c582f302bba8697334122cecca8eb8ef0dbd17520df0a11ed61090018de4
MD5 9b4592b235e8a193305845e2543e57f8
BLAKE2b-256 aa7c5e72a6d44d83acd750d618a4ba5135c1ea2bdb605d0eb4285e3fa9ce437d

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