Agent Memory Hub: Region-Governed Memory for AI Agents
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 tous-central1storage 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)]
- Initialize: Create a client with specific region constraints.
- Interact: Use
.write()to save state and.recall()to fetch context. - 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.
Metadata
Release files for agent-memory-hub 0.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_memory_hub-0.3.6.tar.gz | 34.0 kB | Without provenance | Details for agent_memory_hub-0.3.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_memory_hub-0.3.6-py3-none-any.whl | Python 3 | none | any | Details for agent_memory_hub-0.3.6-py3-none-any.whl |
Total release size: 64.5 kB
Release files / agent_memory_hub-0.3.6.tar.gz
| Download URL | agent_memory_hub-0.3.6.tar.gz |
|---|---|
| Size | 34.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec614b28883962e5d7c97740eac4325066dc44ee1b00831e86f0b4f8a1275161
|
|
BLAKE2b-256 checksum How to use checksums |
5b831579c6e7397ab6b1df81a9bc7acf1f16cf1c3932b0c489e33a532c7a1456
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / agent_memory_hub-0.3.6-py3-none-any.whl
| Download URL | agent_memory_hub-0.3.6-py3-none-any.whl |
|---|---|
| Size | 30.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f230c152124b5dfcbc2457ae461b6e7112dd183eb3ec32c03af7c2c2d4181e2e
|
|
BLAKE2b-256 checksum How to use checksums |
73f2711c34c56479f66a9a6876d7896a97ad97df11c53b9e14c442844fe88aff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for agent-memory-hub 0.3.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.