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 factual memories, as well as profile schema management and user profile retrieval. All endpoints are served through the DashScope gateway at
Factual memory:
User profile:
Write a memory (AddMemory):
Search memories (SearchMemory):
All APIs combined must not exceed 3,000 QPM (per Alibaba Cloud account). The factual memory add API is limited to 120 QPM, and the search API to 300 QPM. For more information, see Rate limits.
https://dashscope.aliyuncs.com/api/v2/apps/memory/, using API Key authentication. See Authentication.
API overview
Factual memory:
| 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 memories with pagination |
| SearchMemory | POST | /memory_nodes/search | Search historical memories based on semantics |
| 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 memory content |
| DeleteMemory | DELETE | /memory_nodes/{memory_node_id} | Delete memories |
| 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 |