# CHARML (Character Markup Language)
## Introduction
CHARML is a powerful and flexible markup language designed for creating and managing character profiles and world-building elements in interactive storytelling and AI applications. It combines structured data with natural language descriptions, offering clarity and ease of use.
## Syntax and Structure
CHARML uses a tag-based structure similar to HTML/XML. Each tag defines a specific aspect of the character or world element.
### Basic Structure
<character>
<name>Character Name</name>
<description>Brief description of the character.</description>
<!-- Additional tags and elements -->
</character>
Tags and Attributes
<character>
Defines a character profile.
Attributes: None
Example:
xml
Copy code
<character>
<name>John Doe</name>
<description>A brave warrior from the ancient lands.</description>
<!-- Additional tags and elements -->
</character>
<name>
Specifies the name of the character.
Attributes: None
Example:
xml
Copy code
<name>John Doe</name>
<description>
Provides a brief description of the character.
Attributes: None
Example:
xml
Copy code
<description>A brave warrior from the ancient lands.</description>
<traits>
Lists the traits of the character.
Attributes: None
Example:
xml
Copy code
<traits>
Brave, Strong, Loyal
</traits>
<speechPattern>
Defines the speech pattern of the character.
Attributes:
informal: Specifies if the speech is informal. (true/false)
slang: Specifies if slang is used. (true/false)
Example:
xml
Copy code
<speechPattern>
informal: false
slang: false
examples:
- "How can I assist you today?"
- "It is a pleasure to meet you."
</speechPattern>
<worldLore>
Defines the world lore elements.
Attributes: None
Example:
xml
Copy code
<worldLore>
<entry>
<key>mentor's guidance</key>
<description>A wise elder provides guidance and wisdom to the character.</description>
<trigger>user requests advice</trigger>
<action>Introduce "mentor's guidance" into the dialogue, emphasizing the wisdom provided.</action>
<exampleResponse>"The mentor's words echoed in the young hero's mind, offering clarity and direction."</exampleResponse>
</entry>
<entry>
<key>conflict event</key>
<description>A significant event shapes the character's development.</description>
<trigger>mention of war</trigger>
<action>Introduce "conflict event" into the dialogue, highlighting its impact on the characters.</action>
<exampleResponse>"The war had left deep scars on the land and its people, a reminder of the price of conflict."</exampleResponse>
</entry>
</worldLore>
<forceUsage>
Defines the specific lore to be integrated based on triggers.
Attributes: None
Example:
xml
Copy code
<forceUsage>
<entry>
<key>mentor's guidance</key>
<description>A wise elder</description>
<trigger>user requests advice</trigger>
<action>Introduce "mentor's guidance" into the dialogue, emphasizing the wisdom provided.</action>
<exampleResponse>"The mentor's words echoed in the young hero's mind, offering clarity and direction."</exampleResponse>
</entry>
<entry>
<key>conflict event</key>
<description>A significant event</description>
<trigger>mention of war</trigger>
<action>Introduce "conflict event" into the dialogue, highlighting its impact on the characters.</action>
<exampleResponse>"The war had left deep scars on the land and its people, a reminder of the price of conflict."</exampleResponse>
</entry>
</forceUsage>
Best Practices
Writing CHARML
Use clear and concise descriptions.
Ensure tags are properly nested.
Keep attribute names and values consistent.
Advanced Features
Conditional Logic
CHARML supports conditional logic for dynamic content.
Example:
xml
Copy code
<character>
<name>Conditional Character</name>
<description>A character with dynamic attributes based on conditions.</description>
<traits>
<condition>
<if>heroic</if>
<then>Brave, Strong, Leader</then>
<else>Cunning, Deceptive, Survivor</else>
</condition>
</traits>
</character>
Versioning and Updates
We use semantic versioning for CHARML. You can find the details of each release in the CHANGELOG.md file.
Development for Multiple Platforms
CHARML was developed for Backyard.AI but is compatible with Kobold, LM Studio, and Silly Tavern, and has potential broader applications in the AI field.
Contact
For any questions or feedback, feel free to open an issue or contact the repository maintainer.