prompt_data
LLM-ready structured prompts in every API response.
prompt_data
The single most important feature of molroo's API is the prompt_data object. Every response from POST /v1/turn includes a fully structured, LLM-ready set of prompts that you can inject directly into your model's message array -- no manual prompt engineering required.
Instead of parsing raw emotion numbers and crafting your own system prompts, molroo gives you pre-built text blocks that capture who the character is, how they feel right now, and how they should behave.
Structure Overview
The prompt_data object is organized into three injection points, plus a formatted section that provides pre-assembled text blocks:
The Three Injection Points
1. System -- Who the Character Is
The system block defines the character's stable identity. It changes only when you update the persona configuration, not on every turn.
| Field | Description |
|---|---|
identity | Name, role, and personality summary in natural language |
personality_traits | Big Five trait descriptions relevant to behavior |
goals | The character's current objectives and motivations |
Use this as the foundation of your LLM system prompt. It provides the character baseline that remains consistent across the conversation.
2. Context -- How They Feel Right Now
The context block is the dynamic emotional snapshot. It updates on every turn, reflecting the character's current psychological state.
| Field | Description |
|---|---|
emotion | Primary emotion label, intensity level, and valence |
energy | Body budget level and percentage remaining |
stage | Current soul stage and its behavioral tendency |
needs | Self-determination theory needs (autonomy, competence, relatedness) |
interpersonal | Trust level and attachment style with the user |
formatted | Pre-assembled context block as a single text string |
This is where the emotional richness comes from. The context block tells the LLM not just "the character is sad" but provides the full psychological picture -- their energy level, their relationship with the user, their unmet needs, and the behavioral tendencies of their current stage.
3. Instruction -- How to Behave
The instruction block provides stage-appropriate behavioral guidance for the LLM.
| Field | Description |
|---|---|
stage_instruction | Behavioral directive based on the current soul stage |
expression_guide | Tone and expression guidance for this emotional state |
formatted | Pre-assembled instruction block as a single text string |
This block bridges the gap between raw emotional data and actual LLM behavior. Rather than leaving it to the LLM to interpret what "valence -0.12 at soul stage 3" means, molroo translates that into concrete guidance like "Speak with measured concern, showing active interest while maintaining a slight guardedness."
The formatted Shortcut
Each section includes a formatted sub-object, and there is a top-level formatted object that combines everything. If you want the simplest possible integration, use the top-level formatted fields directly:
| Field | Contains |
|---|---|
system_prompt | Complete system prompt with identity + personality + goals |
context_block | Full emotional context as natural language text |
instruction_block | Complete behavioral instructions |
These are ready to paste into your LLM message array with zero parsing.
Usage with OpenAI
The simplest integration uses the pre-formatted blocks:
Usage with Anthropic
Anthropic's API separates the system prompt from the message array, which maps cleanly onto the three injection points:
Advanced: Using Structured Fields
For more control, you can build your own prompt by selecting specific fields from the system, context, and instruction blocks:
This approach is useful when you want to combine molroo's emotional state with your own application-specific instructions, or when you need to selectively include or omit certain dimensions.
Why This Matters
Without prompt_data, integrating an emotion engine into an LLM pipeline requires you to:
- Parse numeric VAD vectors and translate them into natural language
- Map soul stages to behavioral instructions
- Decide how to express trust levels, energy states, and need deficits
- Keep all of this consistent across turns
prompt_data handles all of this for you. The emotion engine does the psychology; your LLM just needs to follow the instructions.
For the raw emotional state data (VAD values, appraisal vectors, stage transitions), see the Turn API reference. For a full walkthrough of the LLM integration pipeline, see the Integration guide.