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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qmem-0.1.1.tar.gz.
File metadata
- Download URL: qmem-0.1.1.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35b7abd8af6bc1f516887827ea85017e2eab2e8e7d5211a1618e592212508749
|
|
| MD5 |
bf38ac6cf7827f880647ef72c48f167a
|
|
| BLAKE2b-256 |
59440af5aedf0e0914d9b79641617297211d0b5558d8da17b02c9daf153750c2
|
File details
Details for the file qmem-0.1.1-py3-none-any.whl.
File metadata
- Download URL: qmem-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbeb27984f1f63a494f0c87ce83feb3ec11ee2c028dd27a65dd6fac61b672afe
|
|
| MD5 |
fe874f0dd1f221b31b861cf3352d551a
|
|
| BLAKE2b-256 |
5242801574816a889536b2d2cb28fcf60d760b82b0826f96a2ca6a6975aef9d8
|