# memary

> Open-source persistent memory layer for autonomous AI agents using knowledge graphs

memary is a Python library that equips LLM agents with long-term, human-like memory using knowledge graphs. It tracks user interactions through a Memory Stream and an Entity Knowledge Store, ranking concepts by frequency and recency. By recursively querying and updating graph stores like Neo4j or FalkorDB, it lets agents retain context across sessions.

Website: https://github.com/kingjulio8238/Memary

## What it is for

- Equip autonomous LLM agents with persistent multi-session memory
- Track user preferences and entity depth over time using knowledge graphs
- Reduce context token overhead through automated memory summarization and graph retrieval
- Build multi-user personal assistants using distinct knowledge graph instances

## Features

- Memory Stream to track exposure to concepts with timestamps
- Entity Knowledge Store ranking concepts by frequency and recency
- Graph database integration supporting FalkorDB and Neo4j
- Multi-hop and recursive subgraph retrieval to keep query latency low
- Local model execution support via Ollama alongside OpenAI endpoints
- Built-in conversation history summarization to manage context windows
- Streamlit dashboard for visualizing agent interactions and personas
- ReAct agent architecture with extensible custom tools

## Pricing

Open source

## Details

- Type: GitHub repo
- Category: [AI](https://xiry.app/topics/ai.md)
- Topic: [Agent Frameworks](https://xiry.app/topics/ai/agent-frameworks.md)
- Open source: yes
- Platforms: Code library, Linux, macOS, Windows
- For: Python developers and AI engineers building stateful LLM agents
- Alternative to: MemGPT, Letta, Zep
- Tags: agents, memory, knowledge graph, llm, rag, python

## Why it was saved

- [@Saboo_Shubham_, 29 December 2024](https://x.com/Saboo_Shubham_/status/1873209080074125786): A drop-in few-lines-of-Python component for adding long-term memory to LLM agent projects.

## Related

- [smolagents](https://xiry.app/resources/smolagents): Lightweight open-source Python library for building code-writing and vision AI agents (Web app, Open source)
- [ai-hedge-fund](https://xiry.app/resources/ai-hedge-fund): Proof-of-concept AI multi-agent trading system with paper trading and backtesting. (GitHub repo, Open source)
- [Eliza](https://xiry.app/resources/eliza): Open-source multi-agent framework for building autonomous social and on-chain AI agents (GitHub repo, Open source)
- [Self-Improving Agent Loop via skill.md](https://xiry.app/resources/self-improving-agent-loop-via-skill-md): A workflow pattern where agents document completed tasks into reusable shortcuts (Tip, Free)
- [phidata](https://xiry.app/resources/phidata): Python framework for building multi-modal AI agents with memory and tools (GitHub repo, Open source)
- [AutoGPT](https://xiry.app/resources/autogpt): Open-source platform and framework for building autonomous AI agents (GitHub repo, Freemium)

Updated 10 October 2026. Page: https://xiry.app/resources/memary

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
