If I only had 3 Brains
I've spent some time implementing all 3 of these.
================================================================================
Comparing Persistent Memory Systems for AI Agents: OB1, agentmemory, and brainoutside
================================================================================
AI agents lose their context when a session ends. If you want an agent to remember
project decisions, personal preferences, or family schedules across runs, you need
persistent storage outside the model's context window.
Three distinct approaches have emerged for solving this:
1. OB1 (Open Brain): A centralized, Postgres-backed service for cross-app personal
life management.
2. agentmemory: A local SQLite engine tailored for low-latency coding workflows.
3. brainoutside: A git-backed Markdown repository designed around human curation
and personal voice.
Here is how their architectures, ingestion pipelines, and retrieval models compare
in practice.
--------------------------------------------------------------------------------
1. Storage Backend and Architecture
--------------------------------------------------------------------------------
Feature | OB1 (Open Brain) | agentmemory | brainoutside
------------------------+---------------------------------+--------------------------------+----------------------------
Storage backend | PostgreSQL + pgvector (Supabase)| SQLite (iii-engine) | Plaintext Markdown in Git
Deployment | Cloud, Docker, or Kubernetes | Local daemon (localhost:3111) | Local folder synced to GitHub
History & versioning | Database snapshots | Four-tier lifecycle storage | Standard git commit history
Access control | Postgres Row-Level Security(RLS)| Local process boundary | File permissions & git branches
Latency | Network-dependent (~100-300ms) | Sub-15ms (local IPC/HTTP) | Local filesystem read speed
* OB1: Cloud database with gateway access
OB1 runs on Supabase (PostgreSQL with pgvector). Its core feature is an AI Gateway
that lets multiple clients (like Cursor, ChatGPT, and custom webhooks) talk to the
same hosted memory store. Postgres Row-Level Security isolates data between users
or accounts. The tradeoff is infrastructure complexity: you are hosting and
maintaining a full cloud database stack.
* agentmemory: Local-first daemon for developers
agentmemory runs as a local background process on port 3111. It uses SQLite via
the iii-engine runtime to keep latency minimal. Before writing to disk, it runs
an automated privacy filter to strip out API keys and secrets, alongside a SHA-256
hash check to deduplicate incoming entries. It is designed to run silently
alongside CLI tools and coding editors without network round trips.
* brainoutside: Flat files and Git
brainoutside avoids databases altogether. It stores memories, takes, and notes as
plain Markdown files tracked in a git repository. You can read, edit, or grep your
data with standard terminal utilities or any text editor. It lacks built-in vector
search out of the box, but exposes its notes to agents via MCP and local REST
endpoints while keeping full version history in git.
--------------------------------------------------------------------------------
2. Intended Use Cases
--------------------------------------------------------------------------------
* OB1: Centralized personal life manager
OB1 connects disparate life domains using structured records ("primitives"). A
meal planning agent can check a shared family calendar primitive to see who is home
for dinner, or a job tracking tool can update contacts in a personal CRM. It works
best when you want one centralized backend shared across multiple devices and services.
* agentmemory: Development assistant context
agentmemory targets developer session amnesia in tools like Cursor and Claude Code.
It remembers technical decisions (like using 'jose' instead of 'jsonwebtoken' for
edge runtime compatibility) so you don't have to re-explain constraints or watch
the agent repeat the same debugging mistakes in new sessions.
* brainoutside: Voice and personal identity
brainoutside focuses on capturing how a specific person thinks. It organizes files
under structured folders (like identity/ and knowledge/takes/) so an agent can write
drafts, social posts, or emails that sound like the user. It is built for voice
fidelity rather than logging raw command history.
--------------------------------------------------------------------------------
3. Data Ingestion
--------------------------------------------------------------------------------
System | Ingestion Method | Friction Level | Main Data Sources
--------------+------------------------+---------------------------+----------------------------------------------
OB1 | Batch scripts (Recipes)| Moderate (periodic runs) | Google Takeout, Twitter/X exports, Obsidian
agentmemory | Lifecycle hooks | Zero (automatic capture) | Tool calls, session starts/stops, CLI activity
brainoutside | Proposed staging | High (manual approval) | Manually submitted transcripts, links, notes
* OB1 uses batch import scripts to parse large data exports (Google Takeout, Obsidian
notes, Twitter archives). This builds a rich historical baseline, but requires running
imports periodically to stay up to date.
* agentmemory intercepts IDE and CLI events through more than a dozen lifecycle hooks
(SessionStart, PreToolUse, PostToolUse, Stop). It records decisions and tool outputs
in the background with zero manual logging required.
* brainoutside enforces a strict rule: nothing enters the repository without explicit
user approval. A feeder tool drafts candidate entries from transcripts or links, but
you must review and commit the Markdown file yourself. This keeps out hallucinations
and noisy tool logs.
--------------------------------------------------------------------------------
4. Retrieval and Memory Management
--------------------------------------------------------------------------------
* agentmemory: Tiered consolidation and hybrid search
agentmemory uses a four-stage memory pipeline:
1. Working: Raw, short-term session logs.
2. Episodic: Compressed session summaries.
3. Semantic: Extracted standalone facts.
4. Procedural: Reusable behavioral patterns and workflows.
It combines keyword matching (BM25), vector embeddings, and an entity graph with
Reciprocal Rank Fusion (RRF). Older, rarely referenced entries decay over time
according to an Ebbinghaus forgetting curve. Consolidating raw logs into concise
facts keeps context windows small, cutting token usage significantly compared to
dumping full raw transcripts into prompts.
* OB1: Relational queries with vector search
OB1 routes queries through Postgres using both SQL filters and pgvector similarity
searches. This lets an agent combine structured criteria (e.g., records created this
week with a specific tag) with semantic lookups. Supabase Edge Functions handle
background cleanup and data reshaping.
* brainoutside: Lenses and visibility ceilings
brainoutside organizes retrieval around named filters called Lenses. Each lens
defines which folders and visibility levels an agent can read. For example, a public
drafting agent can be scoped to knowledge/takes/ without ever seeing private personal
records. Updates use a "supersede, never delete" convention: when an opinion changes,
a new entry references and supersedes the old file rather than erasing history.
--------------------------------------------------------------------------------
Summary: Which One Fits Your Workflow?
--------------------------------------------------------------------------------
- Pick OB1 if you want a centralized, multi-user system that syncs personal life
data (calendars, tasks, notes) across several chat clients and cloud tools.
- Pick agentmemory if you want an automated, low-latency background memory layer
for coding agents that prevents repetitive mistakes without manual intervention.
- Pick brainoutside if you want total ownership over your data in plain text,
value human review over automated ingestion, and want to ground agents in your
personal voice.
https://github.com/rohitg00/agentmemory
Comments
Post a Comment