Skip to content
Open
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
20 changes: 18 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Rather than replacing existing memory bank systems, agentMemory **enhances** the
- Bi-directional sync engine
- Parses markdown files from agents' memory banks
- Exports MCP memories to markdown format
- Supports KiloCode, Cline, and RooCode
- Supports KiloCode, Cline, RooCode, and OpenCode

**File Mapping:**
```typescript
Expand All @@ -152,6 +152,14 @@ RooCode: .roo/memory-bank/
techContext.md → decision
progress.md → feature
decisionLog.md → decision

OpenCode: .opencode/memory-bank/
architecture.md → architecture
patterns.md → pattern
decisions.md → decision
features.md → feature

OpenCode also syncs to AGENTS.md (project root) for session-start context.
```

### 3. Configuration Management (`src/config.ts`)
Expand All @@ -164,9 +172,17 @@ RooCode: .roo/memory-bank/
**Agent Detection:**
```typescript
detectInstalledAgents(): string[] {
// Checks for:
// Checks for VS Code extensions:
// - saoudrizwan.claude-dev (Cline)
// - kilocode.kilo-code (KiloCode)
// - roo-cline.roo-cline (RooCode)
// - Continue.continue (Continue)

// Also checks for OpenCode by file system:
// - opencode.json in workspace root
// - .opencode/ directory in workspace
}
```
// - rooveterinaryinc.roo-cline (RooCode)
}
```
Expand Down
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ memory_search({

### 🤖 Multi-Agent Support

| Agent | Memory Bank Location | Sync Status |
|-------|---------------------|-------------|
| **KiloCode** | `.kilocode/rules/memory-bank/` | ✅ Full sync |
| **Cline** | `.clinerules/memory-bank/` | ✅ Full sync |
| **RooCode** | `.roo/memory-bank/` | ✅ Full sync |
| Agent | Type | Memory Bank Location | Sync Status |
|-------|------|---------------------|-------------|
| **KiloCode** | VS Code Extension | `.kilocode/rules/memory-bank/` | ✅ Full sync |
| **Cline** | VS Code Extension | `.clinerules/memory-bank/` | ✅ Full sync |
| **RooCode** | VS Code Extension | `.roo/memory-bank/` | ✅ Full sync |
| **OpenCode** | Terminal TUI | `AGENTS.md` + `.opencode/commands/` | ✅ Full sync |

**Files Synced:**
- `projectBrief.md` / `brief.md`
Expand Down Expand Up @@ -260,6 +261,16 @@ your-project/
│ ├── uuid-002.json # Memory: API patterns
│ └── ...
├── AGENTS.md # OpenCode rules (auto-created)
├── opencode.json # OpenCode MCP config (auto-created)
├── .opencode/
│ └── commands/ # OpenCode custom commands (auto-created)
│ ├── memory-search.md
│ ├── memory-write.md
│ └── memory-review.md
├── .kilocode/rules/memory-bank/ # KiloCode memory bank
│ ├── brief.md # ⬍ Synced with our database
│ ├── architecture.md # ⬍ Auto-updated
Expand Down Expand Up @@ -323,7 +334,7 @@ your-project/
| **Search** | ✅ Fast indexed | ❌ No | ✅ Yes |
| **Analytics** | ✅ Dashboard | ❌ No | ❌ No |
| **Automation** | ✅ Auto-sync | ❌ Manual | ⚠️ Partial |
| **Multi-Agent** | ✅ All 3 | ✅ Per-agent | ✅ All |
| **Multi-Agent** | ✅ All 4 | ✅ Per-agent | ✅ All |
| **Git-Friendly** | ✅ Yes | ✅ Yes | ⚠️ Depends |
| **Cross-Project** | ✅ Yes | ❌ No | ❌ No |

Expand Down
79 changes: 71 additions & 8 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,76 @@ This skill extends your capabilities by providing a persistent, searchable memor

## Setup

### For VS Code Agents (Cline, RooCode, KiloCode)

1. **Install Dependencies**:
```bash
npm install
cd ~/.agents/skills/agent-memory && npm install && npm run compile
```

2. **Build the Project**:
2. **Start the Memory Server**:
```bash
npm run compile
npm run start-server <project_id> <absolute_path_to_workspace>
```

3. **Start the Memory Server**:
You need to run the MCP server to interact with the memory bank.
### For OpenCode (Terminal-based Agent)

1. **Build the MCP server**:
```bash
npm run start-server <project_id> <absolute_path_to_workspace>
cd ~/.agents/skills/agent-memory && npm install && npm run compile
```

2. **Add MCP server to your `opencode.json`** in the project root:
```json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"agentmemory": {
"type": "local",
"command": ["node", "/Users/YOUR_USER/.agents/skills/agent-memory/out/mcp-server/server.js", "PROJECT_ID", "/ABSOLUTE/PATH/TO/WORKSPACE"],
"enabled": true
}
}
}
```
Replace `YOUR_USER`, `PROJECT_ID`, and `/ABSOLUTE/PATH/TO/WORKSPACE` with actual values.

3. **Add memory instructions to `AGENTS.md`** in the project root:
```markdown
## agentMemory System (REQUIRED)

This project uses agentMemory for persistent knowledge management.

### Required Workflow

**EVERY task MUST follow this sequence:**

1. **Before ANY work:** Call `memory_search()` to check existing knowledge
2. **After ANY significant work:** Call `memory_write()` to document what was done

### Available MCP Tools

- `agentmemory_memory_search` - Search for memories by query, type, or tags
- `agentmemory_memory_write` - Save new memory
- `agentmemory_memory_read` - Retrieve specific memory by key
- `agentmemory_memory_list` - List memories by type
- `agentmemory_memory_update` - Update existing memory
- `agentmemory_memory_stats` - View memory statistics
- `agentmemory_project_init` - Initialize project storage

**Failure to use memory tools = Incomplete work**
```

4. **Optionally add custom commands** to `.opencode/commands/memory-search.md`:
```markdown
---
description: Search project memories
---
Search the agentMemory system for relevant context about: $ARGUMENTS

Use the agentmemory_memory_search tool with query "$ARGUMENTS".
If results are found, summarize them clearly. If no results, suggest creating a new memory.
```
*Note: This skill typically runs as a background process or via an mcp-server configuration. ensuring it is running is key.*

## Capabilities (MCP Tools)

Expand All @@ -57,9 +111,18 @@ Retrieve specific memory content by key.
View analytics on memory usage.
- **Usage**: "Show memory statistics" -> `memory_stats({})`

## Supported Agents

| Agent | Type | Config Location | Memory Bank Path |
|-------|------|-----------------|------------------|
| KiloCode | VS Code Extension | VS Code MCP settings | `.kilocode/rules/memory-bank/` |
| Cline | VS Code Extension | VS Code MCP settings | `.clinerules/memory-bank/` |
| RooCode | VS Code Extension | VS Code MCP settings | `.roo/memory-bank/` |
| **OpenCode** | Terminal TUI | `opencode.json` | `AGENTS.md` + `.opencode/commands/` |

## Workflow

1. **Initialization**: The first time you run this in a project, it may attempt to import existing markdown memory banks from `.kilocode/`, `.clinerules/`, or `.roo/`.
1. **Initialization**: The first time you run this in a project, it may attempt to import existing markdown memory banks from `.kilocode/`, `.clinerules/`, `.roo/`, or `AGENTS.md`.
2. **Development Loop**:
- **Before Task**: Search memory for relevant context.
- **During Task**: Use read/search to answer questions.
Expand Down
23 changes: 23 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export class ConfigManager {

// Configure each agent's settings file
for (const agent of installedAgents) {
// OpenCode uses opencode.json (handled by InterceptorManager), skip VS Code settings
if (agent === 'opencode') {
this.outputChannel.appendLine(` ℹ️ opencode: configured via opencode.json (handled by interceptor)`);
continue;
}

const settingsPath = this.getAgentSettingsPath(agent);
if (!settingsPath) {
this.outputChannel.appendLine(`⚠️ Unknown settings path for ${agent}`);
Expand Down Expand Up @@ -117,6 +123,23 @@ export class ConfigManager {
}
}

// Detect OpenCode by checking for opencode.json or .opencode/ directory
const workspacePath = this.workspaceFolder.uri.fsPath;

try {
await fs.access(path.join(workspacePath, 'opencode.json'));
installed.push('opencode');
this.outputChannel.appendLine(' ✅ opencode: opencode.json found');
} catch {
try {
await fs.access(path.join(workspacePath, '.opencode'));
installed.push('opencode');
this.outputChannel.appendLine(' ✅ opencode: .opencode/ directory found');
} catch {
// OpenCode not detected
}
}

return installed;
}
}
Loading