Memary
memary is a Python package that emulates human memory to enhance AI agents. It integrates memory modules and knowledge graphs into existing agents, automatically updating memory as agents interact. It is for developers building AI agents who want to improve their agents' reasoning and personalization.
🎬 memary: Open-Source Longterm Memory for Autonomous Agents · julian saks
✨ Key features
- Auto-generated memory updates as agents interact
- Memory modules track user preferences and knowledge depth
- Knowledge graph with recursive and multi-hop retrieval
- Supports local models via Ollama or OpenAI GPT
- Easy switching between downloaded models
- Multi-graph support for multiple agents with FalkorDB
🎯 Use cases
- Build personal agents that remember user preferences over time
- Enhance existing agents with memory and knowledge graph capabilities
- Create agents that can answer queries using a knowledge graph
- Track and analyze user interactions and interests
- Develop agents with tools like search, vision, location, and stocks
📦 Installation
🧰 Requirements: Python <= 3.11.9, optionally Ollama for local models, API keys for OpenAI, Perplexity, Google Maps, Alpha Vantage, and a graph database (FalkorDB or Neo4j).
pip install memary
For local installation:
pip install -r requirements.txt
🚀 Usage
from memary.agent.chat_agent import ChatAgent
system_persona_txt = "data/system_persona.txt"
user_persona_txt = "data/user_persona.txt"
past_chat_json = "data/past_chat.json"
memory_stream_json = "data/memory_stream.json"
entity_knowledge_store_json = "data/entity_knowledge_store.json"
chat_agent = ChatAgent(
"Personal Agent",
memory_stream_json,
entity_knowledge_store_json,
system_persona_txt,
user_persona_txt,
past_chat_json,
)
⚠️ Good to know
The current ReAct agent is for demo purposes and will be removed in future versions to support any agent type; also, the README notes that some features like 'Rewind Memories' are coming soon.
❓ FAQ
What Python version is required?
You need Python version <= 3.11.9.
Can I use OpenAI models instead of local ones?
Yes, memary supports gpt-3.5-turbo for LLM and gpt-4-vision-preview for vision, but it defaults to local models via Ollama unless specified.
How do I add custom tools to the agent?
You can add a custom tool by defining a function and calling chat_agent.add_tool({"tool_name": function}).
What databases are supported for knowledge graphs?
memary supports FalkorDB and Neo4j as graph databases, with configuration via environment variables.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.