AI forgets key information in long conversations and has no memory across sessions, causing context loss and an inconsistent experience. The long-term memory API automatically extracts and stores factual memories and user profiles from historical conversations in a structured way. In subsequent conversations or new sessions, these memories can be retrieved and injected into prompts, enabling the AI to achieve truly continuous understanding.
Memory (long-term memory) provides a complete set of open APIs covering the writing, searching, updating, and deletion of memory nodes, as well as profile schema management and user profile retrieval. All endpoints are served through the workspace-dedicated domain at
Memory management:
User profile:
Write a memory (AddMemory):
Search memories (SearchMemory):
All APIs combined must not exceed 3,000 QPM (per Alibaba Cloud account). The add API is limited to 120 QPM, and the search API to 300 QPM. For more information, see Rate limits.
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/. Replace {WorkspaceId} with your actual workspace ID. The endpoints use API Key authentication, and the API key must belong to the same workspace. See Authentication.
API overview
Memory management:
| API | Method | Path | Description |
|---|---|---|---|
| AddMemory | POST | /add | Add memories with automatic key information extraction |
| AddMemoryAsync | POST | /add-async | Submit a memory extraction task asynchronously |
| GetEvent | GET | /events/{event_id} | Get asynchronous task event details |
| ListMemory | GET | /memory_nodes | List memory nodes with pagination |
| SearchMemory | POST | /memory_nodes/search | Search memory nodes by similarity, factual memories only by default |
| GetMemoryNode | GET | /memory_nodes/{memory_node_id} | Get a memory node |
| GetSkillExport | GET | /skill/export/{memory_node_id} | Export a skill memory node |
| UpdateMemory | PATCH | /memory_nodes/{memory_node_id} | Update the content of a memory node |
| DeleteMemory | DELETE | /memory_nodes/{memory_node_id} | Delete a memory node |
| API | Method | Path | Description |
|---|---|---|---|
| CreateProfileSchema | POST | /profile_schemas | Create a profile schema |
| ListProfileSchemas | GET | /profile_schemas | List profile schemas |
| GetProfileSchema | GET | /profile_schemas/{profile_schema_id} | Get profile schema details |
| UpdateProfileSchema | PATCH | /profile_schemas/{profile_schema_id} | Update a profile schema |
| GetUserProfile | GET | /profile_schemas/{profile_schema_id}/user_profile | Get a user profile |