Metadata-Version: 2.4
Name: qmem
Version: 0.0.5
Summary: Qdrant wrapper for simple ingestion & retrieval with pluggable embeddings
Author-email: Aniruddha <aniruddhabolakhe2907@gmail.com>
License: MIT
Keywords: qdrant,vector-db,rag,embeddings,retrieval
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: qdrant-client>=1.7.0
Requires-Dist: pydantic>=2.6
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13.7
Requires-Dist: tomlkit>=0.12
Requires-Dist: questionary>=2.0
Provides-Extra: openai
Requires-Dist: openai>=1.30.0; extra == "openai"
Provides-Extra: minilm
Requires-Dist: sentence-transformers>=2.6; extra == "minilm"
Requires-Dist: torch>=2; platform_machine != "wasm32" and extra == "minilm"

# qmem 

`qmem`  for **easy ingestion and retrieval** with embeddings using qdrant
Supports both **CLI** and **Python API**.

---

## 🚀 Installation

```bash
pip install -e .
```

---

## ⚙️ CLI Usage

### 1. Init (configure keys & embedding model)

```bash
qmem init
```

### 2. Ingest data

```bash
qmem ingest
```

You’ll be prompted for:
- **collection_name**
- **data file path** (JSON or JSONL)
- **field to embed** (e.g. `query`, `response`, `sql_query`, `doc_id`)
- **payload fields** (comma-separated, leave empty to keep all)

### 3. Retrieve results

```bash
qmem retrieve
```

You’ll be prompted for:
- **collection_name**
- **query**
- **top_k** (number of results to return)

---

## 🐍 Python API

```python
import qmem as qm

# Create a collection
qm.create(collection_name="test_learn", dim=1536, distance_metric="cosine")

# Ingest data from a file
qm.ingest(
    file="/home/User/data.jsonl",
    embed_field="sql_query",
    payload_field="query,response",  # optional, keep these fields in payload
)

# Retrieve results (pretty table by default)
table = qm.retrieve(query="list customers", top_k=5)
print(table)
```

---

## 📄 License

MIT
