Skip to main content

Python SDK for the Quorex persistent memory engine.

Project description

quorex

Official Python SDK for Quorex — the memory layer for AI agents. Store, retrieve and inject persistent user context into any LLM in one call.

Requires Python 3.10+. One dependency: httpx.

Install

pip install quorex

Quickstart

from quorex import Memory

qx = Memory(api_key="qx_live_...")  # or set QUOREX_API_KEY

# Store a memory for one of your end-users
qx.remember("user_123", "I switched to Vue.js, React feels too verbose")

# Recall the relevant context before calling your LLM
memories = qx.recall("user_123", "what framework does this user prefer?")
for m in memories:
    print(m.text, m.final_score)

Get your secret key from the dashboard → API Keys.

Client

Memory(
    api_key=None,                     # or QUOREX_API_KEY env var
    base_url="https://api.quorex.fr", # default
    timeout=30.0,                     # seconds
)

Memory is an alias of QuorexClient. It can be used as a context manager (with Memory() as qx: ...) to close the underlying HTTP client automatically.

API

Method Description
remember(user_id, text, *, action?, metadata?, timestamp?, ttl_days?) Store a memory → StoreResult(vec_id)
recall(user_id, query, *, top_k?, threshold?) Ranked memories → list[Memory]
explain(user_id, query, *, top_k?) Memories + score breakdown → list[ExplainResult]
forget(user_id, vec_id) Delete one memory → ForgetResult(deleted, vec_id)
purge(user_id) GDPR — delete all of a user's memories → int
export(user_id) GDPR — export all data → ExportResult
freeze(user_id) Stop temporal decay → bool
stats(user_id=None) Usage stats for the key → dict

Examples

r = qx.remember("user_123", "prefers dark mode", action="preference")
r.vec_id  # 42

explained = qx.explain("user_123", "ui preference?")
explained[0].explanation
explained[0].score_breakdown

qx.forget("user_123", vec_id=42)
removed = qx.purge("user_123")     # int
data = qx.export("user_123")       # ExportResult
qx.freeze("user_123")              # bool
usage = qx.stats()                 # dict

Errors

All errors extend QuorexError (which carries a status_code). Catch the specific type you care about:

from quorex import Memory, AuthenticationError, QuorexError

qx = Memory()
try:
    qx.recall("user_123", "...")
except AuthenticationError:
    print("Check your API key")
except QuorexError as e:
    print("Quorex error:", e)

AuthenticationError (401) · NotFoundError (404) · RateLimitError (429) · ServerError (5xx).

Develop

pip install -e ".[dev]"   # install in editable mode + test deps
pytest                    # run the offline unit tests
python examples/e2e.py    # run a real end-to-end check (needs QUOREX_API_KEY)

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

quorex-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

quorex-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quorex-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for quorex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e39ef7c80d57821b854d447bc465e922e354c8b33c14682b495380fea14089ba
MD5 c11fb6caae2eec8e0be0edecdae01492
BLAKE2b-256 d03aa1827f964b033d790d880d7f56836a47027a4450462bd27545710042623c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quorex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for quorex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8851b4a1243a781855b995180b6988d095e5558fb52d1913ebe99ebb06787661
MD5 b10914fb22daf8c676d3278c438e262f
BLAKE2b-256 218c979b462b6846c8b63f369f258b397d00b50792dc3fa744a737f84bc0b8d9

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