AAnvio
Skills, Personas, Souls & Learning

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):

FieldTypeDefault
namestring— (required)
descriptionstring— (required)
tonestringprofessional
behaviorstring[][]
communicationStylestringclear and concise
memoryPreferences.retainFactsbooleantrue
memoryPreferences.retainPreferencesbooleantrue
systemPromptstring— (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:

LayerQuestion it answersLifespanFile
PersonaHow should the agent talk?Reusable template, can be reused by many agents/soulspersona.yaml / persona.md
SoulWho is this agent, durably, across sessions?Persists and evolves over time for one agent identitySOUL.md (or legacy YAML)
SkillWhat procedure should the agent follow for this kind of task?Reusable, attachable to many agentsskill.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.

Edit on GitHub

Last updated on

On this page