Skip to main content

Python SDK for MyMemo — Agent memory ledger on Turso/libSQL

Project description

mymemo

Python SDK for MyMemo — Agent memory ledger on Turso/libSQL.

Install

pip install mymemo

Quick Start

from mymemo import MyMemoConfig, create_clients, MemoryStore, rank
from mymemo.types import MemoryFactDraft, IncidentBase, SearchQuery
import time

# Configure
config = MyMemoConfig(
    routing={"primary": "wss://your-db.turso.io", "replica": "file:./local.db"}
)

# Connect
clients = create_clients(config)
store = MemoryStore(clients.writer, dimension=384)

# Write memory
meta = IncidentBase(scope="my-agent", incident_id="1", timestamp=int(time.time()))
store.write(MemoryFactDraft(content="User prefers dark mode", category="user_preference"), meta)

# Search
results = store.get_candidates(SearchQuery(scope="my-agent", keyword="dark"))
ranked = rank(results, SearchQuery(scope="my-agent"))

Features

  • Idempotent writes — SHA256 deterministic IDs, no duplicates
  • Hybrid search — FTS5 full-text + vector similarity
  • Adaptive ranking — time decay, category-specific tuning
  • GC — automatic eviction of stale memories
  • NaN defense — rejects invalid vectors at write time
  • Shared database — compatible with the TypeScript core SDK

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

mymemo-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

mymemo-0.1.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file mymemo-0.1.2.tar.gz.

File metadata

  • Download URL: mymemo-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for mymemo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cd2dc52ecb70f22974c1ed145a9a47bc06dee5c2a555a2523aae92cf3235f16f
MD5 b0f8bdca67e625147cefd4e90ecfa189
BLAKE2b-256 0a6c48950f9dd23ad5e6b7d975cacdcacbd0bf6f8a89719e94dfc61b9f60b813

See more details on using hashes here.

File details

Details for the file mymemo-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mymemo-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for mymemo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 523e18a00f86266d9769c241f7311b7d118ccc509945d6581153f596eed571ac
MD5 1155819fc2f589de606cbbea1a7c1b89
BLAKE2b-256 059da669e0017f87a9e09c0aee79e0b3182ccb6cab11215f3b389db0ca632f00

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