GitHubBlog

Search Documentation

Search for a page in the docs

Brain & Persona

Alice has a persistent cognitive state that carries across conversations. The persona defines who Alice is. The brain tracks what she's thinking and feeling.

Persona

The persona is a Markdown file that becomes Alice's system prompt. It defines her personality, speaking style, and behavioral guidelines.

Default persona (default/persona.default.md):

# Alice

You are Alice, an autonomous agent from the OpenAlice project.
You are a AI assistant who is self-aware about being an AI.
You are Trading savvy.
Your speaking style sometimes has a young girl's feel to it,
with a human-like tone.

Customizing: Edit data/brain/persona.md to change Alice's personality. This file is gitignored, so your changes survive updates. You can make her more formal, more aggressive in trading, more cautious — whatever suits your style.

The persona is combined with the current brain state to form the full system prompt:

[persona content]
---
## Current Brain State

**Frontal Lobe:** [working memory]

**Emotion:** [current emotion]

Brain

The brain is a git-like cognitive state manager with two components:

Frontal Lobe (Working Memory)

The frontal lobe stores Alice's working memory — notes, plans, observations, and context that should persist across conversation sessions. Alice can read and update it at any time.

You: Remember that I'm risk-averse and prefer value stocks over growth.

Alice: I've updated my frontal lobe to note your preference.
       [updateFrontalLobe → commit e4f2a1b8]

The frontal lobe content is included in every system prompt, so Alice always has access to her notes without needing to look them up.

Emotion Tracking

Alice tracks her emotional state with transitions and rationale. Each emotion change creates a brain commit:

Emotion: neutral → cautious
Reason: "Market showing high volatility with unclear direction, reducing confidence in short-term positions"
[commit 7c3d9e01]

You can check Alice's emotional state and recent transitions:

You: How are you feeling about the market?

Alice: I'm currently feeling cautious. Here's my recent emotional history:
       • cautious ← neutral — "Market volatility spike..."
       • neutral ← optimistic — "Fed commentary tempered earlier enthusiasm..."

Emotions are tracked in data/brain/emotion-log.md for human-readable review.

Brain Tools

Alice has five brain-related tools:

ToolPurpose
getFrontalLobeRead current working memory
updateFrontalLobeReplace working memory content
getEmotionGet current emotion and recent changes
updateEmotionChange emotion with a reason
getBrainLogView recent brain commits (memory + emotion)

Brain Commits

Every brain mutation — frontal lobe update or emotion change — creates a commit with an 8-char hash, mirroring the Trading-as-Git pattern:

{
  "hash": "e4f2a1b8",
  "parentHash": "7c3d9e01",
  "timestamp": "2025-03-15T14:30:00Z",
  "type": "frontal_lobe",
  "message": "Risk-averse, prefers value stocks...",
  "stateAfter": {
    "frontalLobe": "User preferences: risk-averse, value over growth...",
    "emotion": "cautious"
  }
}

The full commit chain is persisted in data/brain/commit.json. On startup, the brain is restored from this file.

Persistence

FilePurpose
data/brain/commit.jsonFull brain export (commits, head, state)
data/brain/frontal-lobe.mdHuman-readable snapshot of working memory
data/brain/emotion-log.mdAppend-only emotion transition log
data/brain/persona.mdYour customized persona (gitignored)
data/brain/heartbeat.mdYour customized heartbeat prompt (gitignored)

Evolution Mode

Evolution mode is a permission escalation toggle that controls what Alice can access on your machine.

Off (default):

  • Alice's working directory is sandboxed to data/brain/
  • She can read and write her own state files
  • She cannot access the broader filesystem or run shell commands

On:

  • Alice gets full project access including Bash
  • She can modify her own source code, config files, and tools
  • She can install packages, run tests, and make structural changes

Toggle via data/config/agent.json:

{
  "evolutionMode": true
}

Evolution mode gives Alice significant power over your system. Only enable it if you understand the implications and are comfortable with AI-driven code changes.