Skip to content

Repository files navigation

BrainMesh

The follow graph for second brains.

Personal AI memory layers are exploding: GBrain (26k+ stars), Obsidian vaults behind MCP servers, and a dozen other markdown-first stores. Every one of them is a silo. GBrain already knows how to publish public subsets, mount federated read-only sources, and serve a brain over MCP with OAuth. What nobody has built is the layer between strangers: identity, discovery, and trust.

BrainMesh is that layer. An open manifest spec plus a public registry so any brain can be found, previewed, and followed by any other brain, on any stack.

Think npm for brains: the protocol and registry are free and open forever, and anyone can build hosted services on top.

What you can do with it

  1. Publish: describe your brain in a small brain.json manifest (identity, MCP endpoint, public topics, access terms) and submit it to the registry via PR.
  2. Discover: browse or search the registry index for brains covering topics you care about.
  3. Preview: read a brain's human-readable BRAIN.md and access terms before trusting a byte of it.
  4. Follow: mount a brain's published public subset as a read-only federated source in your own memory layer, so your agent can search it like local knowledge.
  5. Audit and unfollow: list every external brain wired into your agent, with provenance, and cut any of them loose in one command.

Architecture

flowchart LR
    subgraph you [Your machine]
        A[Your agent] --- B[(Your brain<br/>GBrain / Obsidian / other)]
    end
    subgraph alice [Alice's world]
        C[Public subset repo<br/>markdown on GitHub]
        D[Alice's MCP endpoint<br/>gbrain serve --http]
    end
    R[(BrainMesh registry<br/>manifests + index.json)]

    B -- 1. publish manifest via PR --> R
    A -- 2. search + preview --> R
    R -. points to .-> C
    R -. points to .-> D
    B -- 3. follow: clone + mount<br/>read-only source --> C
    A -- 4. optional live query<br/>scoped read token --> D
Loading

Two follow modes, both riding on machinery that already ships today:

  • Repo mode (default): clone the brain's published public subset and register it as a read-only source in your own brain. Works offline, survives the publisher's laptop sleeping, and keeps you in control of what enters your context.
  • Endpoint mode (optional): query the publisher's live MCP endpoint with a read-scoped token. Fresher, but requires their server to be up and requires you to trust their access terms.

Quickstart

Publish your brain

# 1. Copy the template and fill it in
cp spec/examples/example.brain.json my-handle.brain.json

# 2. Validate locally
node scripts/validate-manifests.mjs my-handle.brain.json

# 3. Fork this repo, drop the file in registry/brains/, open a PR
#    CI runs the same validator. Merge = listed.

GBrain users: the brain-network skillpack in skillpack/ automates all of this, including generating the public subset repo. See skillpack/brain-network/README.md.

Follow a brain (GBrain)

# Clone their public subset and mount it as a read-only source
git clone https://github.com/alice/brain-public ~/brain-network/alice
gbrain sources add bn-alice --path ~/brain-network/alice
gbrain sync --source bn-alice
gbrain query "what does alice know about agent memory?"

Read SECURITY.md before following anyone. Mounting a stranger's markdown into your agent's context is a supply chain decision, and BrainMesh treats it like one.

Follow a brain (Obsidian)

See docs/adapters/obsidian.md for exposing a vault through an Obsidian MCP server with a publish frontmatter flag, and for consuming published subsets into a vault.

Repo layout

Path What it is
spec/brain-manifest.schema.json JSON Schema for brain.json (the wire format)
spec/BRAIN.md.template Human-readable companion doc every brain publishes
registry/ The v0.1 registry: brains/*.json submissions plus a generated index.json
scripts/validate-manifests.mjs Dependency-free validator, run locally and in CI
skillpack/brain-network/ GBrain skillpack: publish, search, follow, unfollow/audit
docs/adapters/obsidian.md Obsidian vault adapter guide
SECURITY.md Threat model and mitigations for mounting third-party brains
ROADMAP.md v0.2+: hosted registry, relay, verified identity, paid subscriptions

Design principles

  1. System-agnostic: the manifest describes any MCP-fronted markdown store. GBrain and Obsidian are the first two adapters, not the spec.
  2. Git is the transport: v0.1 needs no new servers. Manifests travel by PR, brains travel by clone. Boring on purpose.
  3. Read-only by default: following grants your agent read access to their published subset, never write access anywhere.
  4. Trust is explicit: nothing enters your agent's synthesis path until you have previewed the manifest, the terms, and (recommended) quarantined the first sync.
  5. Open core: protocol and registry stay MIT. Monetization lives in optional hosted services on top. See ROADMAP.md.

Status

v0.1, pre-launch. The spec is a draft and breaking changes are expected until v1.0. Feedback via issues is very welcome, especially from GBrain, Obsidian MCP, and agent-harness maintainers.

License

MIT. See LICENSE.

About

The follow graph for second brains. Open manifest spec and registry for discovering, previewing, and following personal AI memory layers (GBrain, Obsidian, any MCP-fronted store)

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages