Long-term memory for AI agents. Your AI never forgets.
Project description
MemoryAI — Long-term Memory for AI Agents
Your AI never forgets. Preferences, decisions, context — remembered forever.
Install
pip install memoryai
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
hmc_memory-2.1.0.tar.gz
(4.7 kB
view details)
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.1.0.tar.gz.
File metadata
- Download URL: hmc_memory-2.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b53d835989fb29161dba1c6abbb14892b777c4fca2f9341979c621a08938bbdd
|
|
| MD5 |
56c4074eeebc05058b28fb9d2d4f075a
|
|
| BLAKE2b-256 |
4624b5b36141141bdfbe82847ea020350cdeea1a33a20809913e38e358f365d5
|
File details
Details for the file hmc_memory-2.1.0-py3-none-any.whl.
File metadata
- Download URL: hmc_memory-2.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 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 |
38482d74925eb476ebe3e469f23a0502321c6602a562bb5993ce3e71a3c2d691
|
|
| MD5 |
597f09bf0e50f9edd54248033a5da678
|
|
| BLAKE2b-256 |
6316cf477facbbdec4a326a5d1c4428738bacafedd20ca30941d8b79ba0e1e9c
|