Skip to main content

Enterprise-grade agent memory management solution with region governance.

Project description

Agent Memory Hub: Region-Governed Memory for AI Agents

PyPI Python Versions CI Docs License

Agent Memory Hub is the enterprise-standard solution for managing long-term memory for AI agents with strict region governance. Designed for developers building scalable agentic workflows, it provides a unified interface to store, recall, and manage agent state across diverse storage backends while ensuring compliance with data residency laws (GDPR, CCPA).

Whether you are building a simple chatbot or a complex multi-agent system, agent-memory-hub abstracts the complexity of state management, letting you focus on agent logic.


🚀 What is Agent Memory Hub?

Agent Memory Hub is a Python SDK that acts as a middleware between your AI agents (built with LangChain, AutoGen, OpenAI, etc.) and your storage infrastructure. It creates a structured "brain" for your agents where every interaction, fact, or retrieved context is indexed by Agent ID and Session ID.

Crucially, it introduces Region Governance as a first-class citizen. You can strictly enforce that an agent's memory never leaves a specific geographic region (e.g., europe-west1), which is critical for enterprise applications handling sensitive user data.

💡 Why Use It?

  • Data Sovereignty & Compliance: Native support for region governance. If an agent is configured for europe-west1, the SDK physically prevents writes to us-central1 storage buckets.
  • Backend Agnostic: Switch from Google Cloud Storage to AlloyDB, Redis, or Firestore without changing your agent code.
  • Session Isolation: Automatically segregates memories by session, making it perfect for conversational agents and RAG pipelines.
  • Production Ready: Typed, tested, and security-scanned. No hardcoded secrets.

⚙️ How It Works

The library uses an Adapter Pattern to connect to various storage backends. When you initialize a MemoryClient, you specify the Agent, Session, and Region.

graph LR
    A[AI Agent] -->|Write/Recall| B(MemoryClient)
    B -->|Region Check| C{Region Allowed?}
    C -->|Yes| D[Storage Adapter]
    C -->|No| E[Error]
    D -->|Persist| F[(GCS / AlloyDB / Redis)]
  1. Initialize: Create a client with specific region constraints.
  2. Interact: Use .write() to save state and .recall() to fetch context.
  3. Govern: The SDK handles the routing and compliance checks transparently.

🛠️ Installation

pip install agent-memory-hub

# For specific backends
pip install "agent-memory-hub[alloydb]"
pip install "agent-memory-hub[redis]"

⚡ Quick Start & Examples

We provide ready-to-use examples for common scenarios:

1. OpenAI Agent Integration

Inject long-term memory into your OpenAI API calls to personalize responses.

from agent_memory_hub import MemoryClient
# ... initialization ...
memory.write("User prefers concise Python code.")
context = memory.recall()
# Inject 'context' into your system prompt

2. Multi-Region Architecture

Manage distinct compliance requirements for global user bases.

# This client will ONLY write to EU-based storage
eu_memory = MemoryClient(agent_id="eu_bot", region="europe-west1", region_restricted=True)

3. RAG Agent with Memory

Enhance Retrieval-Augmented Generation (RAG) by caching retrieved context and user interactions.


📚 Documentation

Full documentation is available at https://sgmoorthy.github.io/agent-memory-hub/.

🤝 Contributing

We welcome contributions! Please check CONTRIBUTING.md and our ROADMAP.md.

🛡️ Security

This project adheres to strict security practices. See SECURITY.md for details.

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

agent_memory_hub-0.3.2.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

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

agent_memory_hub-0.3.2-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file agent_memory_hub-0.3.2.tar.gz.

File metadata

  • Download URL: agent_memory_hub-0.3.2.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agent_memory_hub-0.3.2.tar.gz
Algorithm Hash digest
SHA256 31b5e96c83c92c76665a924cc069ee4618eff144e4043b32a1eef3ccb955c62b
MD5 3a643f15e25d17c25c26e0524109870b
BLAKE2b-256 60b4497a58153c19218679fc06468eca0d4a3bdf233421c582bf019c3ebea1ee

See more details on using hashes here.

File details

Details for the file agent_memory_hub-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_memory_hub-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4aa00f9ee88e96958626ae0271a15770983c73331b538b78f6d514c5710bfbd0
MD5 96a1519c0e01c3e9f2cabcdde4f6873d
BLAKE2b-256 ffd67a0cf4ce01e22b917ae8b7e1520f641842a5a27eb2c7fc5f9d57f27eb546

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