32. Character Persona System
Status: Accepted Date: 2025-07-06
Context
To provide varied and engaging AI-generated tarot interpretations, the application needs to support different "voices" or "characters" (e.g., a wise sage, a mystical oracle, a pragmatic therapist). Simply changing a few words in a prompt is not enough to create a distinct character. A more formal system is needed to define and manage these personas as first-class entities within the application.
Decision
We will implement a formal Character Persona System. A "persona" will be a distinct, database-backed entity with the following attributes:
- Name: A unique identifier for the persona (e.g., "Sage").
- Description: A brief description of the persona's character and style.
- System Prompt: The detailed AI system prompt that defines the persona's voice, knowledge, and interpretation style.
- Owner: A reference to the user who created the persona (or
nullfor system-default personas).
A dedicated PersonaService will be responsible for managing all CRUD (Create, Read, Update, Delete) operations for personas. Users will interact with this service through Telegram commands to create, list, and select their active persona.
Consequences
Positive:
- Modularity & Reusability: Personas become well-defined, reusable components. A user can create a persona and use it for all their future readings.
- Scalability: The system can easily be extended with new system-defined personas or support a large number of user-created personas without code changes.
- Clear Separation of Concerns: The
PersonaServicecentralizes all logic related to persona management, keeping it separate from the AI interpretation and Telegram command logic. - Enhanced User Experience: Gives users a powerful way to customize their experience and share their persona creations.
Negative:
- Increased Abstraction: Adds another layer of abstraction and an additional database table to manage.
- UI/UX Complexity: Requires a clear and intuitive set of commands for users to manage their library of personas effectively.
Mitigation:
- Centralized Service: By encapsulating all persona logic within the
PersonaService, we manage this complexity in one place. - Intuitive Commands: Design a simple and intuitive set of Telegram commands for persona management (e.g.,
/personas,/persona <name>,/set_prompt <name>). - Good Defaults: Provide a rich set of high-quality, system-defined default personas so that users who don't want to engage with the customization features still have a great experience.