Skip to content

Mihai-Codes/OpenBrain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OpenBrain

Local-first MCP memory hub for AI coding tools. MVP target: OpenCode.

This repo ships a minimal, production-practical setup using agent-memory-mcp (LanceDB + hybrid BM25/vector search + local embeddings) to solve context loss from compaction.

Why this MVP

  • Hybrid search (BM25 + vector) improves recall over pure vector or pure graph memory.
  • Fully local: no API keys, no network dependency after model download.
  • MCP-compatible: works across CLI/TUI/GUI tools that speak MCP.

What you get

  • Ready-to-use MCP config templates
  • macOS LaunchAgent setup for always-on memory server
  • Clean directory layout for local storage

Requirements

  • macOS (MVP target)
  • Node.js 18+ with npm

Quickstart

  1. Install the MCP server globally (downloads ONNX model once):
npm install -g @adamrdrew/agent-memory-mcp
  1. Create local storage paths:
mkdir -p ~/.openbrain/memory-db ~/.openbrain/hardcopy ~/.openbrain/logs
  1. Configure OpenCode MCP (project-level):

Copy config/opencode.mcp.json to .mcp.json in your project and edit paths.

  1. Start server manually (for quick test):
MEMORY_DB_PATH="$HOME/.openbrain/memory-db" \
ENABLE_HARDCOPY=true \
HARDCOPY_PATH="$HOME/.openbrain/hardcopy" \
MEMORY_DECAY_HALF_LIFE=30 \
agent-memory-mcp

OpenCode MCP config

Use this as .mcp.json in your OpenCode project:

{
  "agent-memory": {
    "command": "agent-memory-mcp",
    "env": {
      "MEMORY_DB_PATH": "/Users/you/.openbrain/memory-db",
      "MEMORY_DECAY_HALF_LIFE": "30",
      "ENABLE_HARDCOPY": "true",
      "HARDCOPY_PATH": "/Users/you/.openbrain/hardcopy"
    }
  }
}

Claude Desktop config (optional)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "agent-memory": {
      "command": "agent-memory-mcp",
      "env": {
        "MEMORY_DB_PATH": "/Users/you/.openbrain/memory-db",
        "MEMORY_DECAY_HALF_LIFE": "30",
        "ENABLE_HARDCOPY": "true",
        "HARDCOPY_PATH": "/Users/you/.openbrain/hardcopy"
      }
    }
  }
}

macOS LaunchAgent (always-on)

  1. Edit scripts/macos/com.mihai-codes.openbrain.agent-memory.plist and update the path to this repo.
  2. Load it:
launchctl unload ~/Library/LaunchAgents/com.mihai-codes.openbrain.agent-memory.plist 2>/dev/null || true
cp scripts/macos/com.mihai-codes.openbrain.agent-memory.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.mihai-codes.openbrain.agent-memory.plist

Storage layout (recommended)

~/.openbrain/
  memory-db/      # LanceDB
  hardcopy/       # optional JSON mirror
  logs/

Notes on licensing

agent-memory-mcp is GPL-3.0. This repo only provides configuration and glue. If you embed or redistribute a derivative, GPL obligations apply.

Upgrade paths

  • Hindsight: stronger structured memory and ranking, heavier stack. Good for long-horizon tasks.
  • mcp-knowledge-graph: explicit entities/relations, weaker fuzzy recall.
  • memory-lancedb-pro (OpenClaw plugin): MIT, hybrid + rerank; can be used as an alternative pattern.

Sources

About

Local-first MCP memory hub for AI coding tools (OpenCode-first MVP).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages