Metadata-Version: 2.4
Name: memyx-client
Version: 1.0.0rc1
Summary: Official Python SDK for Memyx — governed shared memory for AI agent fleets (multi-agent, multi-tenant, MCP-native).
Author-email: Memyx <hello@memyx.app>
License: Apache-2.0
Project-URL: Homepage, https://memyx.app
Project-URL: Documentation, https://memyx.app/docs
Keywords: memyx,agent-memory,ai-agents,llm-memory,rag,mcp,knowledge-graph,vector-search,multi-agent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Dynamic: license-file

# memyx-client

Official Python SDK for [Memyx](https://memyx.app) — **governed shared memory for AI
agent fleets** (multi-agent, multi-tenant, MCP-native).

Your application depends on this SDK, never on raw HTTP — a stable, versioned surface
(the anti-corruption layer) so the engine can evolve without breaking you. Point it at
a managed (`https://memyx.app`) or self-hosted (`http://localhost:8000`) deployment.

## Install

```bash
pip install memyx-client
```

Requires Python 3.9+.

## Quickstart

```python
from memyx_client import Memyx

mc = Memyx("mc_xxx", tenant_id="my-team", agent_id="my-agent")

# Write a memory — enriched server-side with type, title, entities, importance.
m = mc.write("Q3 revenue target is $4M, set on 2026-04-15.", memory_type="fact")

# Recall — an LLM-synthesized context brief plus the supporting memories.
brief = mc.recall("Q3 revenue target")
print(brief.summary)

# RAG knowledge base — documents live in named collections.
mc.doc.put("kb", "faq-1", {"summary": "Support hours", "content": "Mon–Fri 9–6"})

# Governance — load the tenant's keystones (rules) at agent-session start.
for k in mc.keystones():
    print(k.title, "—", k.content)
```

Self-hosted? Pass `base_url`:

```python
mc = Memyx("standalone", tenant_id="default", base_url="http://localhost:8000")
```

## The v1 surface

Frozen, semver-versioned. Eight operation groups, identical in the Python and
TypeScript SDKs:

| Group | Methods |
|---|---|
| **write** | `write(content, ...)`, `write_batch(items, ...)` |
| **recall / search** | `recall(query, ...)`, `search(query, ...)` |
| **list** | `list(...)` — cursor-paginated |
| **manage** | `manage.read/update/transition/delete(memory_id, ...)` |
| **doc** (RAG) | `doc.put/get/delete/list(collection, ...)`, `doc.collections()` |
| **entities** | `entity_get(entity_id)` |
| **keystones** | `keystones(...)` |
| **stats** | `stats()` |

Plus `mcp_config(...)` — the "connect in 30 seconds" helper that emits the MCP config
block for Claude/Cursor and other AI clients.

## Robust by default

- **Typed errors:** `AuthError`, `TenantIsolationError`, `ValidationError`,
  `QuotaExceeded`, `NotFoundError`, `ConflictError`, `ServerError`, and
  `MemyxTransportError` when the engine is unreachable (never a raw socket error).
- **Retries with backoff on idempotent operations only** — writes carry an
  auto-generated idempotency key so a retry replays instead of duplicating.
- Every result exposes the full API payload on `.raw`.

```python
from memyx_client import ConflictError

try:
    mc.write(inbound_message)          # e.g. a WhatsApp webhook
except ConflictError:
    pass  # duplicate (redelivery) — already recorded, idempotent
```

## Docs

Credentials, scopes, and the full API surface: **https://memyx.app/docs**. Production
fleets should use [per-agent keys](https://memyx.app/docs/integrations/per-agent-keys).

## License

Apache-2.0 © 2026 Memyx (Rubén Bolívar)
