Skip to main content

MemoryAI v2.0 — Living Brain for AI Agents. Emotion State Engine, Context Guard, DNA-protected memories, Multi-Agent Mesh, Hebbian learning, Ebbinghaus decay, Sleep consolidation, Personality synthesis, Causal reasoning.

Project description

MemoryAI — Python SDK

PyPI Python

A brain for your AI agent. Store, recall, and manage context across sessions — memories persist and strengthen with use, just like the human mind.

Install

pip install hmc-memory

Quick Start

from memoryai import MemoryAI

mem = MemoryAI(api_key="hm_sk_...", base_url="https://memoryai.dev")

# Bootstrap — load context at session start
ctx = mem.bootstrap(task_description="Fix auth bug", project_name="my-app")
print(ctx["context_block"])

# Store — save what you learn
mem.store("User prefers dark mode", tags=["preferences"], priority="hot")

# Recall — search memory
for r in mem.recall("user preferences"):
    print(f"[{r.score:.0%}] {r.content}")

# Learn — store action + result + lesson
mem.learn(action="Fixed N+1 query", result="Response time 2s → 50ms", lesson="Always check ORM queries")

# Compact — consolidate session into key memories
mem.compact("Session transcript...", task_context="Refactoring auth")

mem.close()

Async

from memoryai import AsyncMemoryAI

async with AsyncMemoryAI(api_key="hm_sk_...", base_url="https://memoryai.dev") as mem:
    await mem.store("Important context", tags=["project"])
    results = await mem.recall("project context")

IDE Integration (MCP)

Works with Cursor, VS Code, Claude Desktop, Windsurf, Kiro, and OpenClaw via MCP server. See Integration Guide.

How Your Agent's Brain Works

Memories are processed through 4 stages — just like the human brain:

Stage What it does Like...
Instant Recall What's on the tip of your tongue. Always ready, zero delay. Remembering your own name
🔍 Deep Search Scans long-term memory, finds matches by meaning — not just keywords. "Where did I put that...?"
🧠 Reasoning Reads multiple memories, connects the dots, synthesizes a precise answer. (Pro) Thinking hard about it
📦 Archive Compressed long-term storage. Memories age naturally, but nothing is truly forgotten. That thing from 6 months ago

The more you recall a memory, the stronger it gets. Unused memories gently fade to deeper storage — but deeper recall can always bring them back.

Features

  • 🔥 Hot / 🌤️ Warm / ❄️ Cold — Priority levels mirror how the brain stores memories
  • Associative connections — Related memories link automatically, like neurons forming pathways
  • Entity tracking — Recognizes files, people, packages, and URLs in your context
  • Session recovery — Pick up exactly where you left off, every time
  • Collective knowledge — Shared intelligence pool across users (anonymized, opt-in)
  • Smart deduplication — Same knowledge stored once, no matter how many times you mention it
  • Contradiction detection — Outdated info is flagged when newer facts arrive

Legacy Imports

Backward compatible — these still work:

from cortexmemory import MemoryAI      # OK
from hybridmemory import HybridMemory  # OK — alias for MemoryAI

Get an API Key

curl -X POST https://memoryai.dev/v1/admin/provision \
  -H "Content-Type: application/json" \
  -d '{"name": "my-agent", "tos_accepted": true}'

Or visit https://memoryai.dev to create one instantly.

Links

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

hmc_memory-2.4.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

hmc_memory-2.4.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file hmc_memory-2.4.0.tar.gz.

File metadata

  • Download URL: hmc_memory-2.4.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for hmc_memory-2.4.0.tar.gz
Algorithm Hash digest
SHA256 242d3a62f283e1d3b833bda91021430dba6c60a8ac2b2ce83693204daafe2023
MD5 c17ccad3ecf943c869841ed12a622eb3
BLAKE2b-256 76ce58fec2b44110309da3c8da673d1c6178f85ebb99fc4b221aea5a8c3ab1ed

See more details on using hashes here.

File details

Details for the file hmc_memory-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: hmc_memory-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for hmc_memory-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d17b58e62b356bd2f48f74eb2f22fd70520f8b3bef98ad51baafa73f66ae02bb
MD5 397721a6739fa2f03a65632bd6257470
BLAKE2b-256 f1684acf875081bc915821792ab923b0ffb0318be1390c075df6a068b3bfb56c

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