The long-term memory service is a core capability of Context Service. Built on ADBPGMem, it provides memory data management and service configuration for three memory scenarios: Session, User, and Agent.
Log on to the ADBPGMem dashboard
After you activate the long-term memory service, you can manage memory data and configure the service on the ADBPGMem Dashboard.
-
On the Context Service page, select the target workspace.
-
In the Long-term Memory service area of the workspace, click Access Service to log on to the ADBPGMem Dashboard.
Core features
Memory scenarios
The service supports the following three memory scenarios:
|
Memory scenario |
Description |
Retrieval method |
|
Session |
A short-term memory scenario that focuses on memories within a specific conversation session, without referencing other sessions. Memories are persistently stored unless explicitly deleted through the memory deletion API. |
Load or retrieve all memories for the session by using the Run ID. |
|
User |
References all of a user's historical memories across sessions. Primarily stores factual, episodic, and semantic memory types. |
Retrieve all memories for a user by using the User ID, or retrieve memories for a specific session by using both the User ID and Session ID. |
|
Agent |
Designed for the long-term memory of an AI agent. Agent memory focuses on procedural memory, such as actions and outcomes of sub-tasks. When your application calls the agent memory API, AnalyticDB for PostgreSQL uses a specific prompt to extract the agent-LLM interaction history and stores it as memory in a vector store. |
Retrieve all memories for an agent by using the Agent ID, or retrieve memories for a specific session by using both the Agent ID and Session ID. |
Memory categories
For each memory, ADBPGMem automatically classifies the content and supports category-based retrieval. A single memory can have multiple category tags.
|
Category |
Description |
|
|
Static personal information: age, gender, contact details, nationality, educational background, etc. |
|
|
Family relationships: spouse, children, parents, relatives, and dynamic family events. |
|
|
Professional information: job title, company history, industry expertise, skills, career achievements, and goals. |
|
|
Sports interests: sports participation, preferences (team/individual), training habits, and achievements. |
|
|
Travel history: places visited, preferred destinations, travel frequency, and accommodation preferences. |
|
|
Dietary preferences: favorite cuisines, allergies/restrictions, cooking habits, and restaurant preferences. |
|
|
Music preferences: genres, favorite artists, instruments played, and concert attendance. |
|
|
Health status: medical records, fitness plans, nutrition plans, and physical/mental wellness goals. |
|
|
Technology-related: device preferences, software proficiency, programming skills, and interest in new technologies. |
|
|
Interests and hobbies: reading, art, crafts, gardening, gaming, and related community involvement. |
|
|
Fashion style: clothing preferences, brand affinities, shopping habits, and accessory choices. |
|
|
Entertainment preferences: movies, TV shows, books, streaming platforms, and theater/festival attendance. |
|
|
Life milestones: graduation, wedding, promotions, awards, and significant personal achievements. |
|
|
User settings and preferences: UI themes, language settings, notification configurations, tool customizations, etc. |
|
|
Miscellaneous: information that does not fit into other categories, temporary notes, or special records. |
Memory retrieval
-
Query processing
-
Uses an LLM to extract key information from the user's original query.
-
Generates appropriate filtering conditions, such as categories or time ranges, based on context and query intent to improve retrieval efficiency and accuracy.
-
Configurable retrieval parameters: the number of memories to return (TopK) and a retrieval threshold (Threshold). Memories with scores below the threshold are not returned.
-
-
Vector search
-
Performs semantic search in a vector database by creating an embedding from the optimized query.
-
Ranks results based on their relevance to the query.
-
Applies specified filters (user, agent, metadata, etc.).
-
-
Result processing
-
Integrates results from multiple search criteria and ranks them by relevance, importance, and time.
-
Returns memory entries with their relevance scores.
-
Includes relevant metadata and timestamps, such as tags and categories.
-
Memory update
-
Information extraction
-
Uses an LLM to extract relevant memories from the conversation context.
-
Identifies important entities and extracts relationships between them to build a knowledge graph.
-
-
Memory storage
-
A vector database stores the actual memory content.
-
A graph database stores the relationships between entities.
-
Memory content is automatically updated in each turn of the conversation.
-
ADBPGMem benefits
ADBPGMem is compatible with the mem0 protocol and offers capabilities beyond the mem0 community edition:
|
Feature |
ADBPGMem |
Mem0 community edition |
|
Memory CRUD operations |
Supported |
Supported |
|
AI agent integration (procedural memory) |
Supported and optimized |
Unavailable |
|
AI agent ecosystem |
Integrates with Hermes, OpenManus, Supabase, and SAA |
None |
|
Vector engine |
In-house vector engine from AnalyticDB for PostgreSQL |
Requires user integration |
|
Episodic memory |
Supported |
Not supported |
|
Time-based memory decay |
Supported |
Not supported |
|
Asynchronous/synchronous modes |
Supported, |
Asynchronous only |
|
Memory lifecycle management |
Supported |
Not supported |
|
Models |
Freedom to choose embedding and LLM models |
Foreign models + DeepSeek |
|
Data sovereignty |
Supports deployment in and outside of China, keeping data within the specified region |
Hosted overseas |
API reference
|
Function |
API |
Description |
|
Add a memory |
POST |
Extracts facts from a conversation and writes them to the vector store. This operation is asynchronous by default (async_mode=true). Set to false to wait for the result synchronously. |
|
Search memories |
POST |
Performs a vector-based semantic search for memories. Entity IDs must be passed in the |
|
Get all memories |
POST |
Retrieves a paginated list of memories. Pass the entity ID in the filters object and pagination parameters (page/page_size) as query parameters. |
|
Get a single memory |
GET |
Gets the details of a single memory by ID. |
|
Update a memory |
PUT |
Updates the content of a specified memory. The request body supports either a |
|
Delete a memory |
DELETE |
Deletes a specified memory. |
|
Batch delete |
DELETE |
Deletes memories in batches, filtering by |
|
History |
GET |
Retrieves the modification history for a specified memory. Each item in the returned list includes fields such as |
|
Health check |
GET |
A health check endpoint that verifies service reachability and authentication validity. |
For detailed API usage, log on to the ADBPGMem Dashboard and click API Documentation in the left-side navigation pane.
Agent integration
ADBPGMem supports the mem0 SDK protocol. For example, Hermes Agent requires only one line of configuration to use ADBPGMem as its long-term memory backend.
Hermes agent
Hermes uses a plugin architecture for its memory system (MemoryProvider ABC). The official built-in mem0 plugin communicates with the memory backend through the mem0 SDK. Any mem0-compatible service can serve directly as the memory backend for Hermes.
Mem0 SDK compatibility
ADBPGMem implements full compatibility with the mem0 SDK's /v3/ paths on top of its REST API.
|
Mem0 SDK call |
Internal path |
Compatibility status |
|
|
|
Fully compatible |
|
|
|
Fully compatible |
|
|
|
Fully compatible |
|
|
|
Fully compatible |
Key adaptations:
-
Path mapping: Maps
/v3/memories/search/to the internal semantic search engine. -
Parameter format compatibility: Accepts both a top-level
user_idparameter and the nestedfilters: {user_id: ...}format. -
Response format alignment: The response structure is consistent with the mem0 Platform API (
{results: [...], total, page, ...}).
No adapters or custom HTTP clients are required — any framework that uses MemoryClient(host=...) is plug-and-play, including mem0 ecosystem applications such as Hermes, LangChain, and CrewAI.
Hermes mem0 plugin changes
The mem0 plugin in Hermes originally supported only the official Mem0 Platform. To integrate with ADBPGMem, add a base_url configuration option to the plugin:
# plugins/memory/mem0/__init__.py (+9, -1)
# Core change in _get_client():
- self._client = MemoryClient(api_key=self._api_key)
+ kwargs = {"api_key": self._api_key}
+ if self._base_url:
+ kwargs["host"] = self._base_url
+ self._client = MemoryClient(**kwargs)
Configure ~/.hermes/.env:
MEM0_API_KEY=sk-your-adbpgmem-token
MEM0_BASE_URL=https://your-adbpgmem-endpoint
After Hermes starts, ADBPGMem automatically handles memory extraction, storage, and semantic retrieval on the server side.