Skip to main content

MemMesh — memory + prediction for AI agents. Official Python SDK.

Project description

MemMesh Python SDK

Memory + prediction for AI agents. MemMesh remembers across sessions, forecasts what happens next with a calibrated confidence score, and stays compliant — everything mem0 does, plus a prediction layer it has no answer for.

pip install thinkfleet-memmesh   # the import name is still `memmesh`

Quickstart

from memmesh import MemMesh, subject

mm = MemMesh(api_key="sk-...", project_id="proj_...")

# 1 — Observe: feed it anything; the engine decides what to keep
mm.observe(
    "Moved to the annual plan, prefers email over SMS.",
    subject=subject("contact", "user_42"),
)

# 2 — Recall: hybrid semantic + keyword search
hits = mm.search("billing preferences", limit=5)

# 3 — Predict: what mem0 can't — what happens next, with provenance
result = mm.predict(subject("contact", "user_42"), horizon_days=30)
for p in result["predictions"]:
    print(p["expectedAt"], p["description"], p["confidence"])

# How honest is that confidence? Ask the calibration report.
print(mm.calibration())

Async

import asyncio
from memmesh import AsyncMemMesh, subject

async def main():
    async with AsyncMemMesh(api_key="sk-...", project_id="proj_...") as mm:
        await mm.observe("...", subject=subject("user", "ryan"))
        preds = await mm.predict(subject("user", "ryan"))

asyncio.run(main())

What's here

Area Methods
Memory observe · create · search · list · update · delete · stats · feedback
Prediction (mm.lattice) predict · mine · profile · predict_by_cohort · calibration

Every method accepts an optional project_id= to override the client default, and raises a typed error (AuthenticationError, RateLimitError, ValidationError, …) on failure. 429 and 5xx are retried with backoff.

Configuration

MemMesh(
    api_key="sk-...",
    project_id="proj_...",
    base_url="https://memory.thinkfleet.ai",  # or your self-hosted engine
    timeout=30.0,
    max_retries=2,
)

Development

pip install -e ".[dev]"
pytest
ruff check . && mypy src/memmesh

Apache-2.0 · built by ThinkFleet · https://memmesh.ai

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

thinkfleet_memmesh-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

thinkfleet_memmesh-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for thinkfleet_memmesh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 448c487e67cda00dacc38ddb894b9b82373b310d81dc7aecee18c3db79dc9cdb
MD5 37a1102dc2f50e1df2c2c97f007d67fa
BLAKE2b-256 4203ab777c3fc655337260ca4bcc85f05d442ab4611f35c52fd182de6be787b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for thinkfleet_memmesh-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b06141300b670962565951df4a6e5b26d3e0042addf639f84acc2b47e2cbac21
MD5 1c42ba6084561d39facc39efa6abd2c8
BLAKE2b-256 a3f01a5a2e507f9701b07b27657002ce482d05b509fe128b87b0ad9bad316aae

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