{"name":"Memary: The Open Source Memory Layer for Autonomous Agents","description":"Memary is an innovative open-source memory layer designed to enhance autonomous agents by emulating human memory. It integrates knowledge graphs and memory modules to provide agents with advanced capabilities for reasoning and learning. This project aims to make agents more intelligent and capable of self-improvement.","github":"https://github.com/kingjulio8238/Memary","url":"https://osrepos.com/repo/kingjulio8238-memary","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/kingjulio8238-memary","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/kingjulio8238-memary.md","json":"https://osrepos.com/repo/kingjulio8238-memary.json","topics":["agents","knowledge-graph","memory","multiagent-systems","rag","self-improvement","Jupyter Notebook","Artificial Intelligence"],"keywords":["agents","knowledge-graph","memory","multiagent-systems","rag","self-improvement","Jupyter Notebook","Artificial Intelligence"],"stars":null,"summary":"Memary is an innovative open-source memory layer designed to enhance autonomous agents by emulating human memory. It integrates knowledge graphs and memory modules to provide agents with advanced capabilities for reasoning and learning. This project aims to make agents more intelligent and capable of self-improvement.","content":"## Introduction\nMemary is an innovative open-source project that provides a sophisticated memory layer for autonomous agents. Designed to emulate human memory, Memary equips AI agents with enhanced reasoning, learning, and self-improvement capabilities. By integrating advanced concepts like knowledge graphs and memory modules, Memary offers a robust framework for managing agent memories, making them more effective and intelligent.\n\n## Installation\nGetting started with Memary is straightforward.\nTo install via pip, ensure you are running Python version <= 3.11.9, then execute:\nbash\npip install memary\n\nFor a local installation:\n1.  Create a virtual environment with Python version <= 3.11.9.\n2.  Install dependencies:\n    bash\npip install -r requirements.txt\n    \nMemary supports local models via Ollama (e.g., Llama 3, LLaVA) and also integrates with OpenAI models. You'll need to set up a `.env` file with necessary API keys for services like OpenAI, Perplexity, Google Maps, and database connections (FalkorDB or Neo4j).\n\n## Examples\nMemary provides a `ChatAgent` class for easy integration.\nBasic Usage:\npython\nfrom memary.agent.chat_agent import ChatAgent\n\nsystem_persona_txt = \"data/system_persona.txt\"\nuser_persona_txt = \"data/user_persona.txt\"\npast_chat_json = \"data/past_chat.json\"\nmemory_stream_json = \"data/memory_stream.json\"\nentity_knowledge_store_json = \"data/entity_knowledge_store.json\"\nchat_agent = ChatAgent(\n    \"Personal Agent\",\n    memory_stream_json,\n    entity_knowledge_store_json,\n    system_persona_txt,\n    user_persona_txt,\n    past_chat_json,\n)\n\nFor multi-agent scenarios using FalkorDB, you can create separate agents with unique `user_id`s:\npython\n# User A personal agent\nchat_agent_user_a = ChatAgent(\n    \"Personal Agent\",\n    memory_stream_json_user_a,\n    entity_knowledge_store_json_user_a,\n    system_persona_txt_user_a,\n    user_persona_txt_user_a,\n    past_chat_json_user_a,\n    user_id='user_a_id'\n)\n\nYou can also easily add and remove custom tools:\npython\ndef multiply(a: int, b: int) -> int:\n    \"\"\"Multiply two integers and returns the result integer\"\"\"\n    return a * b\n\nchat_agent.add_tool({\"multiply\": multiply})\nchat_agent.remove_tool(\"multiply\")\n\n\n## Why Use Memary\nMemary is built on core principles designed to enhance agent intelligence with minimal developer effort.\n*   **Auto-generated Memory**: Agent memory automatically updates as the agent interacts, capturing all memories for display and analysis. It supports combining different databases seamlessly.\n*   **Memory Modules**: Tracks user preferences and knowledge depth through the Memory Stream (breadth of knowledge) and Entity Knowledge Store (depth of knowledge), offering insights into user interests and learning.\n*   **System Improvement**: Mimics how human memory evolves and learns over time, providing metrics on agent improvement.\n*   **Rewind Memories**: Keeps track of all chats, allowing users to rewind agent executions and access memory at specific periods (feature coming soon).\n*   **Knowledge Graphs**: Utilizes graph databases to store knowledge, employing recursive and multi-hop retrieval for efficient information access and reduced latency.\n*   **New Context Window**: Tailors agent responses by integrating agent responses, most relevant entities, and summarized chat history to match the user's current interests and knowledge level.\n\n## Links\n*   [GitHub Repository](https://github.com/kingjulio8238/Memary){:target=\"_blank\"}\n*   [Documentation](https://kingjulio8238.github.io/memarydocs/){:target=\"_blank\"}\n*   [Demo Video](https://youtu.be/GnUU3_xK6bg){:target=\"_blank\"}\n*   [PyPI Package](https://pypi.org/project/memary/){:target=\"_blank\"}\n*   [LinkedIn](https://www.linkedin.com/company/memary/){:target=\"_blank\"}\n*   [Follow on X](https://x.com/memary_labs){:target=\"_blank\"}","metrics":{"detailViews":7,"githubClicks":5},"dates":{"published":null,"modified":"2025-12-28T08:01:35.000Z"}}