| name | role-persona |
| description | Role-persona CLI for managing AI agent identity, memory, and knowledge systems. Use this skill when the user wants to: manage roles/identities, view or edit agent memory, search past learnings and preferences, export memory reports, manage knowledge bases, configure role mappings, build system prompts, or interact with the role-persona daemon. Triggers: role, memory, learnings, preferences, knowledge, identity, persona, prompt, consolidate, export, daemon, role-persona, agent memory, persistent memory.
|
role-persona Skill
CLI tool for managing AI agent identity, persistent memory, and knowledge bases.
Core Concepts
- Role: An agent identity with name, emoji, persona, and soul files. Roles live in
~/.pi/roles/.
- Memory: Persistent learnings (facts) and preferences (behavior rules) stored in Markdown files.
- Knowledge Base: Categorized documents searchable by tags and content.
- Daemon: Background HTTP server (~0.3s response) with auto-start on first CLI call.
CLI Reference
All commands output JSON by default ({ ok, data, error, message }). Add --human for formatted output.
Role Management
role-persona role list
role-persona role create
role-persona role info
role-persona role map <name>
role-persona role unmap
Memory Operations
role-persona memory add-learning "When X, do Y"
role-persona memory add-preference "Prefer Z for tasks"
role-persona memory search "query text"
role-persona memory list
role-persona memory consolidate
role-persona memory repair
role-persona memory tidy --model <m>
role-persona memory export
role-persona memory conflicts
role-persona memory log
role-persona memory build-prompt
role-persona memory extract-memory
role-persona memory flush
role-persona memory update-learning "needle" "new text"
role-persona memory update-preference "needle" "new text"
role-persona memory delete-learning "needle"
role-persona memory delete-preference "needle"
role-persona memory reinforce "needle"
Knowledge Base
role-persona knowledge list [category]
role-persona knowledge search "query"
role-persona knowledge read "path"
role-persona knowledge write "path"
Vector Embedding
role-persona embedding stats
role-persona embedding rebuild
System Prompt
role-persona prompt
Daemon (auto-starts on first call)
role-persona daemon start
role-persona daemon stop
role-persona daemon status
Flags
| Flag | Description |
|---|
--json | JSON output (default) |
--human | Human-readable output |
--cwd <path> | Override working directory |
--direct | Skip daemon, run directly |
--model <m> | Model for LLM operations |
Common Workflows
Onboarding a New Session
role-persona role info --human
role-persona memory list --human
role-persona memory conflicts --human
End-of-Session Cleanup
role-persona memory consolidate
role-persona memory conflicts --human
role-persona memory repair
Building System Prompt
role-persona prompt --human
role-persona memory export --output ~/session-memory.md
Searching Past Knowledge
role-persona memory search "how to handle auth tokens"
role-persona knowledge search "deployment guide"
Integration Patterns
With Pi Agent
The CLI auto-starts a daemon on first call for fast subsequent operations (~0.3s vs ~0.5s cold start). Use --direct to bypass daemon for one-off operations.
Programmatic Usage (JavaScript/TypeScript)
import { cli, cliOrThrow } from "role-persona/cli";
const result = await cli(["memory", "list"]);
console.log(result.ok, result.data);
const data = await cliOrThrow(["memory", "search", "auth"]);
As MCP Server
role-persona-mcp --port 3001
File Locations
- Roles:
~/.pi/roles/<role-name>/
- Memory:
~/.pi/roles/<role>/memory/
- Knowledge:
~/.pi/roles/<role>/knowledge/
- Daemon PID:
~/.pi/role-persona-daemon.pid
- Config:
~/.pi/roles/pi-role-persona.jsonc
Tips
- Memory quality matters: prefer specific, reusable entries over verbose descriptions
- Run
consolidate periodically to merge similar entries
- Use
conflicts to find and resolve contradictory preferences
- The daemon auto-starts on first CLI call — no manual startup needed
--direct bypasses the daemon for debugging or one-off operations