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.4.tar.gz (26.1 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.4-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qmem-0.1.4.tar.gz
  • Upload date:
  • Size: 26.1 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.4.tar.gz
Algorithm Hash digest
SHA256 da9ec5d96d7de94af0ab7bcdc39eea1804f0442e0690506edd40fafd7ccb7151
MD5 e35e730ef6fbe0775a7d8199e96db863
BLAKE2b-256 d4885602ffcd2fed65f1399692b69f11b7a5da8768845a314f11109b46b5684e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qmem-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 29.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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 adaaf2dee161a56edd09bad207f7eadf82132657861a47450bf538cde3a79517
MD5 c0836bd433bacde09b1d54d0b6e37760
BLAKE2b-256 ad7ef224b3f1b2034707cb9bb4edde8ae6273a44a114c4df9791e68ed51198e1

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