正在自动登录…
← 返回项目列表Tencent-Hunyuan/
Tencent-Hunyuan/ Hy-Memory
Hy Memory 是一个生产级的双系统认知记忆引擎和 Python SDK,为 LLM 代理提供聊天、工作和编码三种场景的记忆管道,支持分层长期记忆、事实与经验记忆以及代码版本演化链。
AI 中文解读 · 根据仓库描述与 README 生成 · 2026/10/16 18:51:19 · 查看原文
- 累计 Stars
- 1,145
- 当前热度
- 1~7 天 · 热门
- 仓库创建时间
选用指南
AI 根据 README 整理 · 2026/10/16 18:51:19
- 使用方式
通过 Python SDK 使用,提供 add 和 search 方法,支持聊天、工作和编码场景。
查看 README 依据
client.add("I love sci-fi movies, especially Interstellar", user_id="user_1") client.add([ {"role": "user", "content": "Recommend a movie"}, {"role": "assistant", "content": "Try Interstellar — a sci-fi masterpiece by Nolan"}, ], user_id="user_1") # Search: returns the profile / normal / proactive channels results = client.search("What movies does the user like?", user_ids=["user_1"], limit=10) for mem in results["memories"]["normal"]: print(f" [{mem['score']:.2f}] {mem['content']}") client.close() ``` ### 4. Working & Coding Memory
client.add( messages, scene="coding", # or "working" user_id="user_123", workspace_id="github.com/example/service", # optional: isolate by repository / project branch="fix/search-timeout", # optional: requires workspace_id ) result = client.search( "Which timeout implementation was finally kept?", scene="coding", user_ids=["user_123"], workspace_id="github.com/example/service", branch="fix/search-timeout", limit=5, ) result["facts"] # fact layer result["experiences"] # experience layer
- 部署要求
需要配置 LLM 和嵌入端点,支持 OpenAI 兼容服务,可通过环境变量设置。
查看 README 依据
pip install "hy-memory[qdrant]==2.0.1" # + Qdrant pip install "hy-memory[faiss]==2.0.1" # + FAISS pip install "hy-memory[graph]==2.0.1" # + Neo4j pip install "hy-memory[mysql]==2.0.1" # + MySQL cache pip install "hy-memory[rerank]==2.0.1" # + local multilingual cross-encoder rerank pip install "hy-memory[all]==2.0.1" # everything ``` ### 2. Configuration Only an LLM and an embedding endpoint are needed; any OpenAI-compatible service works: ```bash export MEMORY_LLM_API_KEY="sk-your-key" export MEMORY_LLM_BASE_URL="https://api.deepseek.com"
export MEMORY_LLM_MODEL="deepseek-chat" export MEMORY_EMBEDDER_API_KEY="sk-your-key" export MEMORY_EMBEDDER_BASE_URL="https://dashscope.aliyuncs.com/compatible-mode/v1" export MEMORY_EMBEDDER_MODEL="text-embedding-v3" export MEMORY_EMBEDDING_DIMS=1024 ``` Or use the OpenAI defaults with a single key: ```bash export OPENAI_API_KEY="sk-your-key" ``` See the [Environment Variable Reference](docs/env_reference.md) for the full list. ### 3. Chat Memory ```python from hy_memory import HyMemoryClient client = HyMemoryClient(mode="pro") # Write: plain text or OpenAI-format messages
- 已知限制
工作与编码记忆写入必须包含工具调用轨迹,且仅在 pro 或 ultra 模式下生效;lite 模式忽略场景和层级。
查看 README 依据
Writes must include a tool-call trace (`tool_calls` or `role="tool"` messages) and take effect in `pro` / `ultra` mode only (`lite` ignores `scene` and stores everything as raw memory): ```python messages = [ {"role": "user", "content": "Fix the timeout in the search client."}, {"role": "assistant", "content": "", "tool_calls": [{ "id": "call_1", "type": "function", "function": {"name": "apply_patch", "arguments": '{"path":"src/search.py"}'}, }]}, {"role": "tool", "tool_call_id": "call_1", "name": "apply_patch", "content": "Patch applied successfully"}, ]
README
正在加载 README…
收录信息
- 仓库创建时间
- 2026/10/15 21:06:56
- 首次达标收录
- 2026/10/16 18:46:15
- 统计更新时间
- 2026/10/22 19:00:54
按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。
模型评估
值得看加权总分 4.1 / 5
由 Jev 模型根据仓库描述与 README 评估,2026/10/16 18:46:15 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。
仓库信息
- 最近推送
- 2026/10/22 16:51:15
- 许可证标识
- NOASSERTION
- Fork 数
- 95
- 当前状态
- 未归档
收录记录
按创建时长与累计 Stars 首次收录:小火
首次发现项目