← Back to Plugins
Tools

Brainjar Openclaw

Farad-Labs By Farad-Labs 👁 8 views ▲ 0 votes

OpenClaw memory plugin powered by Brainjar — local SQLite with FTS5, fuzzy, graph, and vector search

GitHub

Install

npm install
npm

README

# brainjar-openclaw

OpenClaw memory plugin backed by [Brainjar](https://github.com/Farad-Labs/brainjar) — AWS Bedrock Knowledge Bases + S3 + local fuzzy search.

## What it does

1. **Auto-recall** — before each agent run, searches Brainjar for relevant memories and prepends them as `<brainjar_memories>` context
2. **Auto-sync** — after each successful agent run, triggers `brainjar sync --no-wait` (fire-and-forget)
3. **Startup sync** — syncs on gateway start so your KBs stay fresh
4. **Agent tools** — exposes `memory_search`, `memory_sync`, `memory_status` as LLM-callable tools
5. **CLI commands** — `openclaw brainjar status`, `openclaw brainjar sync`, `openclaw brainjar search <query>`

## Requirements

- `brainjar` binary in PATH (or configure `brainjarBin`)
- Brainjar configured with a valid `brainjar.toml` (or set `configPath`)
- AWS credentials with Bedrock + S3 access

## Installation

```bash
openclaw plugins install ~/Code/personal/brainjar-openclaw
```

## Configuration

After installing, configure via `openclaw config`:

```bash
# Custom binary path
openclaw config set plugins.entries.brainjar-openclaw.config.brainjarBin /path/to/brainjar

# Custom config file
openclaw config set plugins.entries.brainjar-openclaw.config.configPath /path/to/brainjar.toml

# Disable auto-recall
openclaw config set plugins.entries.brainjar-openclaw.config.autoRecall false

# Change recall mode (all | remote | local)
openclaw config set plugins.entries.brainjar-openclaw.config.recallMode all

# Adjust min score threshold (0.0 - 1.0)
openclaw config set plugins.entries.brainjar-openclaw.config.minScore 0.4
```

### Full config schema

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `brainjarBin` | string | `"brainjar"` | Path to brainjar binary |
| `configPath` | string | auto-detect | Path to brainjar.toml |
| `autoRecall` | boolean | `true` | Inject memories before agent runs |
| `autoSync` | boolean | `true` | Sync after successful agent runs |
| `syncOnStartup` | boolean | `true` | Sync when gateway starts |
| `maxResults` | number | `5` | Max recall results to inject |
| `minScore` | number | `0.3` | Min score threshold for recall |
| `recallMode` | string | `"remote"` | `"all"`, `"remote"`, or `"local"` |

## CLI Usage

```bash
# Check KB status
openclaw brainjar status

# Sync memory files (no-wait by default)
openclaw brainjar sync
openclaw brainjar sync --wait       # wait for ingestion
openclaw brainjar sync --force      # re-upload all files

# Search memories
openclaw brainjar search "deployment workflow"
openclaw brainjar search --local "branjiar"   # local fuzzy only
openclaw brainjar search --json "query"        # JSON output
```

## Agent Tool Usage

The plugin exposes three tools the LLM can call:

- **`memory_search`** — search across KBs with optional mode/limit
- **`memory_sync`** — trigger sync (optionally wait, optionally force)
- **`memory_status`** — show KB status, file counts, last sync times

## Development

```bash
npm install
npm run build
npm run dev    # watch mode
```
tools

Comments

Sign in to leave a comment

Loading comments...