The Graph Engineering Setup Guide ✍ darkzodchi🕐 2026-07-24📦 7.9 KB 🟢 已读 𝕏 文章列表 本文介绍了图工程如何为Agent提供复合记忆。通过双时态模型和MCP配置,Claude可获得持久的图记忆,相比向量搜索,多跳任务准确率提升36-46%,幻觉减少40%以上。 Graph EngineeringGraph RAGMemoryMCPClaude CodeNeo4jKnowledge GraphAgent # The Graph Engineering Setup Guide: How to Give Your Agents Memory That Compounds (Exact Config) **作者**: darkzodchi **日期**: 2026-07-23T09:11:55.000Z **来源**: [https://x.com/zodchiii/status/2080219348338090198](https://x.com/zodchiii/status/2080219348338090198) ---  Vector search retrieves text. It can't tell you the function you're about to edit is owned by a team that deprecated it last month. Inside: the bi-temporal model, the MCP config that gives Claude persistent graph memory, and the routing rule for graph vs vector. Gartner expects half of all agent systems on graph context by 2028. Here's the full setup 👇 Before we dive in, I share daily notes on AI & vibe coding in my Telegram channel: https://t.me/zodchixquant 🧠  ## What graph engineering actually is Vector RAG stores your knowledge as isolated chunks and retrieves by similarity. Graph engineering stores it as entities and relationships, so the agent can traverse instead of guess. The difference shows up on questions with more than one hop: - Vector search: "find text similar to auth service" and hope the right chunk ranks first - Graph traversal: "which dashboards break if this table is deprecated" walks table → lineage → every dependent metric, and returns the actual list - The measured gap: production deployments report 36-46% accuracy gains on multi-hop tasks and 40%+ fewer hallucinations against vector-only baselines Gartner projects that through 2028, context engineering improvements including graph grounding lift agentic accuracy by at least 30%. The tooling stopped being academic in 2025-2026: Graphiti, Cognee, KARMA, plus MCP as the standard way to plug a graph into any agent.  ## The killer feature is time, not structure Most people think a knowledge graph is a fancier database. The part that actually matters for agents is bi-temporal modeling. Every edge in Graphiti carries two timestamps: when the event happened, and when your system learned about it. Facts get explicit validity windows. When something changes, the old edge is invalidated, not deleted. That gives your agent three things flat memory can never have: - Point-in-time queries. "What did we believe about this API in June" returns June's answer, not today's - Contradiction handling. New info doesn't silently overwrite old info, it supersedes it with a timestamp trail - An audit trail. Every claim traces back to when and where it entered the graph Your context window forgets at compaction. A vector store remembers everything and understands nothing. A temporal graph remembers what changed and when. ## Setup: graph memory in Claude Code (copy this) Graphiti ships an MCP server, so Claude Code, Claude Desktop, and Cursor can read and write the graph with no integration code. In your .mcp.json: ``` { "mcpServers": { "graphiti": { "command": "uvx", "args": ["graphiti-mcp"], "env": { "NEO4J_URI": "bolt://localhost:7687", "NEO4J_USER": "neo4j", "NEO4J_PASSWORD": "${NEO4J_PASSWORD}", "MODEL_NAME": "claude-sonnet-5" } } } } ``` Two details that decide whether this works: - Point extraction at a cheap model. Entity and edge extraction runs on every ingested episode. Sonnet 5 or Haiku here, not your frontier model, this is the single biggest cost lever in the whole setup - Neo4j runs locally in Docker for a dev graph. One container, and your agent has memory that survives every restart, every compaction, and every new session  ## The routing rule (this is the actual skill) A graph is not a replacement for vector search or your context window. Hybrid routing beats every single-backend setup in benchmarks, and the routing logic is where the engineering lives. Drop this in CLAUDE.md: ``` ## Memory routing Before answering, classify the question: - Relational or multi-hop ("who owns", "what breaks if", "what changed since") → query the graph via MCP - Broad semantic ("find docs about X", "similar examples") → vector search - Anything already in this session → answer from context, don't hit either backend Writing to the graph: - After any decision, write an episode: what was decided, why, which files/people it touches - Never write speculation. Only facts with a source - Contradictions get written as new edges, never edits ``` The rule that saves you money and accuracy at once: the agent stops brute-forcing search when it has a graph to walk. Off-the-shelf setups burn roughly 30% more tokens doing what one traversal answers directly. ## Feeding the graph without burning your budget Ingestion is where naive setups get expensive: every entity resolution and every dedup used to mean another model call. ``` from graphiti_core import Graphiti graphiti = Graphiti(NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD) await graphiti.add_episode( name="deprecate_legacy_auth", episode_body=( "Team Platform deprecated legacy_auth on 2026-07-14. " "Replacement is auth_v3. Owner: Marina. " "Blocked services: billing-api, notifications." ), source_description="engineering decision log", reference_time=datetime(2026, 7, 14), ) ``` Three habits that keep ingestion cheap: - Write episodes, not documents. One decision per episode with named entities beats dumping a wiki page and hoping extraction figures it out - Always set reference_time. Without it you lose the entire bi-temporal advantage and end up with a regular graph - Batch the backfill, stream the rest. Load your history once, then write incrementally as decisions happen. Graphiti updates without recomputing the graph ## Common mistakes - Treating the graph as a second vector store. If you're querying it for "similar text", you built the wrong thing. Graphs answer relationship questions - Running extraction on a frontier model. Ingestion is high-volume and mechanical. Frontier rates here will produce a bill that kills the project before it proves value - Dumping everything in. A graph full of speculation and duplicated facts is worse than no graph, because the agent now traverses confidently into garbage - Skipping reference_time. The temporal layer is the whole reason to pick this over embeddings. Without timestamps you get a static ontology that rots - No write discipline. Agents that write freely create contradictions nobody notices for weeks. One rule (facts with sources only) prevents most of it ## The 20-minute setup 1. Run Neo4j in Docker, one command, dev credentials (4 min) 2. Add the Graphiti MCP block to .mcp.json, point extraction at a cheap model (4 min) 3. Write 5 real episodes by hand: recent decisions, owners, deprecations (6 min) 4. Paste the routing rules into CLAUDE.md (2 min) 5. Ask a multi-hop question you know the answer to, and check the traversal (4 min) Context windows got huge and everyone assumed memory was solved. It wasn't. A big window remembers this session. A graph remembers your project, and it gets more valuable every week you feed it. Thanks for reading! I share daily notes on AI & vibe coding in my Telegram channel: https://t.me/zodchixquant 🧠  ## 相关链接 - [darkzodchi](https://x.com/zodchiii) - [@zodchiii](https://x.com/zodchiii) - [1.3K](https://x.com/zodchiii/status/2080219348338090198/analytics) - [https://t.me/zodchixquant](https://t.me/zodchixquant) - [https://t.me/zodchixquant](https://t.me/zodchixquant) - [Upgrade to Premium](https://x.com/i/premium_sign_up) - [5:11 PM · Jul 23, 2026](https://x.com/zodchiii/status/2080219348338090198) - [1,316 Views](https://x.com/zodchiii/status/2080219348338090198/analytics) --- *导出时间: 2026/7/24 11:06:37* --- ## 中文翻译 # 图工程设置指南:如何赋予你的智能体可积累的记忆(精确配置) **作者**: darkzodchi **日期**: 2026-07-23T09:11:55.000Z **来源**: [https://x.com/zodchiii/status/2080219348338090198](https://x.com/zodchiii/status/2080219348338090198) ---  向量检索获取的是文本。它无法告诉你,你即将编辑的那个函数属于一个上个月就将其弃用的团队。 内容概览:双时态模型、赋予 Claude 持久图记忆的 MCP 配置,以及图与向量检索的路由规则。 Gartner 预计,到 2028 年,一半的智能体系统将基于图上下文运行。 以下是完整的设置方案 👇 在深入之前,我会在我的 Telegram 频道分享关于 AI 和氛围编程的日常笔记:https://t.me/zodchixquant 🧠  ## 图工程究竟是什么 向量 RAG 将你的知识存储为孤立的块,并通过相似性进行检索。图工程将其存储为实体和关系,因此智能体可以进行遍历而不是猜测。 这种差异体现在那些需要多跳(multi-hop)的问题上: - 向量搜索:“查找与 auth service 相似的文本”,并寄希望于正确的块排在第一位 - 图遍历:“如果弃用这个表,哪些仪表盘会损坏”,它会遍历 表 → 血缘关系 → 每一个依赖指标,并返回实际的列表 - 测量出的差距:生产环境部署报告显示,在多跳任务上准确率提高了 36-46%,相比纯向量基线的幻觉减少了 40% 以上 Gartner 预测,到 2028 年,包括图 grounded(基于图)在内的上下文工程改进将使智能体准确率至少提升 30%。 工具链在 2025-2026 年已不再局限于学术圈:Graphiti、Cognee、KARMA,以及作为将图接入任何智能体标准方式的 MCP。  ## 核心功能是时间,而非结构 大多数人认为知识图谱只是一个更高级的数据库。对智能体来说,真正重要的是双时态建模。 Graphiti 中的每一条边都携带两个时间戳:事件发生的时间,以及你的系统了解到它的时间。事实拥有明确的有效期窗口。当发生变化时,旧的边会被失效,而不是被删除。 这为你的智能体提供了扁平记忆永远无法拥有的三样东西: - 时间点查询。“我们在 6 月对这个 API 的看法是什么”会返回 6 月的答案,而不是今天的 - 矛盾处理。新信息不会静默覆盖旧信息,而是通过时间戳轨迹来取代它 - 审计追踪。每一个断言都可以追溯到它进入图谱的时间和地点 你的上下文窗口在压缩时会遗忘。向量存储记住一切但什么都不理解。时态图记住了什么改变了以及何时改变的。 ## 设置:在 Claude Code 中配置图记忆(复制此配置) Graphiti 提供了一个 MCP 服务器,因此 Claude Code、Claude Desktop 和 Cursor 可以无需集成代码即可读写图谱。 在你的 .mcp.json 中: ``` { "mcpServers": { "graphiti": { "command": "uvx", "args": ["graphiti-mcp"], "env": { "NEO4J_URI": "bolt://localhost:7687", "NEO4J_USER": "neo4j", "NEO4J_PASSWORD": "${NEO4J_PASSWORD}", "MODEL_NAME": "claude-sonnet-5" } } } } ``` 决定这是否可行的两个关键细节: - 在廉价模型上进行点提取。实体和边的提取会在每个摄取的片段上运行。在这里使用 Sonnet 5 或 Haiku,而不是你的前沿模型,这是整个设置中最大的成本控制杠杆 - Neo4j 在 Docker 中本地运行以作为开发图谱。一个容器,你的智能体就拥有了能在每次重启、每次压缩和每次新会话后幸存下来的记忆  ## 路由规则(这是真正的技能所在) 图不是向量搜索或上下文窗口的替代品。在基准测试中,混合路由击败了所有单一后端的设置,而路由逻辑才是工程的体现所在。 将此内容放入 CLAUDE.md: ``` ## Memory routing Before answering, classify the question: - Relational or multi-hop ("who owns", "what breaks if", "what changed since") → query the graph via MCP - Broad semantic ("find docs about X", "similar examples") → vector search - Anything already in this session → answer from context, don't hit either backend Writing to the graph: - After any decision, write an episode: what was decided, why, which files/people it touches - Never write speculation. Only facts with a source - Contradictions get written as new edges, never edits ``` 这条规则能同时为你节省资金并提高准确率:当智能体有图可遍历时,它就不再暴力搜索。现成的设置在执行一次遍历就能直接回答的任务时,大约会多消耗 30% 的 token。 ## 在不烧毁预算的情况下喂养图谱 摄取是朴素设置变得昂贵的地方:每一次实体解析和每一次去重过去都意味着另一次模型调用。 ``` from graphiti_core import Graphiti graphiti = Graphiti(NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD) await graphiti.add_episode( name="deprecate_legacy_auth", episode_body=( "Team Platform deprecated legacy_auth on 2026-07-14. " "Replacement is auth_v3. Owner: Marina. " "Blocked services: billing-api, notifications." ), source_description="engineering decision log", reference_time=datetime(2026, 7, 14), ) ``` 三个保持摄取低成本的习惯: - 写片段,而不是文档。每个片段一个决策并附带命名实体,比直接扔进一个维基页面并寄希望于提取能搞定它要好得多 - 始终设置 reference_time。没有它你就会失去整个双时态优势,最终得到一个普通的图 - 批量回填,流式处理其余部分。加载一次历史记录,然后在决策发生时增量写入。Graphiti 会更新而无需重新计算图谱 ## 常见错误 - 将图视为第二个向量存储。如果你用它查询“相似文本”,那你做错了。图回答的是关系问题 - 在前沿模型上运行提取。摄取是高容量且机械性的工作。这里的前沿模型费率会产生一张账单,在项目证明价值之前就扼杀它 - 把所有东西都倒进去。一个充满猜测和重复事实的图比没有图更糟糕,因为智能体现在会自信地遍历到垃圾数据中 - 跳过 reference_time。时态层是选择这个而非嵌入式的全部原因。没有时间戳,你会得到一个腐烂的静态本体 - 没有写入纪律。自由写入的智能体会制造出几周都没人注意到的矛盾。一条规则(仅限有来源的事实)可以防止大部分问题 ## 20 分钟设置 1. 在 Docker 中运行 Neo4j,一个命令,开发凭据(4 分钟) 2. 将 Graphiti MCP 块添加到 .mcp.json,将提取指向廉价模型(4 分钟) 3. 手写 5 个真实的片段:最近的决策、负责人、弃用公告(6 分钟) 4. 将路由规则粘贴到 CLAUDE.md(2 分钟) 5. 问一个你知道答案的多跳问题,并检查遍历结果(4 分钟) 上下文窗口变得巨大,每个人都以为记忆问题已解决。其实并没有。大窗口记住的是本次会话。图记住的是你的项目,而且你每周喂养它,它就变得越有价值。 感谢阅读! 我会在我的 Telegram 频道分享关于 AI 和氛围编程的日常笔记:https://t.me/zodchixquant 🧠  ## 相关链接 - [darkzodchi](https://x.com/zodchiii) - [@zodchiii](https://x.com/zodchiii) - [1.3K](https://x.com/zodchiii/status/2080219348338090198/analytics) - [https://t.me/zodchixquant](https://t.me/zodchixquant) - [https://t.me/zodchixquant](https://t.me/zodchixquant) - [Upgrade to Premium](https://x.com/i/premium_sign_up) - [5:11 PM · Jul 23, 2026](https://x.com/zodchiii/status/2080219348338090198) - [1,316 Views](https://x.com/zodchiii/status/2080219348338090198/analytics) --- *导出时间: 2026/7/24 11:06:37*
G Graph Engineering: 在一个窗口构建 1000+ Agent 循环的完整指南 本文介绍了 Graph Engineering 的概念,即从线性的 Agent 循环转向图结构的工作流。文章详细讲解了如何利用 Claude Code 的动态工作流功能,通过五个步骤构建并行处理任务的 Agent 图,以解决上下文限制和执行效率问题,并探讨了在扩展到 1000+ Agent 时可能遇到的挑战及解决方案。 技术 › Agent ✍ codila🕐 2026-07-22 Graph EngineeringClaude CodeWorkflowAgent并行处理动态工作流LLMDevOps
彻 彻底告别Loop Engineering:一文读懂 Graph Engineering 本文介绍了AI Agent工程从Prompt到Loop再到Graph的演进。Graph Engineering通过图结构重新规划任务关系,实现并行处理、明确依赖、隔离失败,从而解决线性流程在复杂任务中效率低、易失控的问题。 技术 › Agent ✍ AI超元域🕐 2026-07-21 Graph EngineeringAgentLLM架构设计Claude Code工作流并行处理Dynamic Workflows
F Fable 循环库:25 个全自动工作流实战指南 本文介绍了一套包含 25 个工作流的“Fable 循环库”,旨在教读者如何利用 Claude Code 的 /loop 和 /goal 命令实现 AI 自动化。文章详细阐述了基于目标、边界和结果的 Agent 核心逻辑,区分了循环和目标的区别,并按营销内容和产品两个维度,展示了如何利用 MCP 和 API 自动执行 SEO 监控、内容挖掘、竞品分析及用户体验优化等任务。 技术 › Agent ✍ Machina🕐 2026-07-05 Claude CodeWorkflowAutomationAgentMCPFableSEOPrompt Engineering效率工具
最 最重要的 AI 创业领域不是 Agent,而是 AI Memory 本文探讨了 AI 领域被忽视的一环:记忆。文章指出,GBrain 正致力于构建持久的认知层,通过自动建立知识图谱和梦境循环维护,让 AI 拥有持久记忆和关系感知。作者认为,未来的 AI 竞争优势将属于那些能积累上下文和理解关系的系统,而不仅仅是智能体本身。 技术 › LLM ✍ Nainsi Dwivedi🕐 2026-05-30 AIMemoryGBrainAgentInfrastructureKnowledge GraphCognition
C Claude Code 在大型代码库中的运作方式:最佳实践与入门指南 文章探讨了 Claude Code 在处理数百万行级单体仓库及遗留系统时的成功模式。区别于传统 RAG 工具的嵌入索引滞后问题,Claude 采用本地代理式搜索实时导航。核心论点指出,工具链生态(CLAUDE.md、钩子、技能、LSP 集成等)的重要性远超模型本身。文章详细解析了七大扩展点,并建议通过渐进式配置与插件分发来提升在大型复杂代码库中的协作效率。 技术 › Claude Code ✍ nash_su🕐 2026-05-17 Claude CodeLLM最佳实践工程化DevOps代码库导航MCPAgent工具链编程
C Claude Code新版本 + CodeGraph + MCP 组合拳!大型代码库直接起飞! 文章介绍了Claude Code 2.1.142、CodeGraph与MCP的“组合拳”方案,有效解决了大型代码库探索中tool call过多、上下文爆炸等问题。通过CodeGraph构建语义知识图谱,结合MCP持久化记忆与新版优化,实现了Tool call减少92%、代码探索速度提升71%的显著效果,并提供了详细的安装配置流程与实战场景指南。 技术 › Claude Code ✍ loveabit🕐 2026-05-16 Claude CodeCodeGraphMCPLLMAI编程DevOps工具与效率Agent技术选型代码优化
3 30天精通Claude Code:从入门到实战的完整路径 本文详细介绍了如何在30天内掌握Claude Code这一命令行自主编程Agent。文章将其划分为三个阶段:第一周侧重基础安装与环境配置(如CLAUDE.md文件的编写及Plan/Act模式的区分);第二周通过构建真实MVP项目来掌握调试与核心斜杠指令;第三周进阶至多文件重构及MCP服务器连接。旨在帮助开发者摆脱简单的聊天对话,利用Claude Code实现高效的代码编写、调试与部署。 技术 › Claude Code ✍ Mayank Agarwal🕐 2026-05-06 Claude CodeAI编程AgentCLIDevOps自动化开发工具MCP代码重构
R Ruflo:将 Claude Code 转变为多 Agent 平台的实践与架构解析 Ruflo 是一个为 Claude Code 构建的“神经系统”和分层运行时,旨在提供 HNSW 向量记忆、100+ 专用 Agent 以及多智能体群集协调。文章详细介绍了其基于 MCP 的工具表面、联邦通信机制和自学习架构。同时,基于项目最新的 ADR 审计报告,分析了 Ruflo 在功能实现上的真实进展,指出了记忆层已可用而部分执行层(如神经网络预测、工作流运行时)仍处于存根状态的现状。 技术 › Agent ✍ AlphaSignal AI🕐 2026-05-06 Claude CodeRufloMCPMulti-AgentSwarmMemoryVector DatabaseDevOpsLLMArchitecture
D DeepSeek 替代 Claude Code 降本方案 & 18款浏览器自动化工具评测 文章首先介绍了 GitHub 项目 deepclaude,通过将 Claude Code 的内核 API 替换为 DeepSeek V4 Pro,实现了在保持性能的同时将 API 成本降低至 1/17,并支持无缝切换后端。随后,文章详细测评了目前主流的 18 款 AI Agent 浏览器和数据采集工具,按功能分为王者派、Rust 派、MCP 派等,并提供了针对不同场景(如自动化、MCP 接入、社媒爬虫)的选型建议。 技术 › 工具与效率 ✍ 未知🕐 2026-05-04 Claude CodeDeepSeek成本优化Agent浏览器自动化MCP爬虫开源工具DevOps
A Agent Memory Engineering 文章探讨了 AI Agent 的记忆机制,解释了为何不同 Agent(如 Claude Code 和 Codex)之间无法直接通过复制文件来迁移记忆。作者指出,这是因为模型在后期训练时与特定的记忆层“融合”了。文章对比了 Hermes、Codex CLI 和 Claude Code 三种实现,并得出结论:最聪明的架构(如向量数据库、知识图谱)输给了最简单的方案(LLM + Markdown + Bash 工具)。核心在于 Agent 遵循的读写规范,而非数据结构本身。 技术 › Agent ✍ Nicolas Bustamante🕐 2026-05-02 AgentMemoryLLMEngineeringClaude CodeCodexRAGPost TrainingMarkdownHermes
2 2026年AI Agent构建指南:必须掌握的Memory Stack 文章指出AI构建者不应关注模型本身,而应聚焦于底层的可移植Memory Layer。作者通过项目'brain'展示了一种基于Git作为唯一事实来源、SQLite FTS5作为衍生索引的解决方案。这种架构支持跨工具(如Claude Code、Cursor)的通用记忆,实现了数据的类型化、索引、审计和同步。文章详细阐述了Git作为存储的优势、SQLite检索的高效性、秘密扫描及防御机制,强调了类型化事件和可回滚性对于Agent记忆系统的重要性。 技术 › Agent ✍ Avid🕐 2026-04-28 AgentMemoryArchitectureGitSQLiteRustClaudeOpenAIMCPBuilding
I If You're Not Using These 100 Repos, Delete CLAUDE CODE 文章指出许多人低估了 Claude Code 的潜力,仅仅将其视为普通的 AI 编码工具。作者通过整理 100 个最佳仓库,展示了如何利用 configs、plugins、skills 和 subagents 极大提升开发效率。文中详细列出了精选列表、官方 Anthropic 仓库以及技能集合等资源,帮助开发者构建强大的 AI 辅助开发工作流。 技术 › Claude Code ✍ kaize🕐 2026-04-26 Claude CodeAgentSkillsPluginsAnthropicDevOps工具与效率MCP开发工具开源