Personas¶
A persona gives a brain a role the agent can adopt on request: a voice, an intent, rules, a set of skills and a memory of its own. This page describes how personas are stored, how they reach each client, what the server enforces, and the HTTP surface used to manage them.
What a persona is¶
A persona is a record attached to one brain. It is rendered into a short text block that the agent adopts. The block is built by the server, deterministically and without any model call; its field labels are in French whatever the persona's own language.
| Field | Content | Constraint |
|---|---|---|
slug |
Identifier, also the value of the persona= memory tag |
Kebab-case, 2 to 40 characters (^[a-z0-9][a-z0-9-]{1,39}$); cannot change after creation |
name |
Display name | Required, at most 80 characters |
role |
What the persona is | At most 600 characters |
voice |
Object: address (tu or vous), tone, register, language (two-letter code), format_hints |
All keys optional |
intent |
What the persona is trying to achieve | At most 400 characters |
rules |
Object with two lists, do and dont |
At most 12 entries of 160 characters per list |
scope |
voice (default) or full; see Scope |
|
skills |
Slugs of skills stored on the same brain | At most 8 |
avatar_url |
Set when the persona is installed from the marketplace | Only a relative path /static/marketplace/<source>/<id>.webp is accepted |
The rendered block is capped at 1,800 characters. When a persona exceeds it, the rule lines are shortened first; role, voice and intent are kept.
One active persona per brain¶
At most one persona is active on a brain at any time. Activating a persona deactivates the previous one in the same transaction, so a brain is never left with two active personas.
Activation is an act of the agent, on the user's explicit request. It goes through MCP tools only:
| Tool | Arguments | Effect |
|---|---|---|
list_personas |
none | Returns the brain's personas (slug, name, shortened role, voice, skills) and which one is active |
activate_persona |
slug |
Activates the persona and returns its full block, which the agent adopts for the rest of the conversation. An unknown slug returns a JSON-RPC error -32602 listing the known slugs, and changes nothing |
deactivate_persona |
none | Deactivates the active persona |
get_skill |
slug |
Returns the full SKILL.md body of a skill |
These four tools are served by Spongram itself and are added to tools/list only when personas
are enabled. See the tools reference for the complete MCP surface.
With the Cloud control plane, on a brain whose access mode is enforce, list_personas and
get_skill require the memory.read right; activate_persona and deactivate_persona require
brain.configure and memory.read.
There is no HTTP activation route
No route of the user API or of the admin API activates or deactivates a persona, and no import, marketplace installation or brain restore does either. The Personas page shows the active persona as activated from the agent. This keeps the decision with the person talking to the agent.
The active persona is read from a per-process cache refreshed at most every 60 seconds per brain and invalidated by any persona or skill write handled by the same process.
How the block reaches each client¶
| Channel | What is sent |
|---|---|
Result of activate_persona |
The full block, always, including the summary described below |
MCP initialize |
The block is appended to the server instructions |
tools/list |
A one-line preamble naming the active persona and its voice is prefixed to the descriptions of add_memory, search_nodes and search_memory_facts |
GET /v1/personas/data/active?variant=code |
The block for coding clients; the Claude Code plugin reads it when a session starts |
The initialize channel selects a variant from the X-Spongram-Client request header, which the
Claude Code and Codex plugins set to claude-code or codex. The header only selects what is
rendered; it grants nothing.
Scope: voice or full¶
Coding clients must keep following the project's own conventions, so they receive a reduced block by default.
| Client | Persona scope: voice |
Persona scope: full |
|---|---|---|
| Claude Code, Codex (passive channels) | Priority preamble, name, voice line, memory rule | Priority preamble, then the full block, without the summary |
| Any other MCP client (passive channels) | Full block | Full block |
Any client, result of activate_persona |
Full block | Full block |
The priority preamble is one sentence stating that the project's conventions and the coding
client's development instructions take precedence over the persona. The full block adds the role,
the intent, the do and dont rules and the list of skills (one line per skill, loaded on demand
with get_skill).
A persona never changes a client's tools, permissions or output style.
Persona memory and the persona= tag¶
The block ends with a memory rule: what the agent learns in this role is tagged
persona=<slug> in source_description, next to the usual project= tag (see
tagging and scope).
The server validates that tag on every add_memory call and never adds it:
- a
persona=tag equal to the active persona's slug is kept, once; - any other
persona=tag is removed; - with no active persona, every
persona=tag is removed.
When read scoping is enabled, search results whose source episodes carry the active persona's tag
are placed first, and results that belong only to another persona are dropped unless the caller
passes scope.all. The details are in search.
The "what I already know" summary¶
The Sleeper compiles, for each persona, a short summary of what that persona
has learned, from the most recent episodes tagged persona=<slug> (up to 40). The summary is
written in the persona's voice language when it is French, English, German, Spanish or Italian
(otherwise in the language of the episodes), limited to 120 words and 900 characters, and
recompiled only when that set of source episodes changes.
The summary is appended to the full block only. A coding client never receives it through a
passive channel, even for a persona with scope: full; it sees it in the result of
activate_persona.
This pass has its own flag because it costs model calls. SPONGRAM_PERSONA_SUMMARY_MAX_PER_TICK
(default 5) bounds the number of personas examined per Sleeper tick.
Skills¶
A persona skill is a SKILL.md document in the Agent Skills format: YAML front matter with a
name (a kebab-case slug, which becomes the skill's identifier) and a description, followed by
the instructions. A skill is unique per brain and slug, and can be referenced by several personas.
Deleting a skill removes it from every persona that referenced it.
Skills reach the agent in two ways:
- On demand. The full block lists each skill of the active persona with its description; the
agent calls
get_skillwhen the task matches. - In the Claude Code plugin bundle. When a plugin bundle is generated for a brain, every skill
referenced by at least one persona is written to
skills/persona-<slug>/SKILL.md, and its description is prefixed with a sentence saying that it belongs to that persona and applies only while the persona is active. Persona skills are never added to the Claude Desktop.mcpbbundle.
Importing a skill from a URL¶
POST /v1/personas/data/skills/import with {"url": "..."} fetches a SKILL.md and stores it
with the source import:<url>. The fetch is restricted:
| Rule | Value |
|---|---|
| Scheme | https:// only, for the URL and for every redirect target |
| Redirects | At most 3, followed one by one |
| Size | 32 KB, checked on Content-Length and again while reading |
| Content type | text/* or a type containing markdown |
| Encoding | UTF-8 |
| Timeout | 10 seconds |
Any violation returns 422. The document is never executed.
Limits per brain¶
| Limit | Value |
|---|---|
| Personas | 20 |
| Skills | 50 |
| Skills per persona | 8 |
SKILL.md size |
32,768 bytes |
Exceeding a limit returns 422.
The Personas page¶
GET /v1/personas serves a single-file page for managing a brain's personas and skills. It
follows the same pattern as the Cortex and Wiki pages: the interface language is
selected with ?lang=fr or ?lang=en (default fr), and the page takes the brain key from the
URL fragment (#key=spt_brain_xxx) or asks for it, keeps it in the tab's session storage, and
sends it as a bearer token on every data call. In the desktop edition no key is requested.
The page returns 404 while personas are disabled.
The page calls the JSON routes below. All of them require the brain key
(Authorization: Bearer spt_brain_xxx) and return 404 while personas are disabled.
| Method and path | Purpose |
|---|---|
GET /v1/personas/data/active |
Active persona and its rendered block; ?variant=code renders the coding-client variant (default full) |
GET /v1/personas/data/personas |
List personas |
GET /v1/personas/data/personas/{slug} |
Read one persona |
POST /v1/personas/data/personas |
Create; 409 if the slug exists |
PUT /v1/personas/data/personas/{slug} |
Update; the slug in the body must match the path |
DELETE /v1/personas/data/personas/{slug} |
Delete |
POST /v1/personas/data/personas/import-card |
Import a Character Card V2 |
GET /v1/personas/data/personas/{slug}/card |
Export as a Character Card V2 |
GET /v1/personas/data/skills |
List skills (without bodies) |
GET /v1/personas/data/skills/{slug} |
Read one skill with its body |
POST /v1/personas/data/skills |
Create or replace a skill from a SKILL.md body |
PUT /v1/personas/data/skills/{slug} |
Update; the front matter name must equal the slug |
DELETE /v1/personas/data/skills/{slug} |
Delete |
POST /v1/personas/data/skills/import |
Import a skill from an https:// URL |
Updating a persona never changes its activation state, its activation counter or its summary.
Character Card V2 import and export¶
Personas can be exchanged as Character Card V2 documents ("spec": "chara_card_v2"), the open
format used by several character tools.
- Export maps the persona to the standard fields (
name,descriptionfor the role,personalityfor the voice line,scenariofor the intent,system_promptfor the rules) and stores the exact definition underdata.extensions.spongram(slug,voice,rules,scope,skills,avatar_url, and the summary for information). - Import accepts a JSON body only: no URL is fetched and no image is read. The body is limited
to 128 KB (
413beyond). A card that carriesextensions.spongramis restored field for field. A card from another tool is imported in a reduced form: the slug is derived from the name, the voice frompersonality, one rule fromsystem_prompt, andscopeisvoice. - An existing slug returns
409unless the request carries?replace=true, in which case the definition is updated in place. - The summary in a card is never read back, and an imported persona is never activated.
Operator mirror in the admin UI¶
Operators manage a brain's personas from the admin UI without the brain key:
GET /admin/api/spongram/instances/{id}/personasserves the same page in admin mode. The admin token travels in the URL fragment (#admin=...), which browsers do not send to the server, and the page then sends it as a bearer token on its data calls./admin/api/spongram/instances/{id}/personas/data/*mirrors the JSON routes above one for one, authenticated by the admin token. There is no activation route here either.GET /admin/api/spongram/instances/{id}/personas/summaryis a read-only overview: the active slug, the number of skills, the per-brain limits and, for each persona, its activation count, last activation time and a summary preview. With personas disabled it answers200with"enabled": false.
The number of successful activations is also exported as the Prometheus counter
spongram_persona_activations_total{instance_id, slug}.
Personas in brain dumps¶
When personas are enabled, a brain export (spongram-brain/v1) carries two optional keys,
personas and skills. The export omits the activation state, the summary and the avatar.
On import, skills are written first, then personas, in a single transaction: one invalid entry cancels the whole persona import. Imported personas are always inactive. A dump without these keys imports as before, and a dump that contains only personas and skills, with no episodes, is accepted. See ingestion for how the episodes of a dump are replayed.
Flags¶
| Variable | Code default | Server image | Effect when on |
|---|---|---|---|
SPONGRAM_PERSONAS_ENABLED |
off | on | Persona tools in tools/list, block injection, persona= tag validation, /v1/personas routes |
SPONGRAM_READ_SCOPING_ENABLED |
off | on | Search results are filtered and ordered by episode tags, including the persona rules above |
SPONGRAM_PERSONA_SUMMARY_ENABLED |
off | on | The Sleeper compiles the summary and the full block shows it; requires SPONGRAM_PERSONAS_ENABLED |
A flag is on when its value is 1, true, yes or on. The desktop app enables the same three
flags. With SPONGRAM_PERSONAS_ENABLED off, the persona tables are not read, no tool is added and
the routes answer 404. See feature flags for how to override an
image default.