Memary

The Open Source Memory Layer For Autonomous Agents

open-sourcememory-knowledge
2.6k
Stars
+-23
Stars/month
0
Releases (6m)

Star Growth

2.5k2.6k2.6kMar 27Apr 1

Overview

Memary是一个开源的内存层框架,专为自主AI智能体设计,模拟人类记忆机制来提升智能体的推理能力。该工具允许AI智能体在多次会话中保持持久记忆,就像人类处理任务时依赖记忆一样。Memary支持本地模型(通过Ollama运行Llama 3等)和云端模型(如GPT-3.5),提供灵活的模型切换能力。它集成了多种数据库(Neo4J、FalkorDB)来存储记忆数据,并支持视觉模型(LLaVA、GPT-4 Vision)处理多模态输入。这个框架对于构建需要长期上下文理解和人类级别推理能力的AI应用至关重要,特别是在需要跨会话保持状态的复杂任务场景中。

Deep Analysis

Key Differentiator

vs LangChain Memory / Mem0: graph-database-backed memory system emulating human memory (breadth + depth tracking) — agents automatically build and query knowledge graphs rather than flat conversation history

Capabilities

  • Human-like memory system for AI agents (auto-generated memory)
  • Memory Stream tracking entity exposure breadth over time
  • Entity Knowledge Store monitoring reference frequency and recency
  • Graph database integration for contextual knowledge storage
  • Recursive retrieval with multi-hop reasoning (max depth 2)
  • ReAct agent framework with tool ecosystem (search, vision, location, stocks)
  • Automatic response injection back into knowledge graphs

🔗 Integrations

FalkorDBNeo4jOllama (Llama 3)OpenAI (GPT-3.5/GPT-4)Perplexity AIGoogle MapsAlpha VantageLlamaIndex

Best For

  • Building persistent, context-aware AI agents with evolving memory
  • User preference tracking and personalization across sessions
  • Multi-user agent management with separate knowledge contexts

Not Ideal For

  • Stateless single-turn chatbot applications
  • Teams without graph database infrastructure
  • Production agents requiring mature, battle-tested memory

Languages

Python

Deployment

pip installDocker/Ollama for local modelsStreamlit web interface

Known Limitations

  • Python version constraint (<= 3.11.9)
  • ReAct agent is demo-only — future versions will support external agents
  • Memory rewinding feature not yet implemented
  • Requires graph database setup (FalkorDB or Neo4j)

Pros

  • + 开源透明的记忆管理系统,允许完全自定义和扩展记忆机制
  • + 同时支持本地模型(Ollama)和云端模型(OpenAI),提供灵活的部署选择
  • + 内置模型切换功能,可以无缝在不同AI提供商之间切换而无需重写代码

Cons

  • - 严格的Python版本限制(<=3.11.9),可能与较新的开发环境不兼容
  • - 复杂的初始配置,需要设置多个API密钥和数据库连接
  • - 依赖特定的模型框架和外部服务,增加了系统的复杂性和维护成本

Use Cases

  • 构建需要跨会话保持记忆的AI客服或助手系统,提供个性化的用户体验
  • 开发具有长期学习能力的自主AI智能体,用于复杂的决策和规划任务
  • 创建多轮对话AI应用,如教育助手或咨询系统,需要记住历史交互内容

Getting Started

1. 使用Python 3.11.9或更低版本创建虚拟环境,然后运行pip install memary安装包。2. 创建.env文件配置所需的API密钥(OpenAI、Perplexity、Google Maps等)和数据库连接(Neo4J或FalkorDB)。3. 选择并配置AI模型(本地Ollama模型或云端模型),然后开始构建具有记忆功能的智能体应用。

Compare Memary