Skip to main content

Persistent memory for AI agents — store, retrieve, and recall context across sessions.

Project description

agentmemo

Persistent memory for AI agents. Store, semantically retrieve, and recall context across sessions. Pure standard library (no required dependencies).

pip install agentmemo

Quick start

from agentmemo import MemoryClient

# Get a free key (or pass an existing one)
key = MemoryClient.signup("my-agent")["api_key"]
mem = MemoryClient(key)

# Store
mem.store(
    user_id="user_123",
    agent_id="assistant",
    content="User prefers dark mode and works in TypeScript.",
    tags=["preference"],
    importance=8,
)

# Retrieve semantically
hits = mem.search(user_id="user_123", query="what are the user's preferences?")

# Context for an LLM system prompt
ctx = mem.context(user_id="user_123", format="anthropic")["context"]

API

  • store(user_id, agent_id, content, metadata=None, ttl_seconds=None, tags=None, namespace="default", importance=5, outcome="unknown", detect_conflicts=False)
  • search(user_id, query, agent_id=None, limit=10, namespace=None, tags=None, min_importance=None)
  • delete(id=None, user_id=None, agent_id=None)
  • context(user_id, agent_id=None, max_tokens=2000, format="raw")
  • feedback(memory_id, outcome, confidence=1.0)
  • batch(memories)
  • stats(user_id=None), usage()
  • MemoryClient.signup(name) — static, returns a free API key
  • Async: await mem.async_store(...), await mem.async_search(...) (requires pip install agentmemo[async])

Errors raise AgentMemoError with .status, .code, .body.

Docs: https://agentmemo.dev/docs · Apache-2.0 · Built by Dr. Nadeem Shaikh

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

agentmemo_py-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

agentmemo_py-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file agentmemo_py-1.0.0.tar.gz.

File metadata

  • Download URL: agentmemo_py-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for agentmemo_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a52c3e0a7d3638d7850e224aeb1b53eadbbef7266fc06f8a9868dbe0b2e5f7ad
MD5 bf7f53361cbd272476124c4163418952
BLAKE2b-256 8bf2d80e23e289e054248c100c2b89651f851b197fc1758605c26ccc770e4343

See more details on using hashes here.

File details

Details for the file agentmemo_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: agentmemo_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for agentmemo_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26eef4e0b8f238d0bc33444cbc8e4cff261734b15f09b380e8ebc3c25fd04dba
MD5 f6585c4588bb524ec90507d1a4e21250
BLAKE2b-256 2f4136514edff0bd0ac332a0d511e917c39aee1f0302204e2653d982f5ca4e69

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