Long-term memory for AI agents. v2.3 adds Inheritance + Federation, MCP v2.3 (10 new tools), L2 Inject endpoint, Vietnamese FTS.
Project description
MemoryAI — Long-term Memory for AI Agents
Your AI never forgets. Preferences, decisions, context — remembered forever.
Install
Note: Package name is
hmc-memorybecausememoryaiwas squatted on PyPI in 2024.
Import name remainsmemoryaifor 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hmc_memory-2.3.0.tar.gz.
File metadata
- Download URL: hmc_memory-2.3.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d14bfc179be2929bbab5109cd2a9dcbbfba3360c2751345b814a557d8acb1de
|
|
| MD5 |
1eb4a21842ed0a2cb935fe5d0a5c482e
|
|
| BLAKE2b-256 |
f6ca60ccd72962b6cca00c43e4d0232a03fcb7a3a3e430b43e6e15b0b9416baf
|
File details
Details for the file hmc_memory-2.3.0-py3-none-any.whl.
File metadata
- Download URL: hmc_memory-2.3.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70a73ce5a349476f5fa1305e0498987b0096c3e78f9149c89109e082b5b09189
|
|
| MD5 |
9841795f6fa70d01fa3236fba11fbbff
|
|
| BLAKE2b-256 |
ba9734be4a88b4f6deb740f6a47e5c2ff67b25db16e39eccd935d0d7cf0efe79
|