[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Growth-Kinetics--DiffMem":3,"tool-Growth-Kinetics--DiffMem":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",156804,2,"2026-04-15T11:34:33",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":76,"owner_url":77,"languages":78,"stars":87,"forks":88,"last_commit_at":89,"license":76,"difficulty_score":32,"env_os":90,"env_gpu":91,"env_ram":90,"env_deps":92,"category_tags":98,"github_topics":76,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":99,"updated_at":100,"faqs":101,"releases":102},7750,"Growth-Kinetics\u002FDiffMem","DiffMem","Git Based Memory Storage for Conversational AI Agent","DiffMem 是一款专为对话式 AI 智能体设计的轻量级记忆存储后端。它创新地利用 Git 版本控制系统来管理 AI 的长期记忆，旨在解决传统向量数据库在处理随时间演变的个人知识时容易变得臃肿、低效且难以追溯历史变化的问题。\n\n与传统方案不同，DiffMem 不使用复杂的向量嵌入或专用数据库，而是将当前记忆状态存储在人类可读的 Markdown 文件中，同时利用 Git 的提交记录自动保存所有历史变更。这种设计让 AI 既能快速读取最新的“现状”以节省上下文窗口，又能按需通过 git diff 等命令深入挖掘记忆的演变过程，实现类似人类的“线索式”回忆。其核心技术亮点在于“差分智能”，即天然支持对事实变化进行时间轴追踪，且数据纯文本化，具备极高的可移植性和耐久性。\n\n该工具非常适合希望构建具备长期记忆能力、能理解用户关系动态变化的 AI 应用的开发者及研究人员。目前，它已成功应用于生产环境，支持智能体在数千次对话中持续追踪细节并自动整合记忆。如果你正在寻找一种高效、透明且无需重型基础设施的记忆解决方案，DiffMem 提供了一个独特而优雅的选择。","# DiffMem: Git-Based Differential Memory for AI Agents\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![Python 3.11+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.11+-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Frelease\u002Fpython-3110\u002F)\n[![Prototype](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-prototype-orange.svg)](https:\u002F\u002Fgithub.com\u002Falexmrval\u002FDiffMem)\n[![Ask DeepWiki](https:\u002F\u002Fdeepwiki.com\u002Fbadge.svg)](https:\u002F\u002Fdeepwiki.com\u002FGrowth-Kinetics\u002FDiffMem)\n\nDiffMem is a lightweight, git-based memory backend designed for AI agents and conversational systems. It uses Markdown files for human-readable storage, Git for tracking temporal evolution through differentials, and a git-native retrieval agent that explores the repository via shell commands (grep, git log, git diff, git blame) to build targeted context. No vector databases, no embeddings, no BM25 -- just git and an LLM.\n\nAt its core, DiffMem treats memory as a versioned repository: the \"current state\" of knowledge is stored in editable files, while historical changes are preserved in Git's commit graph. This separation allows agents to query and search against a compact, up-to-date surface without the overhead of historical data, while enabling deep dives into evolution when needed.\n\n## Live in Production\n\nDiffMem powers [Annabelle](https:\u002F\u002Fwithanna.io\u002F), a simulated intelligence that maintains persistent memory across thousands of conversations on WhatsApp and Messenger.\n\nIn production, DiffMem enables Annabelle to:\n\n- Reference details from conversations weeks ago\n- Track the evolution of relationships over time  \n- Build structured understanding of each person she talks to\n- Consolidate memories automatically as conversations grow\n\n→ [Try a conversation with Annabelle](https:\u002F\u002Fwa.me\u002F34641376527?text=Hi%20Annabelle,%20saw%20you%20on%20Github%20%E2%80%94%20I%E2%80%99d%20like%20to%20start.%20What%20should%20I%20tell%20you%20first%3F)\n→ [See how DiffMem processes a novel chapter by chapter](https:\u002F\u002Fgithub.com\u002FGrowth-Kinetics\u002Fdiffmem_sample_memory)\n\n## Roadmap\n\n- [ ] Indexing strategy from PoC needs to be made more robust, too memory intensive without need.\n- [ ] Parametrized method for context caps on retrieval.\n- [ ] Sometimes an entity will become a catch-all and the thing will insist in overloading it.\n- [ ] Retrieval History so that we can spin up a \"linked entities\" model to support wikification\n- [ ] PDF export.\n- [ ] Research PoC: Visual retrieval for context compression.\n\n## Why Git for AI Memory?\n\nTraditional memory systems for AI agents often rely on databases, vector stores, or graph structures. These work well for certain scales but can become bloated or inefficient when dealing with long-term, evolving personal knowledge. DiffMem takes a different path by leveraging Git's strengths:\n\n- **Current-State Focus**: Memory files store only the \"now\" view of information (e.g., current relationships, facts, or timelines). This reduces the surface area for queries and searches, making operations faster and more token-efficient in LLM contexts. Historical states are not loaded by default—they live in Git's history, accessible on-demand.\n\n- **Differential Intelligence**: Git diffs and logs provide a natural way to track how memories evolve. Agents can ask \"How has this fact changed over time?\" without scanning entire histories, pulling only relevant commits. This mirrors how human memory reconstructs events from cues, not full replays.\n\n- **Durability and Portability**: Plaintext Markdown ensures memories are human-readable and tool-agnostic. Git's distributed nature means your data is backup-friendly and not locked into proprietary formats.\n\n- **Efficiency for Agents**: By separating \"surface\" (current files) from \"depth\" (git history), agents can be selective—load the now for quick responses, dive into diffs for analytical tasks. This keeps context windows lean while enabling rich temporal reasoning.\n\nThis approach shines for long-horizon AI systems where memories accumulate over years: it scales without sprawl, maintains auditability, and allows \"smart forgetting\" through pruning while preserving reconstructability.\n\n## How It Works\n\nDiffMem is structured as importable modules—no servers required. Key components:\n\n- **Writer Agent** (`writer_agent`): Analyzes conversation transcripts, identifies\u002Fcreates entities, stages updates in Git's working tree. Commits are explicit, ensuring atomic changes.\n\n- **Retrieval Agent** (`retrieval_agent`): A multi-turn LLM agent with a single `run(command=\"...\")` tool that explores the memory repository via sandboxed shell commands. It reads `index.md`, probes git history for temporal patterns, and outputs a structured retrieval plan (file sections, git diffs, commit logs) that gets resolved into context.\n\n- **API Layer** (`api.py`): Clean interface for read\u002Fwrite operations. Example:\n  ```python\n  from diffmem import DiffMemory\n\n  memory = DiffMemory(\"\u002Fpath\u002Fto\u002Frepo\", \"alex\", \"your-api-key\")\n  \n  # Get context for a conversation (agent explores git to find what's relevant)\n  context = memory.get_context(conversation, max_tokens=15000)\n  \n  # Process and commit new memory\n  memory.process_and_commit_session(\"Had coffee with mom today...\", \"session-123\")\n  ```\n\nThe repo follows a structured layout (see `repo_guide.md` for details), with current states in Markdown files and evolution in Git commits. The retrieval agent navigates this structure using the same git commands a human developer would use.\n\n## Why This Works\n\nDiffMem's git-centric design solves key challenges in AI memory systems:\n\n- **Reduced Query Surface**: Only current-state files are explored by default. The retrieval agent reads `index.md` to understand the entity landscape, then surgically loads only what's relevant. When history is needed, it pulls targeted diffs (e.g., `git diff HEAD~3 file.md`), not full archives.\n\n- **Scalable Evolution Tracking**: Git handles 50+ years of changes efficiently. Agents can reconstruct past states (`git show \u003Ccommit>:file.md`) without bloating active memory.\n\n- **Developer-Friendly**: No DB schemas or migrations—edit Markdown directly. Git provides free versioning, branching (e.g., monthly timelines), and collaboration.\n\n- **Lightweight**: Runs in-process, minimal deps (gitpython, openai). No ML models, no embeddings, no vector databases.\n\n\n## Prototype Status and Limitations\n\nWhat's working:\n- Entity creation\u002Fupdate from transcripts.\n- Git-native agent retrieval with temporal reasoning.\n- Targeted context assembly (file sections, diffs, commit logs).\n- Fallback to baseline (user entity) when agent fails.\n\nKnown limitations:\n- Agent retrieval quality depends on the LLM model used.\n- No multi-user concurrency locks.\n- Writer agent prompt tuning ongoing.\n\nWe're sharing this as open-source R&D to spark discussion. Feedback welcome!\n\n## Future Vision: Where This Could Go\n\nDiffMem points to a future where AI memory is as versioned and collaborative as code. Imagine:\n\n- **Agent-Driven Pruning**: LLMs that \"forget\" low-strength memories by archiving to git branches, mimicking neural plasticity.\n\n- **Collaborative Memories**: Multi-agent systems sharing repos, with merge requests for \"memory reconciliation.\"\n\n- **Temporal Agents**: Specialized models that query git logs to answer \"how did I change?\"—enabling self-reflective AI.\n\n- **Multi-Provider Retrieval**: Swap between OpenRouter, Cerebras, or any OpenAI-compatible provider for the retrieval agent.\n\n- **Open-Source Ecosystem**: Plugins for voice input, mobile sync, or integration with tools like Obsidian.\n\nAs AI agents become long-lived companions, git-like systems could make them evolvable without data silos. We're excited to see where the community takes this—perhaps toward distributed, privacy-first personal AIs.\n\nThis is an R&D project from Growth Kinetics, a boutique data solutions agency specializing in AI enablement. We're exploring how differential memory can power next-gen agents. We'd love collaborations, PRs, or honest feedback to improve it.\n\n## Getting Started\n\n1. Clone the repo: `git clone https:\u002F\u002Fgithub.com\u002Falexmrval\u002FDiffMem.git`\n2. Install deps: `pip install -r requirements.txt`\n3. Set env: `export OPENROUTER_API_KEY=your_key`\n4. Run examples: `python examples\u002Fusage.py`\n\nSee `examples\u002F` for full demos.\n\n## Contributing\n\nFork, experiment, PR! We're looking for:\n- Git sync optimizations.\n- Advanced search plugins.\n- Real-world integrations.\n\nIssues\u002FPRs welcome. Let's build the future of AI memory together.\n\nLicense: MIT  \nGrowth Kinetics © 2025\n","# DiffMem：基于 Git 的差分内存，专为 AI 代理设计\n\n[![许可证：MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![Python 3.11+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.11+-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Frelease\u002Fpython-3110\u002F)\n[![原型](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-prototype-orange.svg)](https:\u002F\u002Fgithub.com\u002Falexmrval\u002FDiffMem)\n[![Ask DeepWiki](https:\u002F\u002Fdeepwiki.com\u002Fbadge.svg)](https:\u002F\u002Fdeepwiki.com\u002FGrowth-Kinetics\u002FDiffMem)\n\nDiffMem 是一种轻量级、基于 Git 的内存后端，专为 AI 代理和对话系统设计。它使用 Markdown 文件进行人类可读的存储，利用 Git 通过差异追踪时间演化，并配备一个原生 Git 检索代理，该代理通过 Shell 命令（grep、git log、git diff、git blame）探索仓库，构建有针对性的上下文。无需向量数据库、无需嵌入、无需 BM25——只需 Git 和一个大语言模型。\n\n在核心理念上，DiffMem 将内存视为一个版本化的仓库：知识的“当前状态”存储在可编辑的文件中，而历史变更则保存在 Git 的提交图中。这种分离使代理能够在不引入历史数据开销的情况下，针对精简、最新的表层数据进行查询和搜索，同时在需要时深入探究其演化过程。\n\n## 已投入生产\n\nDiffMem 为 [Annabelle](https:\u002F\u002Fwithanna.io\u002F) 提供支持，这是一款模拟智能体，在 WhatsApp 和 Messenger 上持续维护着数千次对话的记忆。\n\n在生产环境中，DiffMem 使 Annabelle 能够：\n\n- 引用数周前对话中的细节\n- 长期跟踪关系的演变\n- 构建对她所交谈的每个人的结构化理解\n- 随着对话的增多自动整合记忆\n\n→ [与 Annabelle 对话体验](https:\u002F\u002Fwa.me\u002F34641376527?text=Hi%20Annabelle,%20saw%20you%20on%20Github%20%E2%80%94%20I%E2%80%99d%20like%20to%20start.%20What%20should%20I%20tell%20you%20first%3F)\n→ [查看 DiffMem 如何逐章处理新内容](https:\u002F\u002Fgithub.com\u002FGrowth-Kinetics\u002Fdiffmem_sample_memory)\n\n## 路线图\n\n- [ ] PoC 中的索引策略需要更加 robust，目前过于消耗内存且并无必要。\n- [ ] 实现检索上下文容量的参数化方法。\n- [ ] 有时某个实体会变成“万能容器”，导致过度负载。\n- [ ] 添加检索历史功能，以便构建“关联实体”模型来支持维基化。\n- [ ] PDF 导出功能。\n- [ ] 研究 PoC：用于上下文压缩的可视化检索。\n\n## 为什么选择 Git 作为 AI 内存？\n\n传统的 AI 代理内存系统通常依赖于数据库、向量存储或图结构。这些方案在特定规模下表现良好，但在处理长期、不断演化的个人知识时，可能会变得臃肿或效率低下。DiffMem 则另辟蹊径，充分利用 Git 的优势：\n\n- **聚焦当前状态**：内存文件仅存储信息的“当下”视图（例如当前的关系、事实或时间线）。这减少了查询和搜索的表面面积，使得操作更快、在 LLM 场景中更节省 token。历史状态默认不会被加载——它们存在于 Git 的历史记录中，按需访问。\n  \n- **差分智能**：Git 的差异和日志提供了一种自然的方式来追踪记忆如何演变。代理可以询问“这个事实在过去是如何变化的？”，而无需扫描整个历史，只需提取相关提交即可。这类似于人类记忆通过线索重构事件，而非完整重现。\n\n- **持久性与可移植性**：纯文本 Markdown 确保记忆对人类可读且不依赖特定工具。Git 的分布式特性意味着数据易于备份，且不会被锁定在专有格式中。\n\n- **代理的高效性**：通过将“表层”（当前文件）与“深度”（Git 历史）分离，代理可以灵活选择——快速响应时加载当前状态，分析任务时深入差异。这样既能保持上下文窗口简洁，又能实现丰富的时序推理。\n\n这种方法对于长期运行的 AI 系统尤为适用，因为这些系统的记忆会随时间积累多年；它可以在不造成数据膨胀的情况下扩展规模，同时保持可审计性，并通过修剪实现“智能遗忘”，又保留了可重构性。\n\n## 工作原理\n\nDiffMem 以可导入模块的形式组织，无需服务器。关键组件包括：\n\n- **写入代理**（`writer_agent`）：分析对话记录，识别并创建实体，在 Git 的工作树中暂存更新。提交是显式的，确保原子性更改。\n  \n- **检索代理**（`retrieval_agent`）：一个多轮 LLM 代理，仅有一个 `run(command=\"...\")` 工具，可通过沙箱化的 Shell 命令探索内存仓库。它读取 `index.md`，探测 Git 历史中的时间模式，并输出一个结构化的检索计划（文件片段、Git 差异、提交日志），最终转化为上下文。\n  \n- **API 层**（`api.py`）：用于读写操作的干净接口。示例如下：\n  ```python\n  from diffmem import DiffMemory\n\n  memory = DiffMemory(\"\u002Fpath\u002Fto\u002Frepo\", \"alex\", \"your-api-key\")\n  \n  # 获取对话上下文（代理通过 Git 探索相关部分）\n  context = memory.get_context(conversation, max_tokens=15000)\n  \n  # 处理并提交新记忆\n  memory.process_and_commit_session(\"今天和妈妈一起喝了咖啡...\", \"session-123\")\n  ```\n\n仓库遵循结构化的布局（详情请参阅 `repo_guide.md`），当前状态存储在 Markdown 文件中，而演化记录则保存在 Git 提交中。检索代理使用与开发者相同的 Git 命令来导航这一结构。\n\n## 为何有效\n\nDiffMem 的 Git 中心设计解决了 AI 内存系统中的关键挑战：\n\n- **减少查询面**：默认情况下，仅探索当前状态的文件。检索代理会读取 `index.md` 以了解实体格局，然后精准加载相关内容。当需要历史信息时，它会提取有针对性的差异（例如 `git diff HEAD~3 file.md`），而不是加载完整的档案。\n  \n- **可扩展的演化追踪**：Git 能够高效地处理超过 50 年的变化。代理可以重建过去的状态（`git show \u003Ccommit>:file.md`），而不会使活跃内存膨胀。\n  \n- **开发者友好**：无需数据库模式或迁移——直接编辑 Markdown 文件即可。Git 提供免费的版本控制、分支管理（例如每月的时间线）和协作功能。\n  \n- **轻量级**：进程内运行，依赖项极少（gitpython、openai）。无需机器学习模型、无需嵌入、无需向量数据库。\n\n\n## 原型状态与局限性\n\n已实现的功能：\n- 根据对话记录创建或更新实体。\n- 基于 Git 的原生代理检索，具备时序推理能力。\n- 针对性上下文组装（文件片段、差异、提交日志）。\n- 当代理失败时，可回退到基础用户实体。\n\n已知局限性：\n- 检索代理的质量取决于所使用的 LLM 模型。\n- 缺乏多用户并发锁机制。\n- 写入代理的提示词调优仍在进行中。\n\n我们以开源研发的形式分享此项目，旨在引发讨论。欢迎提出反馈！\n\n## 未来愿景：这项技术的发展方向\n\nDiffMem 展示了一个 AI 记忆系统如同代码一样具备版本管理和协作能力的未来。试想：\n\n- **代理驱动的修剪**：大型语言模型通过将低权重的记忆归档到 Git 分支中来“遗忘”，从而模拟神经可塑性。\n\n- **协作式记忆**：多智能体系统共享仓库，并通过合并请求实现“记忆对齐”。\n\n- **时序代理**：专门的模型可以查询 Git 日志，回答“我是如何变化的？”——从而实现 AI 的自我反思能力。\n\n- **多提供商检索**：在 OpenRouter、Cerebras 或任何兼容 OpenAI 的服务提供商之间切换检索代理。\n\n- **开源生态系统**：支持语音输入、移动端同步，或与 Obsidian 等工具集成的插件。\n\n随着 AI 代理逐渐成为长期陪伴的伙伴，类似 Git 的系统将使它们能够在不形成数据孤岛的情况下持续进化。我们非常期待社区能将这一方向推向更广阔的领域——也许会朝着分布式、以隐私为先的个人 AI 发展。\n\n本项目由 Growth Kinetics 公司研发，这是一家专注于 AI 赋能的小型数据解决方案机构。我们正在探索差分记忆如何为下一代智能体提供动力。我们欢迎各方合作、提交 Pull Request，以及坦诚的反馈，以不断完善它。\n\n## 快速上手\n\n1. 克隆仓库：`git clone https:\u002F\u002Fgithub.com\u002Falexmrval\u002FDiffMem.git`\n2. 安装依赖：`pip install -r requirements.txt`\n3. 设置环境变量：`export OPENROUTER_API_KEY=your_key`\n4. 运行示例：`python examples\u002Fusage.py`\n\n更多完整演示请参阅 `examples\u002F` 目录。\n\n## 参与贡献\n\n欢迎 Fork、实验并提交 PR！我们期待：\n- Git 同步优化；\n- 高级搜索插件；\n- 实际场景中的集成方案。\n\n欢迎提出问题或提交 PR。让我们携手共建 AI 记忆的未来。\n\n许可证：MIT  \nGrowth Kinetics © 2025","# DiffMem 快速上手指南\n\nDiffMem 是一个基于 Git 的轻量级 AI 代理记忆后端。它使用 Markdown 文件存储人类可读的记忆，利用 Git 追踪时间演变，并通过原生 Git 命令（如 `grep`, `git log`, `git diff`）构建精准的上下文，无需向量数据库或嵌入模型。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows (需安装 Git)\n*   **Python 版本**：3.11 或更高版本\n*   **前置依赖**：\n    *   已安装 `git` 命令行工具\n    *   有效的 LLM API Key (默认支持 OpenRouter 或 OpenAI 兼容接口)\n\n## 安装步骤\n\n1.  **克隆仓库**\n    将项目代码下载到本地：\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Falexmrval\u002FDiffMem.git\n    cd DiffMem\n    ```\n\n2.  **安装依赖**\n    使用 pip 安装所需 Python 包。\n    *注：国内用户若遇到下载慢的问题，可使用清华源加速：*\n    ```bash\n    pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n\n3.  **配置环境变量**\n    设置您的 API 密钥（以 OpenRouter 为例）：\n    ```bash\n    export OPENROUTER_API_KEY=your_key\n    ```\n    *(Windows PowerShell 用户请使用：`$env:OPENROUTER_API_KEY=\"your_key\"`)*\n\n## 基本使用\n\nDiffMem 设计为可导入模块，无需启动额外服务器。以下是最简单的使用示例：\n\n1.  **初始化记忆实例**\n    指定本地仓库路径、用户标识和 API Key。\n\n2.  **获取上下文与提交新记忆**\n    调用 API 让代理自动探索 Git 历史以获取相关上下文，并处理新的对话会话。\n\n```python\nfrom diffmem import DiffMemory\n\n# 初始化：指定本地 repo 路径，用户 ID 和 API Key\nmemory = DiffMemory(\"\u002Fpath\u002Fto\u002Frepo\", \"alex\", \"your-api-key\")\n\n# 1. 获取上下文\n# 代理会自动探索 git 历史，找出与当前对话最相关的信息\n# max_tokens 限制返回的 token 数量\ncontext = memory.get_context(conversation, max_tokens=15000)\n\n# 2. 处理并提交新记忆\n# 分析对话内容，更新实体文件，并执行 Git commit\nmemory.process_and_commit_session(\"Had coffee with mom today...\", \"session-123\")\n```\n\n更多详细演示请参考项目中的 `examples\u002Fusage.py` 文件。","一位开发者正在构建一个需要长期陪伴用户的个人 AI 助手，该助手必须记住用户数月甚至数年的生活变化与偏好演变。\n\n### 没有 DiffMem 时\n- **上下文膨胀严重**：为了回答“我现在喜欢什么”，AI 被迫加载包含所有历史对话的庞大向量库，导致响应缓慢且 Token 消耗巨大。\n- **难以追踪变化脉络**：当用户询问“我的职业目标是怎么变的？”时，传统数据库只能返回碎片化信息，无法直观呈现从“想当画家”到“成为设计师”的演变过程。\n- **数据黑盒难维护**：记忆存储在二进制向量或专有图数据库中，开发者无法直接用文本编辑器查看或修正错误的记忆条目，调试极其困难。\n- **历史数据干扰当前判断**：过时的偏好（如两年前的饮食禁忌）常与当前状态混淆，导致 AI 给出不合时宜的建议，除非编写复杂的清洗逻辑。\n\n### 使用 DiffMem 后\n- **聚焦当前状态**：DiffMem 仅将最新的用户画像以 Markdown 文件形式保留在仓库表层，AI 读取极小的上下文即可快速响应，大幅降低延迟与成本。\n- **原生差异智能**：利用 Git 的 `diff` 和 `log` 命令，AI 能精准回溯特定事实的修改记录，轻松梳理出用户兴趣随时间推移的完整故事线。\n- **人类可读可编辑**：所有记忆均为纯文本 Markdown，开发者可直接像管理代码一样审查、版本控制和修复记忆数据，透明度高且易于备份。\n- **按需深度挖掘**：系统默认隔离历史数据，仅在用户主动询问演变过程时才调用 Git 历史进行深度分析，完美平衡了反应速度与推理深度。\n\nDiffMem 通过将 Git 的版本控制能力引入 AI 记忆，让智能体既能敏捷地活在当下，又能深刻地理解过去。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FGrowth-Kinetics_DiffMem_68fb2ba8.png","Growth-Kinetics","Growth Kinetics","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FGrowth-Kinetics_8e9b1448.png","",null,"https:\u002F\u002Fgithub.com\u002FGrowth-Kinetics",[79,83],{"name":80,"color":81,"percentage":82},"Python","#3572A5",99.2,{"name":84,"color":85,"percentage":86},"Dockerfile","#384d54",0.8,843,53,"2026-04-14T04:28:58","未说明","不需要 GPU",{"notes":93,"python":94,"dependencies":95},"该工具无需向量数据库、嵌入模型或机器学习框架，仅依赖 Git 和 LLM API。运行前需设置 OPENROUTER_API_KEY 环境变量。由于是原型阶段，检索质量取决于所使用的 LLM 模型，且不支持多用户并发锁。","3.11+",[96,97],"gitpython","openai",[13,14],"2026-03-27T02:49:30.150509","2026-04-16T01:43:25.256597",[],[]]