Brain & Persona
Alice has two pieces of persistent state that the system prompt assembles together on every request. Persona defines who she is. Brain stores notes she's written to herself across rounds. They are independent subsystems that happen to be co-located on disk under data/brain/.
Persona
The persona is a Markdown file that becomes the opening of Alice's system prompt. It defines her identity and speaking style.
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, more cautious — whatever suits your style. The Web UI's settings panel exposes a persona editor that PUTs to the same file.
The persona is re-read from disk on every generation, so edits take effect on the very next message.
Brain
The brain is a single-purpose system: a git-like log of frontal-lobe updates. It stores Alice's personal notes — the rules, attention targets, and self-constraints she's committed to across rounds.
An older version of the brain also tracked emotion. That dimension was removed (see
src/domain/brain/types.ts) — emotional framing pollutes future reasoning when it goes stale, and was deleted in favor of a stricter discipline around what the notes are allowed to contain.
Frontal lobe
The frontal lobe is one string. It's the only thing Alice can write to brain. Each updateFrontalLobe call replaces the previous content entirely and creates a commit so the system prompt can render "you wrote this Nh ago" — the time-distance cue stops Alice from treating a stale note as ground truth.
Writing discipline
The frontal lobe enforces a strict rule that's surfaced in the tool descriptions: notes must be about her (commitments, attention targets, self-constraints, operating stances) and not about the world (facts, predictions, market state, emotion).
The reason: world-referring content goes stale between rounds and silently corrupts future reasoning. Self-referring content stays valid until she chooses to change it.
| Allowed | Not allowed | |
|---|---|---|
| Conditional rules | "If ETH reclaims 3800, add 10% to the long" | "ETH will reclaim 3800" |
| Events being watched | "FOMC Thursday 14:00 — check policy signal" | "FOMC will be hawkish" |
| Self-constraints | "No new entries until macro clarity" | "Market is unclear" |
| Operating stances | "Running under consolidation assumption for BTC range" | "BTC is consolidating" |
Predictions, market state, derivable facts ("position is +15% PnL"), and emotional framing ("feeling confident") are all explicitly forbidden — they come from tool calls or never belong in the prompt at all.
Brain tools
Three tools, one for read, one for write, one for history:
| Tool | Purpose |
|---|---|
getFrontalLobe | Read the current note. Use at the start of a round to recover prior decisions. |
updateFrontalLobe | Replace the note (creates a new commit). |
getBrainLog | View recent commits — a timeline of how rules and stances have evolved. |
Commit chain
Every updateFrontalLobe call 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": "If ETH reclaims 3800, add 10%...",
"stateAfter": {
"frontalLobe": "If ETH reclaims 3800, add 10% to the long. Waiting on FOMC Thursday 14:00..."
}
}
The full chain is persisted in data/brain/commit.json. On startup the brain is restored from this file. Legacy emotion-type commits in older brain exports are stripped during restore so downstream code sees a uniform shape.
How they're combined
On every generation, Alice's system prompt is built like this:
[persona.md content]
---
## Notes you wrote to yourself
_(written 2h ago)_
[current frontal lobe content]
If the frontal lobe is empty, only the persona ships. The relative-age line is computed from the most recent commit timestamp.
Persistence
| File | Purpose |
|---|---|
data/brain/persona.md | Your customized persona (gitignored) |
data/brain/commit.json | Full brain export — all commits, head pointer, current state |
data/brain/frontal-lobe.md | Human-readable mirror of the current note (rewritten on each commit) |
data/brain/heartbeat.md | Your customized heartbeat prompt (gitignored, separate from brain) |
Evolution Mode
Evolution mode is a permission escalation toggle that controls what Alice can access on your machine. It lives in data/config/agent.json and is independent from brain/persona — it only affects tool permissions.
Off (default):
- Alice's working directory is sandboxed to
data/brain/ - She can read and write her own state files (Read, Write, Edit, Glob, Grep, WebSearch, WebFetch)
- Bash is blocked
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
{
"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.