Skip to content

Claude Code memory integration: BM as complementary knowledge graph layer #730

@phernandez

Description

@phernandez

Context

Claude Code has a built-in file-based memory system that writes markdown files with YAML frontmatter to .claude/projects/.../memory/. It maintains a MEMORY.md index and supports memory types (user, feedback, project, reference). This system works well for what it does.

Basic Memory's strength is turning markdown files into a knowledge graph with semantic search, relations, and cross-note navigation. These capabilities would complement Claude Code's memory without replacing it.

Idea

Make Basic Memory a complementary layer around Claude Code's native memory — similar to how OpenClaw's memory-wiki plugin augments rather than replaces the existing memory flow.

What this adds

Claude Code's memory alone:

  • File-based markdown with frontmatter
  • Filename/keyword matching
  • Manual MEMORY.md index
  • Flat structure, no connections between memories

With BM as a complementary layer:

  • Semantic search across memories ("what do I know about indexing performance?")
  • Knowledge graph — relations between memories emerge automatically
  • memory:// URL navigation via build_context
  • Cross-session context — richer retrieval than scanning MEMORY.md
  • Visualization in Obsidian/canvas

Implementation options

  1. Passive index: BM watches the memory directory as a project, indexes files as Claude Code writes them. Zero changes to Claude Code's behavior. BM adds search/graph on top.

  2. Hook-based sync: Claude Code hook triggers bm sync after memory file writes. Same passive approach but with immediate indexing.

  3. Dual-write: Claude Code instructions updated to also call BM MCP tools (write_note, build_context) alongside file writes. Richer integration but requires instruction changes.

  4. Native plugin: BM ships as a Claude Code skill or MCP server that the memory system calls into directly. Deepest integration.

Design principle

Don't get in the way of the memory flow. Complement it. The user shouldn't have to remember anything special or change their workflow. BM just makes the memories more useful.

Prior art

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions