Memary: Add Memory and Knowledge Graphs to AI Agents

Summary
Memary is a memory layer for autonomous agents that combines a knowledge graph with user-focused memory to inform responses over time. It suits developers building personalized agents who can manage local models, database connections, and API credentials.
At a glance
- Language
- Jupyter Notebook
- License
- MIT
- Stars
- 2.7k
- Forks
- 206
- Added to OSRepos
- December 28, 2025
- Last analyzed
- October 3, 2026
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Overview
Memary is a Python-based memory layer for autonomous agents. It stores knowledge in a graph and tracks entities across interactions, giving an agent context about what a user has discussed and how often or recently topics appear. Its goal is to make agent responses more personalized without requiring developers to build these memory mechanisms from scratch.
The repository includes a ReAct-based chat agent and integrations for graph databases, model providers, and tools. Developers can use that agent directly or treat the project as a starting point for adding persistent memory and knowledge-graph retrieval to an agent workflow.
Key Features
- Stores and retrieves entity relationships using a knowledge graph, with FalkorDB and Neo4j listed as database options.
- Tracks a memory stream of encountered entities and an entity store with reference frequency and recency.
- Uses recursive and multi-hop retrieval to assemble relevant graph context for queries.
- Falls back to external search when a query is not found in the graph.
- Summarizes earlier chat history to reduce context-window pressure.
- Supports local Ollama models as well as specified OpenAI models for language and vision tasks.
- Offers default tools for search, vision, location, and stock queries, with support for adding or removing custom tools.
- Supports separate agent contexts through user IDs and, with FalkorDB, multiple graphs.
Use Cases
- Build a personal assistant that adapts responses based on a user's interests and prior conversations.
- Add graph-backed retrieval to an agent that needs to connect entities across multiple facts or interactions.
- Prototype multi-user agents with distinct memory and knowledge contexts.
- Extend the included ReAct agent with custom tools while keeping memory and retrieval in the same application.
Project Facts
- Language: Jupyter Notebook
- License: MIT
- Stars: 2.7k
- Forks: 206
- Topics: agents, knowledge-graph, memory, multiagent-systems, rag, self-improvement
- Archived: No
Getting Started
Install from PyPI with pip install memary. The README specifies Python version <= 3.11.9. Running the included Streamlit app also requires configuring relevant model, database, and tool API credentials. See the README and documentation for setup details.
Alternatives
- Cognithor: Cognithor is a local-first autonomous agent system with six-tier cognitive memory, while Memary provides a memory layer for developers building agents.
Considerations
- The README specifies Python version <= 3.11.9, so newer Python versions may not be supported.
- A working setup may need credentials for model providers, graph databases, and optional tools such as Google Maps or external search.
- The included application uses a ReAct agent, and the README describes it as a demo-oriented implementation intended to be replaced in future versions. Treat it as an integration starting point rather than assuming provider-independent agent support is already available.
- Memory is stored through graph databases or local JSON files, so deployment choices affect persistence and multi-agent setup.
Source repository
Open the original repository on GitHub.
18 counted GitHub visits
Related repositories
Similar repositories that may be relevant next.

agent-observability: Self-Hosted Observability for AI Coding Agents
October 3, 2026
agent-observability offers a robust, self-hosted OpenTelemetry stack designed for AI coding agents like Claude Code and OpenAI Codex. It ensures all telemetry data, including model requests, tool executions, and session activity, remains local within your environment. This comprehensive solution provides ready-made Grafana dashboards for deep insights into agent performance and usage.

OrcaReplay: Time Travel for AI Agents, Debugging and Evaluation
October 2, 2026
OrcaReplay introduces "time travel" capabilities for AI agents, allowing developers to record, replay, fork, and debug any agent run with any model. It addresses the challenges of AI agent debugging by providing byte-for-byte reproducibility, offline analysis, and the ability to compare different models from specific checkpoints. This tool, built by the OrcaRouter.ai team, enhances observability and control over complex agent behaviors.

Prime Agent: A Self-Improving RLM Agent for Coding and Autonomous Tasks
October 2, 2026
Prime Agent is an open-source, self-improving Recursive Language Model (RLM) agent designed for coding workflows and long-running autonomous tasks. It integrates a persistent Python control environment with a durable harness state, allowing useful context and reusable patterns to persist across sessions. Built in Rust, this project aims to enhance developer productivity through programmatic control and autonomous capabilities.

OpenMake LLM: Self-Hosted AI Workspace for Local and Open-Weight LLMs
October 1, 2026
OpenMake LLM is an open-source, self-hosted AI workspace for local and open-weight LLMs. It coordinates specialized models, autonomous agents, and tools for deep research and artifact generation. This platform supports vLLM, LiteLLM, and BYOK providers, offering a robust environment for managing AI workloads.