mirror of
https://github.com/Shubhamsaboo/awesome-llm-apps.git
synced 2026-07-15 15:03:51 -05:00
[PR #450] [MERGED] fix: rename loop variable to avoid shadowing Memory object #8210
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Shubhamsaboo/awesome-llm-apps/pull/450
Author: @awesomekoder
Created: 2/1/2026
Status: ✅ Merged
Merged: 2/1/2026
Merged by: @Shubhamsaboo
Base:
main← Head:fix/memory-variable-shadowing📝 Commits (1)
e2dc13ffix: rename loop variable to avoid shadowing Memory object📊 Changes
2 files changed (+6 additions, -6 deletions)
View changed files
📝
advanced_llm_apps/llm_apps_with_memory_tutorials/ai_travel_agent_memory/travel_agent_memory.py(+3 -3)📝
advanced_llm_apps/llm_apps_with_memory_tutorials/multi_llm_memory/multi_llm_memory.py(+3 -3)📄 Description
Summary
Fixes #449
Problem
The loop variable
memoryused to iterate over memory results was shadowing theMemoryobject from the mem0 library. This caused anAttributeError: 'dict' object has no attribute 'add'whenmemory.add()was called later in the code.Solution
Renamed the loop variable from
memorytomem, which matches the pattern already used elsewhere in the codebase (e.g., in the "View My Memory" sections).Files Changed
advanced_llm_apps/llm_apps_with_memory_tutorials/ai_travel_agent_memory/travel_agent_memory.pyadvanced_llm_apps/llm_apps_with_memory_tutorials/multi_llm_memory/multi_llm_memory.pyTesting
python -m py_compilememory.add()works after the loopThanks to @Veeksha-c for reporting this issue!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.