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.0.tar.gz (21.9 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.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qmem-0.1.0.tar.gz
  • Upload date:
  • Size: 21.9 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.0.tar.gz
Algorithm Hash digest
SHA256 8db046587ad37d37cf34631276a65f4461aa61ebdedea38382a13ad7cd74ce05
MD5 5a97f84d87c05321e9cf107d845ad2e9
BLAKE2b-256 d0f715fc17ae12aa6726eba987db4898f96cb2ac4d6019cd9fd49fd8bdd43901

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qmem-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b226312767f4a68b9c6ec679fee4ef75f70fd23239563ce6dfb27f63cdfef84d
MD5 4572529227ba5a65844fc1e6f8b29ecf
BLAKE2b-256 3269adee646293064f381235091110e45e28cecd0480313ed4316746207175ac

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