Skip to main content

MemoryAI v0.8 — Brain with 11 biological behaviors: Ebbinghaus decay, Hebbian learning, Sleep consolidation, Immune system, DNA protection, Neuroplasticity, Temporal invalidation, Community detection + MCP/LangChain/OpenAI proxy integration.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

hmc_memory-0.8.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hmc_memory-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 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-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 274a91735cd4de7eb73af2ea338d3378c16fbcd40673f99a2add270b0b8fcfc2
MD5 abb20ea9f31bb2c1a1b2fe10ae20ed10
BLAKE2b-256 c015dd58cbca73d9161ec8b66c8fb39ae65769e0e4bcd695ac7bde614ae5b845

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