HeadlinesBriefing favicon HeadlinesBriefing.com

Unified Memory Layer Breaks Coding Tool Lock-In With Hooks & Neo4j

Towards Data Science •
×

Unified agentic memory architectures are rewriting the rules for AI coding assistants. A new approach lets Claude Code, Codex, and Cursor share persistent memory via hooks and Neo4j, eliminating vendor lock-in risks. This method decouples memory storage from individual harnesses, allowing seamless cross-tool interoperability.

Hooks act as standardized integration points, firing automatically on lifecycle events like session starts, user prompts, and tool usage. These deterministic triggers capture every interaction across platforms, creating a consistent audit trail. Unlike model-dependent memory systems, hooks operate independently, writing session data to Neo4j's graph database without relying on the LLM's judgment about what to remember.

The memory layer structures sessions as graph nodes connected to event nodes, forming an immutable timeline. A separate "dream phase" processes this data hourly, extracting key facts into markdown files organized by semantic paths (e.g., profile/role.md). These files function as living documents, updating when new information conflicts with existing entries. Neo4j's graph structure enables efficient relationship mapping between sessions, tools, and memory entries.

Combining hooks for deterministic logging with MCP tools for active memory access creates a hybrid system. While hooks passively inject context into prompts, MCP tools allow agents to query and modify memories on demand. This dual approach balances automation with flexibility, letting developers choose between event-driven context injection or direct database interaction. The open-source implementation on GitHub demonstrates a blueprint for modular AI development ecosystems.