{"record":{"id":"b8a1903b819ecfeb","repo":"infiniflow/ragflow","slug":"404-b8a190","errorCode":"404","errorMessage":"Memory '{memory_id}' not found.","messagePattern":"Memory '(.+?)' not found\\.","errorType":"http","errorClass":"NotFoundException","httpStatus":200,"severity":"error","filePath":"api/apps/services/memory_api_service.py","lineNumber":297,"sourceCode":"        filter_dict[\"tenant_id\"] = [tenant_id for tenant_id in tenant_ids if tenant_id in allowed_tenant_ids]\n        if not filter_dict[\"tenant_id\"]:\n            return {\"memory_list\": [], \"total_count\": 0}\n    else:\n        filter_dict[\"tenant_id\"] = list(allowed_tenant_ids)\n    memory_types = _split_filter_values(filter_params.get(\"memory_type\"))\n    filter_dict[\"memory_type\"] = memory_types\n\n    memory_list, count = MemoryService.get_by_filter(filter_dict, keywords, page, page_size)\n    embd_name_map = get_composite_model_name_by_ids([memory[\"embd_id\"] for memory in memory_list])\n    [memory.update({\"memory_type\": get_memory_type_human(memory[\"memory_type\"]), \"embd_name\": embd_name_map.get(memory[\"embd_id\"], \"\")}) for memory in memory_list]\n    memory_list.sort(key=lambda m: m[\"create_time\"], reverse=True)\n    return {\"memory_list\": memory_list, \"total_count\": count}\n\n\nasync def get_memory_config(memory_id):\n    memory = MemoryService.get_with_owner_name_by_id(memory_id)\n    if not memory or not _memory_accessible(memory):\n        raise NotFoundException(f\"Memory '{memory_id}' not found.\")\n    return format_ret_data_from_memory(memory)\n\n\nasync def get_memory_messages(memory_id, agent_ids: list[str], keywords: str, page: int = 1, page_size: int = 50):\n    memory = _require_memory_access(memory_id)\n    messages = MessageService.list_message(memory.tenant_id, memory_id, agent_ids, keywords, page, page_size)\n    agent_name_mapping = {}\n    extract_task_mapping = {}\n    if messages[\"message_list\"]:\n        agent_list = UserCanvasService.get_basic_info_by_canvas_ids([message[\"agent_id\"] for message in messages[\"message_list\"]])\n        agent_name_mapping = {agent[\"id\"]: agent[\"title\"] for agent in agent_list}\n        task_list = TaskService.get_tasks_progress_by_doc_ids([memory_id])\n        if task_list:\n            task_list.sort(key=lambda t: t[\"create_time\"])  # asc, use newer when exist more than one task\n            for task in task_list:\n                # the 'digest' field carries the source_id when a task is created, so use 'digest' as key\n                extract_task_mapping.update({int(task[\"digest\"]): task})\n    for message in messages[\"message_list\"]:","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/apps/services/memory_api_service.py#L279-L315","documentation":"Error \"Memory '{memory_id}' not found.\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at api/apps/services/memory_api_service.py:297 when the library encounters an invalid state.","commonSituations":"The request references a memory id that does not exist or was deleted; confirming the id beforehand prevents this error.","solutions":["Verify the memory_id exists before the operation.","List memories and use a valid id; the record may have been deleted."],"exampleFix":"mem = MemoryService.get_by_id(memory_id)\nif not mem:\n    raise ValueError(f\"Memory '{memory_id}' not found.\")","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}