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.0.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.0.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hmc_memory-2.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 4a6b1876166bef2c6e1a705fb6eb0e9cead51d4b0b5931c26a78258e30ad4859
MD5 5fb23d7af6bf91829940b26f05f9242d
BLAKE2b-256 c0875cc6de5062f69b5419808d344fcb2d66e4c45fc6af2cf2560656f6454008

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hmc_memory-2.0.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bf5c37d37fdb1fbac30a11a36816fe6d6a018bc3c661cb881a112cafc53185f
MD5 0186ca4ec380dc39681fc59689078261
BLAKE2b-256 3d5a5a0829d272ffa07c04ca5ef51954c72a263450d0849ee6e0140ae603654b

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