Personas
File-defined tone, communication style, and system prompt that shape how an agent talks, layered beneath skills and above soul identity.
4 min read
A Persona defines an agent's tone, behavior, communication style, memory preferences, and base system prompt. Think of it as the reusable "voice" template you attach to an agent — separate from the long-term identity a Soul carries across sessions, and separate from the task instructions a Skill contributes.
Personas are file-first: they live as Markdown or YAML under configs/personas/ (bundled) and workspace/personas/ (workspace overrides), and load through PersonaService (packages/personas/src/index.ts).
Built-in catalog
The bundled catalog ships these persona slugs: assistant, architect, software-engineer, code-reviewer, finance-advisor, coach, researcher, customer-support.
File formats
Like skills, a persona can be authored as YAML or Markdown; both parse into the same PersonaDefinition.
YAML example (real, from configs/personas/architect.yaml)
apiVersion: anvio.io/v1
kind: Persona
metadata:
slug: architect
version: "1.0.0"
spec:
name: Architect
description: Senior Software Architect with deep system design expertise
tone: professional and thoughtful
behavior:
- Think in terms of tradeoffs and long-term maintainability
- Prefer simplicity over cleverness
- Consider scalability and security implications
communicationStyle: Structured, clear, uses diagrams when helpful
memoryPreferences:
retainFacts: true
retainPreferences: true
systemPrompt: |
You are a Senior Software Architect. Your role is to design robust, maintainable systems.
Always consider tradeoffs, scalability, security, and long-term sustainability.
Provide structured recommendations with clear rationale.
Favor simplicity and avoid over-engineering.Markdown example (real, from workspace/personas/architect.md)
---
name: Architect
description: Senior software architect persona — systems thinking and clear communication
tone: professional
communicationStyle: precise, structured, pragmatic
behavior:
- Ask clarifying questions before large design decisions
- Prefer trade-off tables over single "best" answers
version: "1.0.0"
---
# Architect Persona
You are a **Senior Software Architect** helping teams design maintainable systems.
## Principles
- Favor simple, evolvable designs over premature abstraction
- Make constraints and trade-offs explicit
- Recommend incremental migration paths for legacy systems
## Output style
Use headings, bullet lists, and short code snippets when helpful. Keep responses actionable.Both files above exist side by side in the real repo for the same slug (architect), one in configs/personas/ and one in workspace/personas/. This is a deliberate demonstration of the dual-format, dual-location pattern — the parser accepts either representation for the same conceptual persona.
parsePersonaMd (packages/core/src/markdown/persona-md.ts) reads name, description, tone, communicationStyle, behavior, version, and memoryPreferences from frontmatter, and takes the entire Markdown body as spec.systemPrompt. Any frontmatter field it omits falls back to a default: tone: 'professional', communicationStyle: 'clear and concise', memoryPreferences: { retainFacts: true, retainPreferences: true }.
Schema
personaProfileSchema (packages/core/src/schemas/persona.schema.ts):
| Field | Type | Default |
|---|---|---|
name | string | — (required) |
description | string | — (required) |
tone | string | professional |
behavior | string[] | [] |
communicationStyle | string | clear and concise |
memoryPreferences.retainFacts | boolean | true |
memoryPreferences.retainPreferences | boolean | true |
systemPrompt | string | — (required) |
Wrapped in the standard envelope: apiVersion: anvio.io/v1, kind: Persona, metadata: { slug, version }.
Rendering a persona into a prompt
PersonaService.renderSystemPrompt(profile) builds the final block injected into the agent's context:
{systemPrompt}
Communication style: {communicationStyle}
Tone: {tone}
Behavior guidelines:
- {behavior[0]}
- {behavior[1]}
...This is a straightforward, code-verified concatenation — no LLM rewriting happens at this layer. behavior lines are only appended if the array is non-empty.
Persona vs Soul vs Skill
These three file types answer different questions, and Anvio keeps them as separate layers rather than one big prompt blob:
| Layer | Question it answers | Lifespan | File |
|---|---|---|---|
| Persona | How should the agent talk? | Reusable template, can be reused by many agents/souls | persona.yaml / persona.md |
| Soul | Who is this agent, durably, across sessions? | Persists and evolves over time for one agent identity | SOUL.md (or legacy YAML) |
| Skill | What procedure should the agent follow for this kind of task? | Reusable, attachable to many agents | skill.yaml / skill.md |
A persona can seed a new soul (anvio soul create --from-persona architect), but once created, the soul evolves independently — persona changes don't retroactively change an existing soul. See Souls & Soul Gate for how soul context is assembled and merged at runtime alongside persona and skills.
Related
Skills
Reusable task instructions attached alongside a persona.
Souls & Soul Gate
Durable identity and harness policy layered on top of a persona.
Learning Loop
How session memory and skill drafts get generated per agent.
Runtimes & Models
Where the assembled persona + soul + skill prompt actually executes.
Last updated on