Skip to main content

Memory library for seamless data ingestion, storage, and retrieval with customizable embedding models.

Project description

QMem

QMem is a toolkit for vector search.
It provides a command-line interface (CLI) and a Python library for interacting with a Qdrant database.
It is designed for directness and utility, offering a guided CLI for interactive tasks and a minimal Python API for programmatic control.


🚀 Installation

pip install qmem

🛠️ Commands

🔹 init

Initializes the configuration.

CLI

qmem init

🔹 create

Creates a vector collection.

CLI

qmem create

Library

import qmem

qmem.create(
    collection_name="my-collection",
    dim=1536,
    distance_metric="cosine"
)

🔹 ingest

Ingests data into a collection.

CLI

qmem ingest

Library

import qmem

qmem.ingest(
    file="path/to/data.jsonl",
    embed_field="text"
)

🔹 retrieve

Performs a vector search.

CLI

qmem retrieve "your query text"

Library

import qmem

results = qmem.retrieve(
    query="your query text",
    top_k=3
)
print(results)

🔹 index

Creates an index on metadata for filtering.

CLI

qmem index

🔹 filter

Retrieves records by metadata.

CLI

qmem filter

Library

import qmem

filter_payload = {
  "must": [
    { "key": "genre", "match": { "value": "Sci-Fi" } }
  ]
}

results = qmem.filter(filter_json=filter_payload, limit=10)
print(results)

🔹 retrieve-filter

Combines vector search with metadata filtering.

CLI

qmem retrieve-filter "your query text"

Library

import qmem

filter_payload = {
  "must": [
    { "key": "genre", "match": { "value": "Sci-Fi" } }
  ]
}

results = qmem.retrieve_filter(
    query="your query text",
    filter_json=filter_payload,
    top_k=2
)
print(results)

📜 License

MIT

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

qmem-0.1.6.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

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

qmem-0.1.6-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file qmem-0.1.6.tar.gz.

File metadata

  • Download URL: qmem-0.1.6.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for qmem-0.1.6.tar.gz
Algorithm Hash digest
SHA256 2a16069cb0a4f52f4828ebad07eb1b3d64ad86a3a9dc00e1855434952001ede5
MD5 e7ea857fb1372f048baaf29d638be395
BLAKE2b-256 b96d27219f2909e9786f387bd247425b520158d7d393303c2bfda7dae8cf4da3

See more details on using hashes here.

File details

Details for the file qmem-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: qmem-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for qmem-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fb2a5b3543c3969214312f3d60ba1a565cdf8cd4bcc687af2b1b0ad5cd8db2a0
MD5 43aa82e35a0e13643a711a3f287782f7
BLAKE2b-256 e956089b322dbed6f0059e506ef0ab9ff8f5758015c79531219e67c90c97becd

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