Skip to main content

A Cognition Operating System for AI Coding Agents

Project description


title: Ever Brain emoji: ๐Ÿง  colorFrom: blue colorTo: indigo sdk: docker app_port: 7860

Ever Brain

A Cognition Operating System for AI Coding Agents

Persistent ยท Portable ยท Markdown-Native ยท Open Source


AI agents lose operational continuity across sessions, tools, projects, and models. Ever Brain fixes this.

Every time you start a new AI session, switch from Claude to Cursor, change tools, resume an old project, or hit usage limits โ€” the new AI instance loses everything: project understanding, architecture decisions, workflow continuity, coding preferences, active tasks, and operational memory.

Brain creates persistent, portable cognition layers shared between you and your AI agents through a markdown-based filesystem protocol. The agents remain the intelligence. Brain preserves continuity.


What Brain Is (and Isn't)

Brain is not a chatbot, note-taking app, memory SaaS, or AI coding assistant.

Brain is a filesystem-based continuity infrastructure layer for AI-assisted development.

What you get What you avoid
Persistent memory across sessions No databases or vector stores
Portable across AI tools & models No cloud infrastructure
Fully local, user-owned data No vendor lock-in
Markdown โ€” human & AI readable No proprietary formats
Git-compatible versioning No background daemons

Quick Start

Prerequisites

  • Python 3.11+
  • pip

Install

# Clone the repository
git clone https://huggingface.co/spaces/projectsorg/ever-brain
cd ever-brain

# Install globally (editable mode)
pip install -e .

First Brain in 60 Seconds

# 1. Create a Brain Instance
brain create my-brain

# 2. Activate it
brain use my-brain

# 3. Navigate to any project
cd ~/projects/my-app

# 4. Attach the project to your Brain
brain attach

# 5. Start working with any AI agent โ€” they'll discover Brain automatically

# 6. When done, sync your Brain state
brain sync

# 7. Optionally, disconnect the workspace
brain detach

Run brain with no arguments to see system status at any time:

Brain Status

> Active Brain:      my-brain
> Brain Path:        C:\Users\you\brains\my-brain
> Attached Project:  my-app
> Brain Version:     v2
> Workspace Runtime: Connected

Architecture

Brain consists of three distinct layers:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Brain System (CLI)              โ”‚  โ† Management, lifecycle, protocol
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚           Brain Instance (~/brains/)         โ”‚  โ† Persistent cognition storage
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚        Workspace Runtime (.brain/)           โ”‚  โ† Local project bridge
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Brain Instance โ€” Your Persistent Memory

Lives at ~/brains/<name>/. This is the source of truth for all cognition.

my-brain/
โ”œโ”€โ”€ user/                    # Your persistent identity
โ”‚   โ”œโ”€โ”€ personality.md       #   Communication style & tone
โ”‚   โ”œโ”€โ”€ preferences.md       #   Coding, architecture, tooling
โ”‚   โ””โ”€โ”€ workflows.md         #   Development habits & processes
โ”‚
โ”œโ”€โ”€ projects/                # Per-project memory
โ”‚   โ””โ”€โ”€ my-app/
โ”‚       โ”œโ”€โ”€ context.md       #   Project overview & tech stack
โ”‚       โ”œโ”€โ”€ architecture.md  #   System design & structure
โ”‚       โ”œโ”€โ”€ decisions.md     #   Architecture decision records
โ”‚       โ”œโ”€โ”€ tasks.md         #   Active, pending, completed tasks
โ”‚       โ”œโ”€โ”€ handoff.md       #   Session continuity state
โ”‚       โ”œโ”€โ”€ docs/            #   Additional documentation
โ”‚       โ”œโ”€โ”€ logs/            #   Operational logs
โ”‚       โ””โ”€โ”€ agents/          #   Per-agent project logs
โ”‚
โ”œโ”€โ”€ agent-configs/           # Agent discovery protocols
โ”‚   โ”œโ”€โ”€ .cursorrules         #   Cursor auto-discovery
โ”‚   โ””โ”€โ”€ CLAUDE.md            #   Claude auto-discovery
โ”‚
โ”œโ”€โ”€ agents/                  # Per-agent operational history
โ”‚   โ”œโ”€โ”€ claude/
โ”‚   โ”œโ”€โ”€ cursor/
โ”‚   โ””โ”€โ”€ codex/
โ”‚
โ”œโ”€โ”€ skills/                  # Reusable workflow conventions
โ”‚   โ”œโ”€โ”€ coding-style.md
โ”‚   โ””โ”€โ”€ debugging.md
โ”‚
โ”œโ”€โ”€ raw/                     # Imported unstructured context
โ”œโ”€โ”€ versions/                # Sync snapshots (v1, v2, ...)
โ”‚   โ””โ”€โ”€ snapshot-1/
โ””โ”€โ”€ AGENT.md                 # Brain protocol definition

Workspace Runtime โ€” The Bridge

The .brain/ directory injected into your project is a lightweight, disposable bridge โ€” not storage. It links agents to your Brain Instance.

project/.brain/
โ”œโ”€โ”€ AGENT.md           # Generated workspace-specific protocol
โ”œโ”€โ”€ BRAIN.json         # Machine-readable metadata
โ”œโ”€โ”€ linked_brain       # Path to active Brain Instance
โ””โ”€โ”€ current_project    # Attached project identity

CLI Reference

Command Description
brain Show system status (default)
brain create <name> Create a new Brain Instance at ~/brains/<name>/
brain use <name> Set the active Brain Instance globally
brain import Inject .brain/ runtime into the current workspace
brain attach Register the workspace as a project in the active Brain (auto-imports if needed)
brain sync Create a versioned snapshot of the current Brain state
brain detach Remove the .brain/ runtime from the workspace
brain delete <name> Permanently delete a Brain Instance (--force to skip confirmation)
brain status Display active brain, project, version, and runtime state
brain connect (Placeholder) Future Supabase cloud sync integration

Examples

# Create and switch between multiple brains
brain create work-brain
brain create personal-brain
brain use work-brain

# Delete a brain you no longer need
brain delete personal-brain

# Check what's active
brain status

# Full workflow: attach, work, sync, detach
brain attach
# ... do your work with AI agents ...
brain sync
brain detach

How It Works With AI Agents

Brain operates on a simple contract: agents maintain Brain, Brain maintains continuity.

Agent Protocol

When an AI agent discovers .brain/AGENT.md in a workspace, it:

  1. Reads user context from user/ to understand your preferences
  2. Reads project memory from projects/<project>/ to resume continuity
  3. Follows the handoff protocol: read handoff โ†’ work โ†’ update handoff
  4. Records architecture decisions in decisions.md
  5. Updates tasks.md as work progresses
  6. Writes session logs to agents/<agent-name>/

Auto-Discovery

Agents discover Brain automatically through standard configuration files:

  • Cursor โ†’ reads .cursorrules โ†’ finds .brain/
  • Claude โ†’ reads CLAUDE.md โ†’ finds .brain/
  • Others โ†’ discovers .brain/AGENT.md in workspace root

No manual prompting required. Agents self-identify and operate within their own directories by convention.


Core Design Principles

Principle Implementation
Persistent Continuity Brain persists independently of projects, sessions, and tools
Agents Maintain Brain AI agents read/write cognition; users just work normally
Markdown Is The Protocol Everything is markdown, filesystem-based, git-compatible
Local-First Ownership Fully local, user-owned, inspectable, and portable
Convention Over Configuration Agents self-identify; no runtime enforcement needed

Tech Stack

Component Technology
Language Python 3.11+
CLI Framework Typer
Terminal Rendering Rich
Storage Markdown (filesystem)
Versioning Local snapshots (shutil.copytree)
Config JSON (~/.brainconfig)
Packaging pyproject.toml + pip install -e .

Project Structure

brain-base/
โ”œโ”€โ”€ pyproject.toml                # Package config & dependencies
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ brain/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cli.py                    # Typer app + command registration
โ”‚   โ”œโ”€โ”€ config.py                 # Global config (~/.brainconfig)
โ”‚   โ”œโ”€โ”€ paths.py                  # Cross-platform path resolution
โ”‚   โ”œโ”€โ”€ commands/
โ”‚   โ”‚   โ”œโ”€โ”€ create.py             # brain create <name>
โ”‚   โ”‚   โ”œโ”€โ”€ use.py                # brain use <name>
โ”‚   โ”‚   โ”œโ”€โ”€ status.py             # brain status
โ”‚   โ”‚   โ”œโ”€โ”€ import_brain.py       # brain import
โ”‚   โ”‚   โ”œโ”€โ”€ attach.py             # brain attach
โ”‚   โ”‚   โ”œโ”€โ”€ sync.py               # brain sync
โ”‚   โ”‚   โ”œโ”€โ”€ detach.py             # brain detach
โ”‚   โ”‚   โ”œโ”€โ”€ delete.py             # brain delete <name>
โ”‚   โ”‚   โ””โ”€โ”€ connect.py            # brain connect (placeholder)
โ”‚   โ”œโ”€โ”€ templates/
โ”‚   โ”‚   โ”œโ”€โ”€ brain_instance.py     # Brain Instance scaffolding
โ”‚   โ”‚   โ”œโ”€โ”€ project_memory.py     # Project memory templates
โ”‚   โ”‚   โ”œโ”€โ”€ workspace_runtime.py  # .brain/ runtime generation
โ”‚   โ”‚   โ””โ”€โ”€ agent_protocol.py     # AGENT.md generation
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ git.py                # Git remote/identity detection
โ”‚       โ””โ”€โ”€ display.py            # Rich console helpers
โ””โ”€โ”€ creationdoc/                  # Design documents & specifications

Roadmap

  • Core CLI (create, use, status, import, attach, sync, detach)
  • Brain Instance scaffolding with templates
  • Workspace runtime bridge
  • Project memory with auto-detection (git remote โ†’ folder name โ†’ cwd)
  • Local version snapshots
  • brain delete with confirmation
  • Supabase cloud sync (brain connect โ€” placeholder exists)
  • Cross-device synchronization
  • Team collaboration & shared brains
  • Brain export/import between machines
  • Plugin system for custom agent protocols

Philosophy

The intelligence comes from the agents. The continuity comes from Brain.

Brain doesn't replace your AI tools. It makes them coherent. Every agent you use โ€” Claude, Cursor, Copilot, Codex โ€” reads from the same persistent memory and writes back to it. Context is never lost. Decisions are never forgotten. Handoffs happen automatically.

Your Brain is yours. It's markdown files on your filesystem. No vendor owns it. No cloud stores it. No subscription gates it. You can read it, edit it, version it with git, and carry it anywhere.


License

Open Source. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ever_brain_cli-0.1.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ever_brain_cli-0.1.0-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

Details for the file ever_brain_cli-0.1.0.tar.gz.

File metadata

  • Download URL: ever_brain_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ever_brain_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f8abe8b6792196e9ed96f3ee8c6dd9f407f58344f178e72c713eaf992889a859
MD5 f2e5d23341f022234e6047c7c07520ea
BLAKE2b-256 d15911b4e21cc828fa963679093b7eecbdd0442ede5bf14f032c992c5e97cd86

See more details on using hashes here.

File details

Details for the file ever_brain_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ever_brain_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ever_brain_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94106ebfc63dbaeaf218641ad84497065c3417e55a16f5dd2194ce2394d347c5
MD5 94a1747ae9c8fcf6e4e5377f3160af96
BLAKE2b-256 6170fd727b8b4c541aa360c2678eb0fa465066b8e448241679975c00cdd32d6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page