# Echonpc

> Fantasy NPC roleplay skill with persistent SQLite memory, relationship tracking, and custom character creation.

Echonpc is a free AI agent skill on Agensi by Mariami Iadze, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Mariami Iadze](https://www.agensi.io/creators/mariami-iadze-1)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/echonpc
- Tags: ai-agents, python, sqlite, roleplay, npc, gaming

## About this skill

Roleplaying agents often suffer from "goldfish memory," losing track of player promises and world events as the context window shifts. This skill provides a local SQLite-backed memory system and a set of fantasy character profiles to ensure NPC interactions remain consistent across multiple sessions.

### What it does
- **Persistent Memory** stores and retrieves character-specific dialogue history and world facts using a local SQLite database.
- **Contextual Retrieval** queries relevant past memories based on the player's current message to maintain narrative continuity.
- **Evidence-Based Recording** validates new memories against exact dialogue quotes before committing them to the database.
- **Relationship Tracking** manages a deterministic relationship score between the player and each NPC.
- **Custom NPC Engine** allows developers to define and export new characters using a standardized JSON schema.
- **Voice Integration** connects to ElevenLabs via Agensi tools for spoken NPC dialogue with saved voice preferences.

### How it works
1. Initialize the session by running `python scripts/echonpc.py init` to select a player alias and an NPC profile.
2. Call the `context` command before generating a reply to pull the last ten relevant memories and the current relationship status.
3. Generate the NPC dialogue using the host model, adhering to the retrieved lore and personality constraints.
4. Commit the turn by passing a JSON object containing the reply and any new candidate memories to the `record-turn` command.

### Frameworks & tools
The helper scripts are built with Python 3.10+ using only the standard library (`sqlite3`, `argparse`, `json`). It integrates with Agensi-connected ElevenLabs tools for text-to-speech functionality.

### Why this beats prompting it yourself
Standard prompting relies entirely on the context window, which inevitably overflows and causes NPCs to forget critical plot points. This skill offloads long-term storage to a local database, ensuring that a promise made in session one is still remembered in session ten without manual copy-pasting.

### Use cases
- Build a persistent RPG companion that remembers player choices and past favors.
- Create a narrative sandbox where multiple NPCs react differently based on shared history.
- Prototype interactive fiction with stable character identities and relationship progression.
- Export and share custom-defined NPCs between different local agent environments.

### Known limitations
Requires a local agent capable of executing Python scripts and managing a local filesystem. It does not support hosted application backends like Supabase or Groq directly.

## Requires

- Python

## 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 Echonpc 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 Echonpc's memory system differ from standard roleplay prompting?

Unlike standard prompting where characters forget events as the conversation grows, Echonpc uses a local SQLite database to store and retrieve specific dialogue history and world facts, ensuring NPCs remember player choices across multiple sessions.

### What kind of agent environments support Echonpc?

The skill is compatible with any local AI agent that can execute Python 3.10+ scripts and manage a local filesystem, making it ideal for desktop-based agent environments.

### What is included in the Echonpc package?

You receive a suite of Python scripts for memory management, a set of pre-configured fantasy character profiles, and the JSON schema required to build and export your own custom NPCs.

### How difficult is the initial setup for a new character?

Setup is straightforward: you initialize your session via the command line to select your player alias and NPC, after which the system automatically handles the database creation and character loading.

### Can the NPCs track how much they like or dislike my character?

Yes, Echonpc includes a deterministic relationship tracking system that updates based on player interactions, allowing NPCs to change their tone and behavior as your bond evolves.

### Does this skill require a cloud database subscription to function?

Echonpc is designed for local execution to ensure data privacy and low latency; it does not currently support cloud-hosted database backends like Supabase or Pinecone.

---

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.
