Skip to main content

MemoryAI — Long-term Memory for AI Agents

Your AI never forgets. Preferences, decisions, context — remembered forever.

Install

Note: Package name is hmc-memory because memoryai was squatted on PyPI in 2024.
Import name remains memoryai for clean code: from memoryai import MemoryAI.

pip install hmc-memory

Quick Start

from memoryai import MemoryAI

mem = MemoryAI(api_key="hm_sk_your_key")

# Store a memory
mem.store("User prefers dark mode", memory_type="preference")

# Recall
results = mem.recall("what does user prefer")
for r in results:
    print(f"[{r['score']:.0%}] {r['content']}")

# Bootstrap (start of session)
context = mem.bootstrap("working on payment feature")
# → Returns ~800 token context block with identity + mood + goals

# Save (end of session)
mem.save("Built payment API with Stripe. User decided on webhook approach.")

# Profile
profile = mem.profile()
print(profile["persona"])
print(profile["mood"])

API

MemoryAI(api_key, endpoint, timeout, graceful)

Param Default Description
api_key required Your API key (hm_sk_...)
endpoint https://memoryai.dev API endpoint
timeout 30 Request timeout (seconds)
graceful False Never raise errors, return empty instead

Methods

Method Description
store(content, memory_type, tags) Store a memory
recall(query, limit, depth, since) Search memories
bootstrap(task, mode) Wake up with context (session start)
save(content) Save session summary (session end)
profile() Get cognitive profile (persona, mood, goals)
health() Check memory stats
guard_check(tokens, max_tokens) Check context pressure

Memory Types

Type Lifespan Use for
preference Forever User likes/dislikes
decision Forever Choices made
identity Forever Who the user is
procedure Forever How to do things
fact Decays General knowledge
goal Until done Active objectives

Zero Dependencies

Pure Python stdlib (urllib). No requests, no httpx, no aiohttp. Works everywhere Python runs.

Links

Metadata

Release files for hmc-memory 2.6.0

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

Source distribution (sdist)

Source distribution for hmc-memory 2.6.0
File Size Uploaded
hmc_memory-2.6.0.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hmc-memory 2.6.0
File Interpreter ABI Platform
hmc_memory-2.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / hmc_memory-2.6.0.tar.gz

Download URL hmc_memory-2.6.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d0df57cffe3501ca1cfa1fa84837d3f46c2b6a1339d1c3c7bb7e6db686b8f4d1
BLAKE2b-256 checksum
How to use checksums
9f82f1009e401fc93b7cf9060b7252c8739e025193e0c40a552fbb4429912db8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / hmc_memory-2.6.0-py3-none-any.whl

Download URL hmc_memory-2.6.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2f0348174d65ed75fd8fa24466551caf6f0e840c9e74e255e5929160629eba2
BLAKE2b-256 checksum
How to use checksums
c74d1135bf084e300bad6f0e213affc030612771e476766a1b7018f6edb0b347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

2.6.0 This release

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

0.9.0

1 release file

0.8.0

1 release file

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

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