@dmsdc-ai/aigentry-brain
v0.2.5
Published
LLM-Native Intelligence Layer — multi-device memory profile sync
Maintainers
Readme
aigentry-brain
AI 의사결정을 감사 가능하게 만드는 오픈소스 엔진
Persistent, cross-device memory for AI agents. Exposes 20 MCP tools so Claude Code (and any MCP-compatible client) can read and write structured memories that survive context resets, sync across machines via Git with version vectors, and carry policy metadata controlling scope, retention, and access.
Quick Start
npm install -g @dmsdc-ai/aigentry-brainThat's it. Three things happen automatically:
~/.aigentry/is created with a local memory profile- The MCP server is registered in Claude Code, Gemini CLI, and Codex
- If
ghCLI is authenticated, a private GitHub repo is auto-created for cross-device sync
No prompts. No manual config. On next Claude Code session, brain_context_resume loads your memory automatically.
For manual setup (optional):
aigentry-brain-setupTo start the MCP server manually:
aigentry-brain-mcpTo open the CLI dashboard:
aigentryWhy aigentry?
Most AI memory tools treat memory as a black box. You can't audit what was stored, can't control which model reads what, and can't sync across devices without a proprietary cloud.
aigentry-brain is different:
| Feature | aigentry-brain | Mem0 | Khoj | |---|---|---|---| | Local-first storage | Yes (YAML) | No (cloud) | Yes | | Git-based sync | Yes | No | No | | MCP protocol native | Yes | No | Partial | | Policy per entry (scope/TTL/sensitivity) | Yes | No | No | | Audit trail | Yes | No | No | | Cross-LLM memory | Yes | Partial | No | | Open source | MIT | OSS core | MIT | | Self-hosted | Yes | Paid tier | Yes | | Version vectors | Yes | No | No | | Session handoff | Yes | No | No | | Zero-prompt setup | Yes | No | No |
MCP Tools (20)
Once installed, these tools are available inside Claude Code:
| Tool | Description |
|---|---|
| brain_append | Create or update a memory entry |
| brain_query | Query entries with filters (category, tags, date, content search) |
| brain_search | Hybrid lexical/semantic search across memories |
| brain_erase | Soft-delete an entry by ID |
| brain_context_resume | Restore context summary for AI consumption |
| brain_sync_status | Get current sync state |
| brain_health | System health report |
| brain_compact | Run manual memory compaction |
| brain_experiment_run | Run replay-based search/restore experiments |
| brain_append_batch | Append multiple entries in one write |
| brain_erase_batch | Delete multiple entries by ID |
| brain_sync_pull | Pull remote memory state |
| brain_sync_push | Push local state to remote Git repo |
| brain_sync_ack | Acknowledge sync completion |
| brain_peers_list | List configured peer devices |
| brain_peers_register | Register a peer device |
| brain_export | Export memory entries |
| brain_audit_log | Read the audit trail |
| brain_session_export | Export session state for handoff |
| brain_session_import | Import session state from another device |
Cross-Machine Sync (CMP)
The Cross Machine Protocol (CMP) uses Git as the sync transport. Each device maintains a local clone; push/pull is triggered explicitly via MCP tools or CLI.
# Point to your private Git repo
export [email protected]:you/brain-sync.git
# Pull from remote
aigentry brain sync pull
# Push to remote
aigentry brain sync pushConflict resolution: Last-Write-Wins based on ISO8601 updated timestamp. Tie-breaking by device_id lexicographic order. Version vectors track causal ordering across devices.
Session handoff allows seamless context transfer between devices via brain_session_export/brain_session_import.
peers.yaml
peers:
- id: device-macbook
remote_url: [email protected]:you/brain-sync.git
branch: main
- id: device-linux
remote_url: [email protected]:you/brain-sync.git
branch: mainEntry Schema
Every memory entry carries:
interface Entry {
id: string; // "mem_..."
category: string; // preference | skill | fact | decision | habit | ...
content: string;
source: string; // user | auto | session | settings
confidence: number; // 0.0 – 1.0
tags?: string[];
created: string; // ISO8601
updated: string; // ISO8601
deleted?: boolean;
policy?: {
project_id?: string;
scope?: 'user' | 'project' | 'team';
allowed_models?: string[];
retention_ttl?: string; // "30d" | "90d" | "365d" | "forever"
sensitivity?: 'public' | 'internal' | 'confidential' | 'restricted';
};
version_vector?: Record<string, number>; // causal ordering
}Configuration
All config via environment variables:
| Variable | Default | Description |
|---|---|---|
| BRAIN_REMOTE_URL | — | Remote Git URL for sync |
| BRAIN_REPO_PATH | ~/.aigentry/repo | Local clone path |
| BRAIN_PROJECT_ID | "default" | Default project ID for new entries |
| BRAIN_DEFAULT_SCOPE | "user" | Default scope (user / project / team) |
| BRAIN_PEERS_PATH | ~/.aigentry/peers.yaml | Peer device config file |
| BRAIN_DEVICE_ID | auto-detected | Device identifier for sync |
| BRAIN_LOG_LEVEL | "info" | Log level (debug / info / warn / error) |
| BRAIN_CONFIG_PATH | ~/.aigentry/config.json | Setup config file path |
Known Limitations
- LWW conflict resolution is simple — concurrent writes from multiple devices with identical timestamps break ties by device ID, not content
- Team scope access control is not yet enforced (Phase 2)
retention_ttlauto-expiry sweeper is not yet implemented — expired entries are filtered at read time but not physically removed
The aigentry Ecosystem
| Package | Description | npm |
|---|---|---|
| aigentry-brain | Persistent memory + MCP server (this repo) | @dmsdc-ai/aigentry-brain |
| aigentry-deliberation | Multi-session AI debate engine with cross-LLM browser integration | @dmsdc-ai/aigentry-deliberation |
| aigentry-devkit | Cross-platform installer and tooling bundle | @dmsdc-ai/aigentry-devkit |
| aigentry-registry | Agent and tool registry | @dmsdc-ai/aigentry-registry |
| aigentry-ssot | Single source of truth sync utilities | @dmsdc-ai/aigentry-ssot |
aigentry-deliberation
The deliberation package lets multiple AI models debate a decision before committing to it. Claude responds via MCP tool; Gemini or ChatGPT respond via CDP browser automation. Transcripts are structured with explicit agree/disagree/conditional tagging and synthesized into a report.
npx @dmsdc-ai/aigentry-deliberation installDevelopment
git clone https://github.com/dmsdc-ai/aigentry-brain.git
cd aigentry-brain
npm install
npm run build
npm test # 746 tests across 52 files
npm run lint # ESLint + Prettier
npm run test:coverage # Coverage report (60% threshold)Requirements: Node.js >= 20
License
MIT — see LICENSE
