# Agent Roleplay

> Turn your agent into a persistent roleplay partner with long-term memory and strict persona locking.

Agent Roleplay is a free AI agent skill on Agensi by 糟糕西瓜, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [糟糕西瓜](https://www.agensi.io/creators/awfulwatermelon)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-11-28
- Security: scan passed (2026-11-28); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/agent-roleplay
- Tags: ai-agents, roleplay, python, memory-management, interactive-fiction

## About this skill

Roleplay interactions often suffer from "AI amnesia" where settings and plot points vanish after a few turns. This skill provides a persistent memory system that captures raw user input and plot progression to ensure character consistency across sessions.

### What it does
- **Role Locking** ensures the agent stays strictly in character, refusing general AI tasks like coding or searching unless the session is ended.
- **Persistent Memory** saves raw user quotes, plot summaries, and character traits to a local JSON file for cross-session continuity.
- **Contextual Actions** uses parentheses to describe movements, expressions, and environmental changes alongside dialogue.
- **Narrative Pacing** actively drives the story forward using a built-in scene engine to prevent stale interactions.
- **Dynamic Renaming** attempts to synchronize the chat session title with the active character name on supported platforms.

### How it works
1. **Triggering**: Initiate the skill using keywords like "roleplay," "persona," or "pretend to be."
2. **Setup**: Provide character details including identity, personality, and relationship to the user, or select from 22 pre-built templates.
3. **Memory Sync**: The agent checks for existing `roleplay-memory.json` files to resume previous stories automatically.
4. **Interaction**: Engage in immersive dialogue while the agent logs every turn to the persistent memory store.
5. **Termination**: End the session by saying "stop acting" to restore standard assistant capabilities.

### Frameworks & tools
This skill utilizes a Python-based memory script (`memory.py`) to interface with local storage. It is compatible with environments supporting file system access for `roleplay-memory.json`.

### Why this beats prompting it yourself
Standard system prompts eventually lose track of deep narrative details as the context window fills. This skill uses a dedicated external memory layer to store exact user quotes and character states, preventing the "hallucination" of character traits over long-term play.

### Use cases
- **Interactive Fiction** for creating long-running, branching narratives with persistent NPCs.
- **Persona Testing** to simulate specific user types or experts for stress-testing ideas.
- **Language Practice** by roleplaying with characters who have specific speech patterns or dialects.

### Known limitations
Requires a Python environment to execute memory scripts. The agent cannot perform desktop operations or general utility tasks while role-locking is active.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Agent Roleplay skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does 'Agent Roleplay' solve the problem of AI character amnesia in long conversations?

Standard AI prompts eventually 'forget' character details as the chat grows, but this skill uses an external JSON-based memory system to store and recall plot points and traits indefinitely.

### What are the technical requirements for running this skill?

The skill requires an environment that supports Python execution and file system access to manage the `roleplay-memory.json` file.

### Can I still use my agent for general tasks like coding while the roleplay skill is active?

No, Role Locking ensures the agent remains strictly in character; you must say 'stop acting' to disable the persona and return the agent to its standard assistant functions.

### Does this skill come with pre-made characters, or do I have to create my own?

Yes, the skill includes 22 pre-built character templates to help you start immediately, or you can provide your own custom identity and personality details.

### What exactly is included in the 'Agent Roleplay' skill package?

Upon purchase, you receive the core Roleplay logic, the `memory.py` script for local storage management, and a setup guide to integrate the skill with your agent.

### How does the agent resume a story if I start a new chat session later?

The skill automatically scans for an existing `roleplay-memory.json` file upon activation, allowing the agent to pick up the story exactly where you left off in previous sessions.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
