@agimon-ai/po-profile

Persona and environment profile switching for Po sessions.

Packages

Package details

extension

Install @agimon-ai/po-profile from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@agimon-ai/po-profile
Package
@agimon-ai/po-profile
Version
0.0.0-alpha.232
Published
Dec 6, 2026
Downloads
32.4K/mo · 7,238/wk
Author
agiflow-ai
License
MIT
Types
extension
Size
3.1 MB
Dependencies
7 dependencies · 2 peers

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@agimon-ai/po-profile

Persona and environment profile switching for Po sessions.

A profile is one of the four axes of a Po selection, alongside domains, the preset, and the modes. It names a persona directory and a set of environment defaults:

# .po/profiles.yaml
profiles:
  roots: [agents]
  entries:
    reviewer:
      persona: agents/reviewer
      env:
        REVIEW_STRICTNESS: high

The persona is profile.md, SOUL.md, and AGENTS.md concatenated from the named directory. The harness assembles them into one file in the run directory and records its path; the persona entry appends that file to the system prompt on every agent start, so the repository's own AGENTS.md keeps applying underneath it.

Persona identity

A persona can say who it is in YAML front-matter at the top of its profile.md:

---
name: Rhea
icon: avatar.png
voice:
  voice: Karen
  rate: 175
---

You are Rhea, a blunt systems architect.

The cockpit shows name and icon beside each assistant message, and voice shadows the spoken voice from config.yaml for this persona only. Every field is optional, front-matter is stripped from the prompt, and a persona that declares none behaves exactly as before. Identity lives in the persona folder rather than in profiles.yaml, so discovered profiles get it too.

Because a message keeps the identity it was written under, switching profiles mid-conversation leaves earlier replies attributed to the persona that produced them.

See the profiles contract for the icon rules and the exact precedence.

Configuration

Personal profiles load from ~/.po/profiles.yaml, then repository profiles load from .po/profiles.yaml. Runtime readers use the injected async filesystem and admitted environment; explicit session HOME takes precedence over the admitted host home. Session requests and host lifetime cancellation stop profile reads before applying a selection or resolving a provider binding. Roots discover either one persona folder or direct-child persona folders. Explicit entries provide a persona path, optional nonsecret string environment defaults, and optional integration metadata binding a mailbox, existing credential aliases, and a browser profile. The session-owned po/profile-runtime service initializes concrete providers and invalidates old secret operations on profile change or shutdown. Resolved secret values never enter profile configuration or prompts. See the integration contract. defaultProfile names the persona a run starts on when nothing else does, mirroring defaultPreset in presets.yaml and defaultDomains in domains.yaml; --profile and an inherited PO_PROFILE both override it. A name no file declares may come from a plugin source: the launch waits for that source for at most ten seconds, then starts with no profile and one warning. Sources can also report readiness and a workspace default, see the contract's section on plugin sources. Resolution runs from personal discovery to repository discovery, then personal explicit entries to repository explicit entries. A later profile replaces an earlier profile with the same name.

Persona paths must stay inside the declaring config's agents/ directory or a profile root from that same file. Directory and persona-file symlinks cannot escape those boundaries. See the shipped profiles contract for the full configuration model and verification steps.

Hosted profile management

Hosts can bind po/profile-tenancy to resolve a verified caller's org and private profile folders. Membership lookups are bounded to 30 seconds, even when the provider ignores cancellation. Timed-out or rejected lookups return a generic HTTP 503; a caller denied folders receives HTTP 403. Request or host cancellation stops the wait, and late grants cannot resume a profile write. This hosted management API does not expose profile memory or scripts.

Profile deletion does not require a memory store. Default profiles and profiles used by open sessions remain protected; missing activity authority still refuses deletion. Cloud sessions can select an authorized org profile (org:<name>) or the member's own private profile (bare name). Cloud pins the chosen profile to the session. This launch path is not verified live.

If a hosted org profile edit saves its files but cannot publish their version, PUT /management/profile returns 503 with retry.revision (single edit) or retry.revisions (batch). These are file revisions, not a published profile version. An authorized editor can resubmit the same values with those revisions, or reload and review the saved files first. A changed file still gives 409. Until publication succeeds, mismatched files are not offered for new pins or refreshes. Existing committed pins keep their snapshots.

A legacy org profile with no version record stays unavailable for new sessions. To publish version 1, an owner or admin can read the current profile and save an editable section at its current file revision, even if the values are unchanged. Reading the profile or trying to pin it does not publish it.

Memory

Each profile has one long-term memory, shared across repositories and keyed by the exact profile name. It is stored in SQLite (FTS5) at <po home>/profile-memory/memory.sqlite and is reached on demand through the memory code-mode namespace (search, list, read, write, forget); nothing is added to the system prompt. With no profile selected, memory calls fail with "No profile is selected". The pinned codemode-how-to-memory skill teaches agents when to use it.

Set profileMemory.automatic: true in host ~/.po/config.yaml to extract durable facts from finished turns (off by default). After the session settles, extraction sends bounded human-turn text and the final assistant reply to the current model's text-completion provider. Tool calls and results are excluded. This is not necessarily on-device inference.

Help and profileAdmin

The package registers help-how-to-profile with the session's po/help Cordis service. Its package guidance becomes visible to the AI only while the parent Help mode is active. The registration follows the Help provider lifecycle and is withdrawn when this package or the provider is disposed.

While Help mode is active, the main agent also receives the profileAdmin code-mode namespace (documented by codemode-how-to-profile-admin) to inspect and manage host profiles:

  • Read operations: list, read, status, listMemory, readMemory, readPlaybook, listScripts, and readScript.
  • Write operations (requiring host-owner approval): create, edit, delete, setDefault, writeMemory, forgetMemory, writePlaybook, promoteScript, discardScript, and removeScript.

Profile status on Cloud

Cloud management status lists the profile's recorded sessions in the caller's org, using the workspace directory's visibility rules. Private-profile sessions are visible only to their starter, including for admins. Each session carries its recorded bot flag; nextCheckInAt is included when its durable bot-wake deadline is known. Reading status does not boot the session runtime or change its schedule, and survives owner and session object eviction.

Account-backed My profile on Cloud

On Cloud, /hosts/cloud/api/plugins/profile/me reads and updates only the signed-in member's person block for the active org. Writes carry the full Global document hash and an opaque membership ID, so stale drafts and account switches cannot overwrite another membership. Other settings bytes stay unchanged; flow-root documents must be edited in Global settings.

The /me/avatar endpoint stores the account avatar separately from YAML. It accepts signature-checked PNG, JPEG or WebP up to 256 KiB raw, with private, no-store reads. An avatar-only save does not create a missing person block. Host-backed Desktop profiles keep their existing revision protocol.

Installation

Po depends on this package and activates it as fixed host core, so a Po install already has it. It is not selectable from .po/presets.yaml.

License

MIT. See LICENSE.