Skip to main content

/ ml (slashml-memory) Python SDK

Official HTTP Python SDK for / ml (https://api.slashml.ai).

Installation

pip install slashml-memory
export SLASHML_API_KEY="sml_live_..."

Quickstart

1. Native / ml Memory Client (SlashMLMemory / MemoryClient)

from slashml import SlashMLMemory

client = SlashMLMemory(api_key="sml_live_...")

# Ingest text or source code
client.ingest(
    documents=[
        {"id": "doc_1", "text": "Production PostgreSQL runs on port 5432 with pgBouncer on 6432."}
    ],
    user_id="alice",
)

# Query stored memories
hits = client.query("Which port does pgBouncer listen on?", user_id="alice", top_k=3)
print(hits["results"][0])

# Delete documents by ID
client.forget(["doc_1"], user_id="alice")

2. 1-Line Mem0 Drop-In Replacement (Memory & MemoryClient)

Replace from mem0 import MemoryClient or from mem0 import Memory with from slashml import MemoryClient, Memory:

# Before: from mem0 import MemoryClient
from slashml import MemoryClient

client = MemoryClient(api_key="sml_live_...")

client.add(
    [{"role": "user", "content": "Always use uv and pytest -q for Python checks."}],
    user_id="developer_1",
)

results = client.search("How should I run Python tests?", user_id="developer_1")

# 3. Evaluate an agent turn or tool action
decision = client.intervene(
    "pip install pytest",
    hook_event_name="PreToolUse",
    tool_name="Bash",
    user_id="developer_1",
)

3. Inline Redaction & Per-Agent Read/Write Access Control

from slashml import Memory

admin = Memory(api_key="sml_live_...")

# Configure workspace defaults & bind a read-only, GDPR-masked support agent
admin.set_redaction_policy(
    redact_policy="tier1_secrets",
    redact_scope="recall_only",
    access_mode="read_write",
)
admin.configure_agent(
    agent_id="support_triage_bot",
    access_mode="read_only",
    redact_policy="gdpr",
    redact_scope="recall_only",
)

# Scoped agent client automatically attaches X-SlashML-Agent-Id
triage = Memory(api_key="sml_live_...", agent_id="support_triage_bot")
masked = triage.redact(text="Billing contact is alice@acme.io")
recalled = triage.search("Who is the billing contact?", user_id="developer_1")

4. CLI & Ambient Hook Installation

python -m slashml.mcp_server --install-hooks --api-key "$SLASHML_API_KEY" --agent-id "coding_agent" --redact-policy "soc2_coding"

License

Apache-2.0

Metadata

Release files for slashml-memory 1.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slashml-memory 1.0.13
File Size Uploaded Provenance Actions
slashml_memory-1.0.13.tar.gz 40.0 kB Without provenance Details for slashml_memory-1.0.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for slashml-memory 1.0.13
File Interpreter ABI Platform Actions
slashml_memory-1.0.13-py3-none-any.whl Python 3 none any Details for slashml_memory-1.0.13-py3-none-any.whl

Total release size: 83.9 kB

Release files / slashml_memory-1.0.13.tar.gz

Download URL slashml_memory-1.0.13.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c3f4adfb6cc2018ffa5cb7c290fce810ca11d55138d2f46334d50a98524783ca
BLAKE2b-256 checksum
How to use checksums
bf87f1a895c29c95c2f185bfc2a5b43951381da8e7ff43ba03587439fc048266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / slashml_memory-1.0.13-py3-none-any.whl

Download URL slashml_memory-1.0.13-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
873558d59bfe26fa10b9a44c7ff8d716ccf8a25d4542cfe2aed40c4ee3611e51
BLAKE2b-256 checksum
How to use checksums
0acc8f20b46289e5a8ce145fe5aa4f444df381cb74667d73ea2ba897bf5b53f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for slashml-memory 1.0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page