Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .claude/gbrain-setup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# GBrain Setup for Open-Generative-AI

## Overview

This project includes GBrain integration for persistent agent memory. The integration consists of:
- **Repository-level configuration**: MCP setup and documentation (checked into git)
- **Local user setup**: Each developer initializes their own `~/.gbrain/` brain on their machine

## What Was Installed

This project now has GBrain integrated for persistent agent memory.
Expand All @@ -15,16 +21,23 @@ This project now has GBrain integrated for persistent agent memory.
| **Search** | ✅ Keyword-only | Vector embeddings optional (requires API key) |
| **Team Brain** | ⏳ Optional | Can upgrade to Supabase multi-user later |

### Files Added
### Files Added to Repository

```
├── .claude/mcp/gbrain.json # MCP configuration
├── docs/GBRAIN_INTEGRATION.md # Full integration guide
├── docs/GBRAIN_QUICKSTART.md # 5-minute quick start
└── ~/.gbrain/ # Brain home (user's directory)
├── brain.pglite # PGLite database
├── config.json # Brain configuration
└── brain-repo/ # Optional markdown pages dir
└── docs/GBRAIN_QUICKSTART.md # 5-minute quick start
```

### Local Setup (Created on Each User's Machine)

When you run `gbrain init`, the following is created in your home directory (not in the repo):

```
~/.gbrain/
├── brain.pglite # PGLite database (Postgres via WASM)
├── config.json # Brain configuration
└── brain-repo/ # Optional markdown pages directory
```

### What It Does
Expand Down
5 changes: 1 addition & 4 deletions .claude/mcp/gbrain.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"serve",
"--surface",
"verbs"
],
"env": {
"GBRAIN_HOME": "/root/.gbrain"
}
]
}
}
}
24 changes: 14 additions & 10 deletions docs/GBRAIN_INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@ GBrain is a persistent knowledge brain for AI agents. This project has been conf

## Setup Status

✅ **Initialized**: PGLite local brain at `~/.gbrain/brain.pglite`
✅ **Memory writeback**: Enabled (salient mode) — captures important decisions automatically
⏳ **Embeddings**: Not yet configured (optional but recommended for semantic search)
✅ **Repository**: GBrain MCP configuration committed to `.claude/mcp/gbrain.json`
⏳ **Local brain**: Initialize on your machine with `gbrain init --no-embedding`
⏳ **Embeddings**: Optional (can add later with API key for semantic search)

## How to Use

### 1. Enable MCP in Claude Code
### 1. Initialize GBrain on Your Machine

Add gbrain to Claude Code's MCP servers:
First, initialize your local brain (runs once per machine):

```bash
claude mcp add gbrain -- gbrain serve --surface verbs
gbrain init --no-embedding # Initialize without embeddings
```

Then restart Claude Code. You'll have access to the 7-verb memory protocol:
This creates `~/.gbrain/brain.pglite` and configuration on your machine.

### 2. Restart Claude Code

The MCP configuration (`.claude/mcp/gbrain.json`) loads automatically at startup. Restart Claude Code to activate it. You'll then have access to the 7-verb memory protocol:
- `remember` — save a fact for future sessions
- `recall` — retrieve remembered facts by topic
- `entity` — query information about a specific person/company/project
Expand All @@ -34,7 +38,7 @@ Then restart Claude Code. You'll have access to the 7-verb memory protocol:
- `context_pack` — get a summary of context for this brain
- `delta` — get what's changed since last recall

### 2. Quick Test
### 3. Quick Test

In a Claude Code session:

Expand All @@ -50,7 +54,7 @@ recall: "my Python style"

It will remember across sessions — the answer comes from gbrain, not chat history.

### 3. Capturing Knowledge
### 4. Capturing Knowledge

**Manually capture a note:**
```bash
Expand All @@ -67,7 +71,7 @@ gbrain capture --file ./notes/2026-09-12-meeting.md
echo "Completed the performance audit" | gbrain capture --stdin
```

### 4. Querying Your Brain
### 5. Querying Your Brain

**Keyword search (fast, works now):**
```bash
Expand Down
28 changes: 19 additions & 9 deletions docs/GBRAIN_QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@ GBrain is now integrated with this project. This guide gets you using it in 5 mi

## What You Have

✅ Local brain initialized at `~/.gbrain/brain.pglite`
✅ Memory writeback enabled (auto-captures decisions)
✅ MCP configuration ready (`.claude/mcp/gbrain.json`)
✅ 7-verb memory protocol loaded
✅ GBrain integrated (repository-level MCP configuration ready)
✅ MCP configuration (`.claude/mcp/gbrain.json`)
✅ 7-verb memory protocol available
⏳ Local brain pending — initialize on your machine with `gbrain init`

## Step 1: Restart Claude Code
## Step 1: Initialize GBrain on Your Machine

The MCP wiring loads at startup. Restart Claude Code (desktop or CLI) after the integration is complete.
First, initialize your local brain:

## Step 2: Test Memory Across Sessions
```bash
gbrain init --no-embedding # Initialize without embeddings (optional, can add later)
```

This creates `~/.gbrain/brain.pglite` and configuration on your machine.

## Step 2: Restart Claude Code

The MCP wiring loads at startup. Restart Claude Code (desktop or CLI) after the initialization is complete.

## Step 3: Test Memory Across Sessions

**In your first Claude Code session:**

Expand All @@ -33,7 +43,7 @@ recall: "what am I working on?"

**Expected result:** Claude Code knows the answer even though chat history was cleared. The brain persisted it across sessions.

## Step 3: Capture Knowledge
## Step 4: Capture Knowledge

As you work, capture insights:

Expand All @@ -48,7 +58,7 @@ echo "Implemented batch API response caching" | gbrain capture --stdin
gbrain capture --file ./session-notes.md
```

## Step 4: Query What You Know
## Step 5: Query What You Know

Ask the brain questions:

Expand Down
Loading