[{"data":1,"prerenderedAt":1093},["ShallowReactive",2],{"/open_source/modules/memories/overview":3,"surround-/open_source/modules/memories/overview":1077},{"id":4,"title":5,"avatar":6,"banner":6,"body":7,"category":6,"desc":1070,"description":13,"extension":1071,"links":6,"meta":1072,"navigation":6,"path":1073,"seo":1074,"stem":1075,"__hash__":1076},"docs/en/open_source/modules/memories/overview.md","Memory Modules Overview",null,{"type":8,"value":9,"toc":1048},"minimark",[10,14,19,90,93,97,102,105,110,161,165,208,212,258,262,320,322,326,329,333,382,386,431,433,437,440,444,476,480,502,506,528,530,534,702,704,708,712,720,825,829,835,846,850,856,867,871,877,888,892,898,909,911,915,919,922,936,943,947,950,961,966,968,972,999,1001,1005,1033,1035,1044],[11,12,13],"p",{},"The Memory Module provides Agents with essential long-term memory capabilities. Instead of acting as a static database, it mimics human cognitive processes by automatically extracting, organizing, and linking information. Choosing different memory modules allows you to customize and enhance your Agent's skills.",[15,16,18],"h2",{"id":17},"quick-selection-guide","🎯 Quick Selection Guide",[20,21,23,30],"alert",{"type":22},"info",[11,24,25,29],{},[26,27,28],"strong",{},"Not sure which to choose?"," Follow this decision tree:",[31,32,33,46,57,68,79],"ul",{},[34,35,36,37,40,41],"li",{},"🚀 ",[26,38,39],{},"Quick testing/demo",": Get started easily with no additional software → ",[42,43,45],"a",{"href":44},"#naivetextmemory-simple-textual-memory","NaiveTextMemory",[34,47,48,49,52,53],{},"📝 ",[26,50,51],{},"General text memory",": Retain chat history or massive documents with semantic search capabilities → ",[42,54,56],{"href":55},"#generaltextmemory-general-purpose-textual-memory","GeneralTextMemory",[34,58,59,60,63,64],{},"👤 ",[26,61,62],{},"User preference management","：Specifically designed for building and managing user profiles → ",[42,65,67],{"href":66},"#preferencetextmemory-preference-memory","PreferenceTextMemory",[34,69,70,71,74,75],{},"🌳 ",[26,72,73],{},"Structured knowledge graph",": Ideal for data with complex logical relationships and interconnections → ",[42,76,78],{"href":77},"#treetextmemory-hierarchical-structured-memory","TreeTextMemory",[34,80,81,82,85,86],{},"⚡ ",[26,83,84],{},"Inference acceleration",": Optimized for high-traffic scenarios to ensure stable and rapid responses → ",[42,87,89],{"href":88},"#kvcachememory-activation-memory","KVCacheMemory",[91,92],"hr",{},[15,94,96],{"id":95},"memory-module-categories","📚 Memory Module Categories",[98,99,101],"h3",{"id":100},"i-textual-memory-series","I. Textual Memory Series",[11,103,104],{},"Focused on storing and retrieving text-based memories, suitable for most application scenarios.",[106,107,109],"h4",{"id":108},"naivetextmemory-simple-textual-memory","NaiveTextMemory: Simple Textual Memory",[111,112,113,119,124,138,143,154],"card",{},[11,114,115,118],{},[26,116,117],{},"Use Cases:"," Rapid prototyping, demos, teaching, small-scale applications",[11,120,121],{},[26,122,123],{},"Core Features:",[31,125,126,129,132,135],{},[34,127,128],{},"✅ Zero dependencies, pure in-memory storage",[34,130,131],{},"✅ Keyword-based retrieval",[34,133,134],{},"✅ Minimal API, get started in 5 minutes",[34,136,137],{},"✅ File persistence support",[11,139,140],{},[26,141,142],{},"Limitations:",[31,144,145,148,151],{},[34,146,147],{},"❌ No vector semantic search",[34,149,150],{},"❌ Not suitable for large-scale data",[34,152,153],{},"❌ Limited retrieval precision",[11,155,156,157],{},"📖 ",[42,158,160],{"href":159},"./naive_textual_memory","View Documentation",[106,162,164],{"id":163},"generaltextmemory-general-purpose-textual-memory","GeneralTextMemory: General-Purpose Textual Memory",[111,166,167,172,176,190,195,203],{},[11,168,169,171],{},[26,170,117],{}," Conversational agents, personal assistants, knowledge management systems",[11,173,174],{},[26,175,123],{},[31,177,178,181,184,187],{},[34,179,180],{},"✅ Vector-based semantic search",[34,182,183],{},"✅ Rich metadata support (type, time, source, etc.)",[34,185,186],{},"✅ Flexible filtering and querying",[34,188,189],{},"✅ Suitable for medium to large-scale applications",[11,191,192],{},[26,193,194],{},"Technical Requirements:",[31,196,197,200],{},[34,198,199],{},"Requires vector database (Qdrant, etc.)",[34,201,202],{},"Requires embedding model",[11,204,156,205],{},[42,206,160],{"href":207},"./general_textual_memory",[106,209,211],{"id":210},"preferencetextmemory-preference-memory","PreferenceTextMemory: Preference Memory",[111,213,214,219,223,237,242,253],{},[11,215,216,218],{},[26,217,117],{}," Personalized recommendations, user profiling, intelligent assistants",[11,220,221],{},[26,222,123],{},[31,224,225,228,231,234],{},[34,226,227],{},"✅ Automatic detection of explicit and implicit preferences",[34,229,230],{},"✅ Preference deduplication and conflict detection",[34,232,233],{},"✅ Filter by preference type and strength",[34,235,236],{},"✅ Vector semantic retrieval",[11,238,239],{},[26,240,241],{},"Specialized Functions:",[31,243,244,247,250],{},[34,245,246],{},"Dual preference extraction (explicit/implicit)",[34,248,249],{},"Preference strength scoring",[34,251,252],{},"Temporal decay support",[11,254,156,255],{},[42,256,160],{"href":257},"./preference_textual_memory",[106,259,261],{"id":260},"treetextmemory-hierarchical-structured-memory","TreeTextMemory: Hierarchical Structured Memory",[111,263,264,269,273,287,292,303,307,315],{},[11,265,266,268],{},[26,267,117],{}," Knowledge graphs, complex relationship reasoning, multi-hop queries",[11,270,271],{},[26,272,123],{},[31,274,275,278,281,284],{},[34,276,277],{},"✅ Graph database-based structured storage",[34,279,280],{},"✅ Support for hierarchical relationships and causal chains",[34,282,283],{},"✅ Multi-hop reasoning capabilities",[34,285,286],{},"✅ Deduplication, conflict detection, memory scheduling",[11,288,289],{},[26,290,291],{},"Advanced Features:",[31,293,294,297,300],{},[34,295,296],{},"Supports MultiModal Reader (images, URLs, files)",[34,298,299],{},"Supports Internet Retrieval (BochaAI, Google, Bing)",[34,301,302],{},"Working memory replacement mechanism",[11,304,305],{},[26,306,194],{},[31,308,309,312],{},[34,310,311],{},"Requires graph database (Neo4j, etc.)",[34,313,314],{},"Requires vector database and embedding model",[11,316,156,317],{},[42,318,160],{"href":319},"./tree_textual_memory",[91,321],{},[98,323,325],{"id":324},"ii-specialized-memory-modules","II. Specialized Memory Modules",[11,327,328],{},"Memory systems optimized for specific scenarios.",[106,330,332],{"id":331},"kvcachememory-activation-memory","KVCacheMemory: Activation Memory",[111,334,335,340,344,355,360,371,377],{},[11,336,337,339],{},[26,338,117],{}," LLM inference acceleration, high-frequency background knowledge reuse",[11,341,342],{},[26,343,123],{},[31,345,346,349,352],{},[34,347,348],{},"⚡ Pre-computed KV Cache, skip repeated encoding",[34,350,351],{},"⚡ Significantly reduce prefill phase computation",[34,353,354],{},"⚡ Suitable for high-throughput scenarios",[11,356,357],{},[26,358,359],{},"Typical Use Cases:",[31,361,362,365,368],{},[34,363,364],{},"FAQ caching",[34,366,367],{},"Conversation history reuse",[34,369,370],{},"Domain knowledge preloading",[11,372,373,376],{},[26,374,375],{},"How It Works:","\nStable text memory → Pre-convert to KV Cache → Direct injection during inference",[11,378,156,379],{},[42,380,160],{"href":381},"./kv_cache_memory",[106,383,385],{"id":384},"parametricmemory-parametric-memory","ParametricMemory: Parametric Memory",[111,387,388,394,399,410,415,426],{},[11,389,390,393],{},[26,391,392],{},"Status:"," 🚧 Under Development",[11,395,396],{},[26,397,398],{},"Design Goals:",[31,400,401,404,407],{},[34,402,403],{},"Encode knowledge into model weights (LoRA, expert modules)",[34,405,406],{},"Dynamically load/unload capability modules",[34,408,409],{},"Support multi-task, multi-role architecture",[11,411,412],{},[26,413,414],{},"Future Features:",[31,416,417,420,423],{},[34,418,419],{},"Parameter module generation and compression",[34,421,422],{},"Version control and rollback",[34,424,425],{},"Hot-swappable capability modules",[11,427,156,428],{},[42,429,160],{"href":430},"./parametric_memory",[91,432],{},[98,434,436],{"id":435},"iii-graph-database-backends","III. Graph Database Backends",[11,438,439],{},"Provide graph storage capabilities for TreeTextMemory.",[106,441,443],{"id":442},"neo4j-graph-db","Neo4j Graph DB",[111,445,446,452,457,471],{},[11,447,448,451],{},[26,449,450],{},"Recommendation:"," ⭐⭐⭐⭐⭐",[11,453,454],{},[26,455,456],{},"Features:",[31,458,459,462,465,468],{},[34,460,461],{},"Complete graph database functionality",[34,463,464],{},"Support for vector-enhanced retrieval",[34,466,467],{},"Multi-tenant architecture (v0.2.1+)",[34,469,470],{},"Compatible with Community Edition",[11,472,156,473],{},[42,474,160],{"href":475},"./neo4j_graph_db",[106,477,479],{"id":478},"nebula-graph-db","Nebula Graph DB",[111,481,482,486,497],{},[11,483,484],{},[26,485,456],{},[31,487,488,491,494],{},[34,489,490],{},"Distributed graph database",[34,492,493],{},"High availability",[34,495,496],{},"Suitable for large-scale deployment",[11,498,156,499],{},[42,500,160],{"href":501},"./nebula_graph_db",[106,503,505],{"id":504},"polardb-graph-db","PolarDB Graph DB",[111,507,508,512,523],{},[11,509,510],{},[26,511,456],{},[31,513,514,517,520],{},[34,515,516],{},"Alibaba Cloud PolarDB graph computing",[34,518,519],{},"Cloud-native architecture",[34,521,522],{},"Enterprise-grade reliability",[11,524,156,525],{},[42,526,160],{"href":527},"./polardb_graph_db",[91,529],{},[15,531,533],{"id":532},"feature-comparison-table","📊 Feature Comparison Table",[535,536,537,562],"table",{},[538,539,540],"thead",{},[541,542,543,547,550,553,556,559],"tr",{},[544,545,546],"th",{},"Feature",[544,548,549],{},"Naive",[544,551,552],{},"General",[544,554,555],{},"Preference",[544,557,558],{},"Tree",[544,560,561],{},"KVCache",[563,564,565,587,608,627,644,664,684],"tbody",{},[541,566,567,573,576,579,581,584],{},[568,569,570],"td",{},[26,571,572],{},"Search Method",[568,574,575],{},"Keyword",[568,577,578],{},"Vector Semantic",[568,580,578],{},[568,582,583],{},"Vector+Graph",[568,585,586],{},"N/A",[541,588,589,594,597,600,602,605],{},[568,590,591],{},[26,592,593],{},"Metadata Support",[568,595,596],{},"⭐",[568,598,599],{},"⭐⭐⭐",[568,601,599],{},[568,603,604],{},"⭐⭐⭐⭐",[568,606,607],{},"-",[541,609,610,615,618,620,622,625],{},[568,611,612],{},[26,613,614],{},"Relationship Reasoning",[568,616,617],{},"❌",[568,619,617],{},[568,621,617],{},[568,623,624],{},"✅",[568,626,607],{},[541,628,629,634,636,638,640,642],{},[568,630,631],{},[26,632,633],{},"Deduplication",[568,635,617],{},[568,637,596],{},[568,639,599],{},[568,641,604],{},[568,643,607],{},[541,645,646,651,654,657,659,662],{},[568,647,648],{},[26,649,650],{},"Scalability",[568,652,653],{},"Small",[568,655,656],{},"Medium-Large",[568,658,656],{},[568,660,661],{},"Large",[568,663,607],{},[541,665,666,671,674,677,679,682],{},[568,667,668],{},[26,669,670],{},"Deployment Complexity",[568,672,673],{},"Minimal",[568,675,676],{},"Medium",[568,678,676],{},[568,680,681],{},"Higher",[568,683,676],{},[541,685,686,691,693,695,697,699],{},[568,687,688],{},[26,689,690],{},"Inference Acceleration",[568,692,607],{},[568,694,607],{},[568,696,607],{},[568,698,607],{},[568,700,701],{},"⭐⭐⭐⭐⭐",[91,703],{},[15,705,707],{"id":706},"️-usage-scenario-recommendations","🛠️ Usage Scenario Recommendations",[98,709,711],{"id":710},"scenario-1-rapid-prototyping","Scenario 1: Rapid Prototyping",[11,713,714,717,718],{},[26,715,716],{},"Recommended:"," ",[42,719,45],{"href":159},[721,722,727],"pre",{"className":723,"code":724,"language":725,"meta":726,"style":726},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from memos.memories import NaiveTextMemory\nmemory = NaiveTextMemory()\nmemory.add(\"User likes coffee\")\nresults = memory.search(\"coffee\")\n","python","",[728,729,730,756,772,798],"code",{"__ignoreMap":726},[731,732,735,739,743,747,750,753],"span",{"class":733,"line":734},"line",1,[731,736,738],{"class":737},"s7zQu","from",[731,740,742],{"class":741},"sTEyZ"," memos",[731,744,746],{"class":745},"sMK4o",".",[731,748,749],{"class":741},"memories ",[731,751,752],{"class":737},"import",[731,754,755],{"class":741}," NaiveTextMemory\n",[731,757,759,762,765,769],{"class":733,"line":758},2,[731,760,761],{"class":741},"memory ",[731,763,764],{"class":745},"=",[731,766,768],{"class":767},"s2Zo4"," NaiveTextMemory",[731,770,771],{"class":745},"()\n",[731,773,775,778,780,783,786,789,793,795],{"class":733,"line":774},3,[731,776,777],{"class":741},"memory",[731,779,746],{"class":745},[731,781,782],{"class":767},"add",[731,784,785],{"class":745},"(",[731,787,788],{"class":745},"\"",[731,790,792],{"class":791},"sfazB","User likes coffee",[731,794,788],{"class":745},[731,796,797],{"class":745},")\n",[731,799,801,804,806,809,811,814,816,818,821,823],{"class":733,"line":800},4,[731,802,803],{"class":741},"results ",[731,805,764],{"class":745},[731,807,808],{"class":741}," memory",[731,810,746],{"class":745},[731,812,813],{"class":767},"search",[731,815,785],{"class":745},[731,817,788],{"class":745},[731,819,820],{"class":791},"coffee",[731,822,788],{"class":745},[731,824,797],{"class":745},[98,826,828],{"id":827},"scenario-2-chatbot-memory","Scenario 2: Chatbot Memory",[11,830,831,717,833],{},[26,832,716],{},[42,834,56],{"href":207},[31,836,837,840,843],{},[34,838,839],{},"Supports semantic search",[34,841,842],{},"Filter by time, type, source",[34,844,845],{},"Suitable for conversation history management",[98,847,849],{"id":848},"scenario-3-personalized-recommendation-system","Scenario 3: Personalized Recommendation System",[11,851,852,717,854],{},[26,853,716],{},[42,855,67],{"href":257},[31,857,858,861,864],{},[34,859,860],{},"Automatic user preference extraction",[34,862,863],{},"Preference conflict detection",[34,865,866],{},"Strength scoring and filtering",[98,868,870],{"id":869},"scenario-4-knowledge-graph-applications","Scenario 4: Knowledge Graph Applications",[11,872,873,717,875],{},[26,874,716],{},[42,876,78],{"href":319},[31,878,879,882,885],{},[34,880,881],{},"Multi-hop relationship queries",[34,883,884],{},"Hierarchical structure management",[34,886,887],{},"Complex reasoning scenarios",[98,889,891],{"id":890},"scenario-5-high-performance-llm-services","Scenario 5: High-Performance LLM Services",[11,893,894,717,896],{},[26,895,716],{},[42,897,89],{"href":381},[31,899,900,903,906],{},[34,901,902],{},"FAQ systems",[34,904,905],{},"Customer service bots",[34,907,908],{},"High-volume request processing",[91,910],{},[15,912,914],{"id":913},"advanced-features","🔗 Advanced Features",[98,916,918],{"id":917},"multimodal-reader-multimodal-reading","MultiModal Reader (Multimodal Reading)",[11,920,921],{},"Supported in TreeTextMemory for processing:",[31,923,924,927,930,933],{},[34,925,926],{},"📷 Images in conversations",[34,928,929],{},"🌐 Web URLs",[34,931,932],{},"📄 Local files (PDF, DOCX, TXT, Markdown)",[34,934,935],{},"🔀 Mixed mode (text+images+URLs)",[11,937,938,939],{},"👉 ",[42,940,942],{"href":941},"./tree_textual_memory#using-multimodalstructmemreader-advanced","View Examples",[98,944,946],{"id":945},"internet-retrieval","Internet Retrieval",[11,948,949],{},"Fetch real-time information from the web and add to memory:",[31,951,952,955,958],{},[34,953,954],{},"🔍 BochaAI search",[34,956,957],{},"🌍 Google search",[34,959,960],{},"🔎 Bing search",[11,962,938,963],{},[42,964,942],{"href":965},"./tree_textual_memory#retrieve-memories-from-the-internet-optional",[91,967],{},[15,969,971],{"id":970},"quick-start","🚀 Quick Start",[973,974,975,981,987,993],"ol",{},[34,976,977,980],{},[26,978,979],{},"Choose Memory Module"," - Select the appropriate module based on the guide above",[34,982,983,986],{},[26,984,985],{},"Read Documentation"," - Click the corresponding link to view detailed documentation",[34,988,989,992],{},[26,990,991],{},"Hands-On Practice"," - Each module has complete code examples",[34,994,995,998],{},[26,996,997],{},"Production Deployment"," - Refer to the best practices section",[91,1000],{},[15,1002,1004],{"id":1003},"related-resources","📖 Related Resources",[31,1006,1007,1013,1019,1027],{},[34,1008,1009],{},[42,1010,1012],{"href":1011},"/api","API Reference",[34,1014,1015],{},[42,1016,1018],{"href":1017},"/best-practices","Best Practices Guide",[34,1020,1021],{},[42,1022,1026],{"href":1023,"rel":1024},"https://github.com/MemOS/examples",[1025],"nofollow","Example Code Repository",[34,1028,1029],{},[42,1030,1032],{"href":1031},"/faq","FAQ",[91,1034],{},[20,1036,1038],{"type":1037},"tip",[11,1039,1040,1043],{},[26,1041,1042],{},"Beginner Suggestion:"," Start with NaiveTextMemory, understand the basic concepts, then explore GeneralTextMemory and TreeTextMemory.",[1045,1046,1047],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":726,"searchDepth":758,"depth":758,"links":1049},[1050,1051,1056,1057,1064,1068,1069],{"id":17,"depth":758,"text":18},{"id":95,"depth":758,"text":96,"children":1052},[1053,1054,1055],{"id":100,"depth":774,"text":101},{"id":324,"depth":774,"text":325},{"id":435,"depth":774,"text":436},{"id":532,"depth":758,"text":533},{"id":706,"depth":758,"text":707,"children":1058},[1059,1060,1061,1062,1063],{"id":710,"depth":774,"text":711},{"id":827,"depth":774,"text":828},{"id":848,"depth":774,"text":849},{"id":869,"depth":774,"text":870},{"id":890,"depth":774,"text":891},{"id":913,"depth":758,"text":914,"children":1065},[1066,1067],{"id":917,"depth":774,"text":918},{"id":945,"depth":774,"text":946},{"id":970,"depth":758,"text":971},{"id":1003,"depth":758,"text":1004},"Complete guide to MemOS memory systems - from lightweight text memory to advanced graph structures, choose the right memory module for your needs","md",{},"/en/open_source/modules/memories/overview",{"title":5,"description":13},"en/open_source/modules/memories/overview","WdQIBo0wCdtAMdHiCHbFo9EcdMnqGqC0mDfzVTuCkm8",[1078,1086],{"title":1079,"path":1080,"stem":1081,"icon":1082,"framework":6,"module":6,"class":1083,"target":-1,"active":1084,"defaultOpen":1084,"children":-1,"description":1085},"MemFeedback","/open_source/modules/mem_feedback","open_source/modules/mem_feedback","i-ri-feedback-line",[],false,"MemFeedback enables your Agent to understand 'You remembered it wrong' and automatically correct the memory database. It is a key component for self-evolving memory.",{"title":1087,"path":1088,"stem":1089,"icon":1090,"framework":6,"module":6,"class":1091,"target":-1,"active":1084,"defaultOpen":1084,"children":-1,"description":1092},"Naive Textual Memory","/open_source/modules/memories/naive_textual_memory","open_source/modules/memories/naive_textual_memory","i-ri-file-text-line",[],"The most lightweight memory module in MemOS, designed for rapid prototyping and simple scenarios. No vector database required—quickly retrieve memories using keyword matching.",1770372088272]