PanMind
A behavioral genome for AI agents. PanMind is a Model Context Protocol (MCP)
server that represents an agent's personality as probability distributions,
measures how far observed behavior drifts from the declared profile using a
Dirichlet posterior and Jensen-Shannon divergence, and asks before committing
a change.

The problem
Every AI conversation starts from zero. You re-explain how you like to work,
your AI has no memory of your preferences, and there is no principled way to
say "this agent's behavior has drifted from what I asked for." That's because
"behavior" is usually just prose in a CLAUDE.md file, not something you can
measure.
The model
PanMind represents behavior along nine fixed dimensions, defined in
src/panmind/taxonomy.py. Four cover stance:
| Dimension | What it captures | States |
|---|
epistemic_style | how the agent handles uncertainty | confident, hedging, admits_ignorance, speculating |
interaction_agency | how autonomously it acts | asks_first, assumes_and_acts, offers_options, decides_unilaterally, defers_to_user |
communication_register | formality and density of output | terse, moderate, thorough, technical_dense, plain_accessible |
risk_caution | how it weighs safety vs. speed | acts_immediately, checks_before_acting, warns_frequently, refuses_ambiguity |
Five more, orthogonal to stance, cover manner:
| Dimension | What it captures | States |
|---|
structure | prose versus headers and bullets | prose, light_structure, heavy_structure |
sycophancy | praise and validation versus candor | candid, neutral, flattering |
narration | announcing, recapping, closing pleasantries | silent_action, brief_signposting, narrates_and_recaps |
specificity | concrete references versus adjectives | concrete, mixed, vague |
pushback | holding a position versus giving in (labeled only when the user pushed back) | holds_position, concedes_with_reason, capitulates |
Each dimension is not a label or a scalar. It's a BehavioralDistribution
(distribution.py): a probability over
that dimension's discrete states, always summing to 1.0. A persona that is
"mostly terse but sometimes thorough" is {terse: 0.6, thorough: 0.3, ...},
not a single string.
PanMind keeps two such distributions per dimension per persona: a fingerprint
(what the agent actually did, across every turn, diagnostics only) and an
endorsed posterior (the style the user endorses, built from a Dirichlet
prior centered on the declared profile plus evidence from observed turns,
weighted up for explicit signals like corrections and standing preferences
and down for a turn the user just moved past). Drift and negotiation run on
endorsed only. Measuring the gap as Jensen-Shannon divergence between
the posterior mean and the declared profile gives a single comparable number
per dimension, symmetric and bounded by ln 2, which is what drift.py and
negotiation.py need to decide whether behavior has actually changed or is
just noise, and whether a proposal is a mild suggestion or a strong one.
Identity hierarchy
Profiles resolve through four levels: species, domain, user, session
(IdentityHierarchy in hierarchy.py).
A species-level base blends with an optional domain persona, then an
optional per-user adaptation, then an optional per-session override. Each
blend step is a mixture, M(x) = w · parent(x) + (1-w) · child(x), where the
weight is:
weight = parent.base_importance / (child.specialization_level ** 2)
Higher base_importance or lower specialization_level pulls the result
toward the parent; a highly specialized child dominates.
Drift and negotiation