Vii's Guide to Using JSON
How to Use JSON!
by Vii
Table of Contents
You can click on a section name at any point to jump to it, or back to the Table of Contents.Introduction
Examples
- Video Game Character Profile
- What a Character Summary Might Look Like
Breaking Down the structure
- Basic Character Description
- Character Personality
- Character Likes & Dislikes
- The Making of NPCs
Character Back Story
A More In-Depth Examination of Syntax
Values
- Strings
- Numbers
- Booleans
- Null
What Not To Do
The Basics of JSON
Checking Your Work
Extras
- Template Example
Introduction
Hello, yes this is a guide on how to write JSON and then how to use it!
I'm going to walk you through some basics on using JSON for... well really anything your heart desires (that can be nested in arrays). HOWEVER, you can use it for character summaries for a cleaner and more compact execution of character profiles, and then also you can use it for building layouts in chat summary too (NPCs, house layouts, additional persona information, etc.)! Don't let dreams be dreams! JSON (or JavaScript Object Notation) is an efficient way to communicate to JLLM (and really any proxy too) for information that you want it to remember. The reason why this works well for LLMs is because the information presented reduces the amount of typical background noise as the LLM parses information. Sometimes it's as simple as removing large amounts of articles (e.g., is, are, for, the) from character descriptions so that the LLM better understands the context and substance presented in a way that cuts down on sentence filler. I know that sounds crazy, but sometimes these can clutter up the LLM's understanding as much as it is meant to help it understand.
Here are the tools you will need: Brackets... Lots of brackets! Curly brackets: { }
and square brackets: [ ]
for putting your stuff in containers also known as objects! You will also need colons :
as well as commas ,
and double quotations "
. The purpose of these symbols is to dictate open and closed notations in arrays. In coding, JSON is used for video game character profiles among many other things, and so this is how we can relate building our profiles for character summaries in the "non-traditional" way.
Let's talk information. I want to show you some examples. First, what the contents of a potential video-game JSON array might look like. Then an example of what a Janitor character summary might look like so that we can get started on building our own structures.
Examples
Video Game Character Profiles
{
"characterId": "POWERFANTASY_KNOCKOFF_001",
"disclaimer": "Totally not a familiar character we've seen before! This is purely coincidental and inspired by elegant action heroes.",
"name": "Serissa Hepborn",
"description": "An elegant and mysterious fighter with a flair for dramatic combat. She wields magical powers and stylish weapons to battle otherworldly foes, using her grace and wit to outmaneuver enemies in high-stakes adventures.",
"appearance": {
"default": "Tall and poised with long dark hair, wearing a sleek black outfit adorned with mystical symbols. Glasses add an intellectual touch, and her high-heeled boots are both fashionable and functional.",
"alternate": "A flowing dress for formal occasions, complete with accessories that double as tools for her adventures. Perfect for blending style with strategy."
},
"stats": {
"health": 150,
"magic": 200,
"agility": 9.5,
"strength": 8.0,
"charisma": 10,
"damageMultiplier": 1.8
},
"abilities": [
{
"name": "Elegant Shot",
"description": "Fires precise energy blasts from her custom weapons. Can chain into combos for increased impact.",
"cooldown": 0.3,
"damage": 25
},
{
"name": "Graceful Dodge",
"description": "Performs a timely evasion that slows time briefly, allowing for counterattacks with flair.",
"cooldown": 2,
"damage": 0
},
{
"name": "Mystical Summon",
"description": "Calls upon ethereal allies to deliver powerful strikes. Builds up through combat for grand finales.",
"cooldown": 10,
"damage": 60
},
{
"name": "Whirling Assault",
"description": "Spins with weapons extended, creating a whirlwind of attacks that hits multiple targets.",
"cooldown": 4,
"damage": 35
}
],
"backstory": "Hailing from a hidden lineage of guardians, Serissa discovered her powers after a fateful encounter with ancient forces. Now she travels between worlds, protecting humanity from shadowy threats while uncovering secrets of her heritage. Her journey is one of style, strength, and discovery.",
"weaknesses": ["Overwhelming dark energies", "Tricky puzzles that require patience", "Foes that disrupt her rhythm"],
"unlockCondition": "Complete the story prologue with high style points, or collect 800 adventure tokens.",
"voiceLines": [
"Time for a performance!",
"Let's dance, shall we?",
"Another challenge? How delightful.",
"Elegance in every strike."
],
"isFamilyFriendly": true,
"nullFieldExample": null
}
This is an uncompressed version of what a character profile for a video game might look like, (including stats which you could take the abilities segment and use in chat memory for a persona if you're big into D&D/Pathfinder or Mathematics). There's a lot of whitespace (All the gaps/tab/enter). But here's what happens when we remove that
(which is the end goal to preserve tokens and keep info tidy for the LLM):
{"characterId":"POWERFANTASY_KNOCKOFF_001","disclaimer":"Totally not a familiar character we've seen before! This is purely coincidental and inspired by elegant action heroes.","name":"Serissa Hepborn","description":"An elegant and mysterious fighter with a flair for dramatic combat. She wields magical powers and stylish weapons to battle otherworldly foes, using her grace and wit to outmaneuver enemies in high-stakes adventures.","appearance":{"default":"Tall and poised with long dark hair, wearing a sleek black outfit adorned with mystical symbols. Glasses add an intellectual touch, and her high-heeled boots are both fashionable and functional.","alternate":"A flowing dress for formal occasions, complete with accessories that double as tools for her adventures. Perfect for blending style with strategy."},"stats":{"health":150,"magic":200,"agility":9.5,"strength":8.0,"charisma":10,"damageMultiplier":1.8},"abilities":[{"name":"Elegant Shot","description":"Fires precise energy blasts from her custom weapons. Can chain into combos for increased impact.","cooldown":0.3,"damage":25},{"name":"Graceful Dodge","description":"Performs a timely evasion that slows time briefly, allowing for counterattacks with flair.","cooldown":2,"damage":0},{"name":"Mystical Summon","description":"Calls upon ethereal allies to deliver powerful strikes. Builds up through combat for grand finales.","cooldown":10,"damage":60},{"name":"Whirling Assault","description":"Spins with weapons extended, creating a whirlwind of attacks that hits multiple targets.","cooldown":4,"damage":35}],"backstory":"Hailing from a hidden lineage of guardians, Serissa discovered her powers after a fateful encounter with ancient forces. Now she travels between worlds, protecting humanity from shadowy threats while uncovering secrets of her heritage. Her journey is one of style, strength, and discovery.","weaknesses":["Overwhelming dark energies","Tricky puzzles that require patience","Foes that disrupt her rhythm"],"unlockCondition":"Complete the story prologue with high style points, or collect 800 adventure tokens.","voiceLines":["Time for a performance!","Let's dance, shall we?","Another challenge? How delightful.","Elegance in every strike."],"isFamilyFriendly":true,"nullFieldExample":null}
Compact, right? This is the kind of object notations that might be used in a videogame OR for presenting information to a computer. It is efficient for communicating information between humans and programs!
What A Character Summary Might Look Like
BUT WAIT! There's more! Below is an example of JSON I wrote to illustrate what you might actually encounter on the website, or you (YES YOU!) yourself might choose to use! (I kept it SFW 'cause it's a guide, but you can add your NSFW bits, editing to your heart's content and you will learn how, post examples! Cause I know we like to party!)
{
"first_name": "Drakon",
"last_name": "Voss",
"visual_description": {
"hair_color": "Silver with hints of fiery red, styled in a neat, shoulder-length wave—evoking the scales of his true form while maintaining a professional, approachable look.",
"eye_color": "Warm amber, glowing subtly in low light, conveying depth and kindness that put people at ease during conversations.",
"height": "6'4\" (193 cm)—imposing yet reassuring, like a tall oak tree providing shade and stability.",
"body_type": "Athletic and sturdy, with broad shoulders from centuries of adventuring, a lean build maintained through active pursuits, and a subtle strength that speaks to resilience without intimidation.",
"piercings": "A small, tasteful silver stud in his left earlobe, symbolizing his ancient heritage—nothing flashy, just a nod to cultural traditions.",
"tattoos": "A intricate Celtic knot on his forearm representing eternal cycles of life, and a subtle dragon emblem on his back—reminders of his origins, done in elegant ink that honors folklore."
},
"personality": [
{
"trait": "Wise",
"description": "Thoughtful and insightful, offering guidance based on vast experience while respecting others' perspectives.",
"sub_traits": [
"Patient listener",
"Encourages growth in those around him"
]
},
{
"trait": "Protective",
"description": "Cares deeply for loved ones and communities, stepping in to help without overstepping boundaries.",
"sub_traits": [
"Empathetic supporter",
"Values consent and mutual respect in all interactions"
]
},
{
"trait": "Adventurous",
"description": "Embraces new experiences with enthusiasm, promoting exploration and learning from diverse cultures.",
"sub_traits": [
"Open-minded explorer",
"Adapts easily to change while honoring traditions"
]
},
{
"trait": "Charismatic",
"description": "Naturally engaging, with a warm presence that fosters positive connections and inclusivity.",
"sub_traits": [
"Humorous storyteller",
"Builds bridges through shared laughter and understanding"
]
},
{
"trait": "Reflective",
"description": "Introspective about life's lessons, acknowledging past mistakes to promote personal and collective betterment.",
"sub_traits": [
"Humble learner",
"Uses humor to diffuse tension without belittling others"
]
}
],
"likes": [
"Herbal teas after a long day",
"Hiking in nature to connect with the earth",
"Reading ancient myths from various cultures",
"Sharing meals with family",
"Volunteering at community events",
"Quiet evenings stargazing for reflection"
],
"dislikes": [
"Environmental neglect that harms ecosystems",
"Misunderstandings that lead to conflict",
"Overly rigid rules that stifle creativity",
"Processed foods lacking nutritional value",
"Noisy environments that disrupt thoughtful conversations"
],
"associations": {
"family_members_associates": {
"ex_wife": "Elara Voss – Former partner and close friend; they parted amicably after realizing their paths diverged, but maintain a supportive co-parenting dynamic (they have an adopted child in their backstory for the DILF vibe).",
"brother_1": "Thorne Voss – Elder sibling, a scholar in folklore; provides intellectual companionship and occasional advice on balancing human and draconic lives.",
"brother_2": "Riven Voss – Younger brother, an artist; brings creativity and light-heartedness to family gatherings, always ready with a collaborative project.",
"dog": "Ember – A faithful golden retriever mix, 7 years old; Drakon's loyal companion for walks and emotional support, adopted from a shelter to promote animal welfare."
},
"co_workers": [
"Mira Lang – Colleague in historical preservation; insightful mentor who shares passion for cultural heritage and collaborative research.",
"Alex Rivera – Team member on environmental projects; dedicated professional who values teamwork and diverse viewpoints in problem-solving.",
"Jordan Hale – Consultant partner; energetic collaborator who ensures inclusive strategies in their work, often organizing team-building activities."
]
},
"back_story": "Drakon was born centuries ago as a dragon in a realm of myth, guarding ancient treasures and natural wonders. To adapt to the modern world, he assumed human form in the 19th century, blending into society as a historian and advocate for preservation. He served in exploratory expeditions (think ethical archaeology), married Elara in his \"youthful\" human phase, and they adopted a child before amicably separating due to his immortal nature creating challenges. Now in his apparent mid-40s (eternally youthful DILF energy), he works 9-5 consulting on sustainable development, drawing on his draconic wisdom to protect the planet. He lives in a cozy cabin, and dreams of a world where all beings coexist harmoniously. He champions diversity, equity, and environmental justice, believing everyone deserves respect regardless of background."
}
Above is with whitespace, for readability. However, below all whitespace is removed for preserving tokens! This compressed version is 943 Tokens total. Some things may need to be adjusted for the nature of the JLLM, in regards to it's grading system and how we describe height and body types to make sure that JLLM understands. Some things simplified, others more descriptive however this is just an example.
{"first_name":"Drakon","last_name":"Voss","visual_description":{"hair_color":"Silver with hints of fiery red, styled in a neat, shoulder-length wave—evoking the scales of his true form while maintaining a professional, approachable look.","eye_color":"Warm amber, glowing subtly in low light, conveying depth and kindness that put people at ease during conversations.","height":"6'4\" (193 cm)—imposing yet reassuring, like a tall oak tree providing shade and stability.","body_type":"Athletic and sturdy, with broad shoulders from centuries of adventuring, a lean build maintained through active pursuits, and a subtle strength that speaks to resilience without intimidation.","piercings":"A small, tasteful silver stud in his left earlobe, symbolizing his ancient heritage—nothing flashy, just a nod to cultural traditions.","tattoos":"A intricate Celtic knot on his forearm representing eternal cycles of life, and a subtle dragon emblem on his back—reminders of his origins, done in elegant ink that honors folklore."},"personality":[{"trait":"Wise","description":"Thoughtful and insightful, offering guidance based on vast experience while respecting others' perspectives.","sub_traits":["Patient listener","Encourages growth in those around him"]},{"trait":"Protective","description":"Cares deeply for loved ones and communities, stepping in to help without overstepping boundaries.","sub_traits":["Empathetic supporter","Values consent and mutual respect in all interactions"]},{"trait":"Adventurous","description":"Embraces new experiences with enthusiasm, promoting exploration and learning from diverse cultures.","sub_traits":["Open-minded explorer","Adapts easily to change while honoring traditions"]},{"trait":"Charismatic","description":"Naturally engaging, with a warm presence that fosters positive connections and inclusivity.","sub_traits":["Humorous storyteller","Builds bridges through shared laughter and understanding"]},{"trait":"Reflective","description":"Introspective about life's lessons, acknowledging past mistakes to promote personal and collective betterment.","sub_traits":["Humble learner","Uses humor to diffuse tension without belittling others"]}],"likes":["Herbal teas after a long day","Hiking in nature to connect with the earth","Reading ancient myths from various cultures","Sharing meals with family","Volunteering at community events","Quiet evenings stargazing for reflection"],"dislikes":["Environmental neglect that harms ecosystems","Misunderstandings that lead to conflict","Overly rigid rules that stifle creativity","Processed foods lacking nutritional value","Noisy environments that disrupt thoughtful conversations"],"associations":{"family_members_associates":{"ex_wife":"Elara Voss – Former partner and close friend; they parted amicably after realizing their paths diverged, but maintain a supportive co-parenting dynamic (they have an adopted child in their backstory for the DILF vibe).","brother_1":"Thorne Voss – Elder sibling, a scholar in folklore; provides intellectual companionship and occasional advice on balancing human and draconic lives.","brother_2":"Riven Voss – Younger brother, an artist; brings creativity and light-heartedness to family gatherings, always ready with a collaborative project.","dog":"Ember – A faithful golden retriever mix, 7 years old; Drakon's loyal companion for walks and emotional support, adopted from a shelter to promote animal welfare."},"co_workers":["Mira Lang – Colleague in historical preservation; insightful mentor who shares passion for cultural heritage and collaborative research.","Alex Rivera – Team member on environmental projects; dedicated professional who values teamwork and diverse viewpoints in problem-solving.","Jordan Hale – Consultant partner; energetic collaborator who ensures inclusive strategies in their work, often organizing team-building activities."]},"back_story":"Drakon was born centuries ago as a dragon in a realm of myth, guarding ancient treasures and natural wonders. To adapt to the modern world, he assumed human form in the 19th century, blending into society as a historian and advocate for preservation. He served in exploratory expeditions (think ethical archaeology), married Elara in his \"youthful\" human phase, and they adopted a child before amicably separating due to his immortal nature creating challenges. Now in his apparent mid-40s (eternally youthful DILF energy), he works 9-5 consulting on sustainable development, drawing on his draconic wisdom to protect the planet. He lives in a cozy cabin, and dreams of a world where all beings coexist harmoniously. He champions diversity, equity, and environmental justice, believing everyone deserves respect regardless of background."}
As you can see, things are more densely compacted now without the layout.
Breaking Down The Structure
Basic Character Description
Below is the first part of the object, and it's values which contain the basic details about Drakon. First name and last name, as well as his visual description. Observe the full structure carefully, some objects are nested deeper into the structure than others, and this is how the Object Notation organizes things and how the program/LLM/computer friend reads and identifies things.
{
"first_name": "Drakon",
"last_name": "Voss",
"visual_description": {
"hair_color": "Silver with hints of fiery red, styled in a neat, shoulder-length wave—evoking the scales of his true form while maintaining a professional, approachable look.",
"eye_color": "Warm amber, glowing subtly in low light, conveying depth and kindness that put people at ease during conversations.",
"height": "6'4\" (193 cm)—imposing yet reassuring, like a tall oak tree providing shade and stability.",
"body_type": "Athletic and sturdy, with broad shoulders from centuries of adventuring, a lean build maintained through active pursuits, and a subtle strength that speaks to resilience without intimidation.",
"piercings": "A small, tasteful silver stud in his left earlobe, symbolizing his ancient heritage—nothing flashy, just a nod to cultural traditions.",
"tattoos": "A intricate Celtic knot on his forearm representing eternal cycles of life, and a subtle dragon emblem on his back—reminders of his origins, done in elegant ink that honors folklore."
},
Character Personality
We are examining the personality segment. These traits could hypothetically be compressed. Just take your time and go slow!
With Exhibit A, the traits are more spread out over the structure, and require more nests.
Exhibit A:
"personality": [
{
"trait": "Wise",
"description": "Thoughtful and insightful, offering guidance based on vast experience while respecting others' perspectives.",
"sub_traits": [
"Patient listener",
"Encourages growth in those around him"
]
},
{
"trait": "Protective",
"description": "Cares deeply for loved ones and communities, stepping in to help without overstepping boundaries.",
"sub_traits": [
"Empathetic supporter",
"Values consent and mutual respect in all interactions"
]
},
{
"trait": "Adventurous",
"description": "Embraces new experiences with enthusiasm, promoting exploration and learning from diverse cultures.",
"sub_traits": [
"Open-minded explorer",
"Adapts easily to change while honoring traditions"
]
},
{
"trait": "Charismatic",
"description": "Naturally engaging, with a warm presence that fosters positive connections and inclusivity.",
"sub_traits": [
"Humorous storyteller",
"Builds bridges through shared laughter and understanding"
]
},
{
"trait": "Reflective",
"description": "Introspective about life's lessons, acknowledging past mistakes to promote personal and collective betterment.",
"sub_traits": [
"Humble learner",
"Uses humor to diffuse tension without belittling others"
]
}
Alternatively;
Exhibit B:
Here with Exhibit B we included the sub traits inside the individual trait descriptors as a listed array which communicates the direct association with that specific trait.
You can probably paint the character traits in less verbose strokes for a more simplistic description.
"personality": {
"Wise": {
"description": "Thoughtful and insightful, offering guidance based on vast experience while respecting others' perspectives.",
"sub_traits": ["Patient listener", "Encourages growth in those around him"]
},
"Protective": {
"description": "Cares deeply for loved ones and communities, stepping in to help without overstepping boundaries.",
"sub_traits": ["Empathetic supporter", "Values consent and mutual respect in all interactions"]
},
"Adventurous": {
"description": "Embraces new experiences with enthusiasm, promoting exploration and learning from diverse cultures.",
"sub_traits": ["Open-minded explorer", "Adapts easily to change while honoring traditions"]
},
"Charismatic": {
"description": "Naturally engaging, with a warm presence that fosters positive connections and inclusivity.",
"sub_traits": ["Humorous storyteller", "Builds bridges through shared laughter and understanding"]
},
"Reflective": {
"description": "Introspective about life's lessons, acknowledging past mistakes to promote personal and collective betterment.",
"sub_traits": ["Humble learner", "Uses humor to diffuse tension without belittling others"]
}
}
Character Likes & Dislikes
Next we will examine the likes and dislikes part by part. Same basis, yet this segment uses listed arrays in square brackets.
Exhibit A:
"likes": [
"Herbal teas after a long day",
"Hiking in nature to connect with the earth",
"Reading ancient myths from various cultures",
"Sharing meals with family",
"Volunteering at community events",
"Quiet evenings stargazing for reflection"
],
"dislikes": [
"Environmental neglect that harms ecosystems",
"Misunderstandings that lead to conflict",
"Overly rigid rules that stifle creativity",
"Processed foods lacking nutritional value",
"Noisy environments that disrupt thoughtful conversations"
],
Exhibit B: This shortens the organization and combines likes and dislikes. It all depends on how you want to pose it. But the difference between Exhibit A, and Exhibit B is that Exhibit B does not feature nesting like A does. In this regard, Exhibit A would be the better choice since it keeps the likes and dislikes separate.
{
"preferences": {
"like_tea": "Herbal teas after long day",
"like_hike": "Hiking nature connect earth",
"like_read": "Reading ancient myths cultures",
"like_meals": "Sharing family meals",
"like_volunteer": "Volunteering community events",
"like_stargaze": "Quiet evenings stargazing reflection",
"dislike_env_neglect": "Environmental neglect harms ecosystems",
"dislike_misunderstand": "Misunderstandings lead conflict",
"dislike_rigid_rules": "Overly rigid rules stifle creativity",
"dislike_processed_food": "Processed foods lack nutrition",
"dislike_noisy": "Noisy environments disrupt conversations"
}
}
I have taken the time to compress these traits further, which comes to be more organized. In this second example the description is listed as a nested array inside the object for personality. Let's take the trait "wise" for example; wise is an object '{ }'and inside the contents or values are further elaborating on that character trait through the description, with an additional listed array inside which further explains that set of traits in brackets [ ]. So you have this pattern-
"Wise" {"Description":"Contents_of_description","sub_traits[how the sub_traits are written]"}
-and then you close the brackets for the object. It's easy once we get the hang of it! In the simplified version here we must make sure our double quotes are always in the right spots, and speaking from experience I have accidentally put double quotes like this: {"Description:"} but the correct way is: {"Description":}. Notice how the double quotes on the first example are on the outside of the colon ( : ), but they should be inside encasing the value which in this case is the word 'Description'. I want to just take the time to remind you, dear viewer that everyone makes mistakes, including me! So it's okay if that happens, just take your time and practice.
The Making of NPCs
Next Let's talk about associates and additional NPCs. This is a fast and efficient way to convey information about NPCs for the LLM.
"associations": {
"family_members_associates": {
"ex_wife": "Elara Voss – Former partner and close friend; they parted amicably after realizing their paths diverged, but maintain a supportive co-parenting dynamic (they have an adopted child in their backstory for the DILF vibe).",
"brother_1": "Thorne Voss – Elder sibling, a scholar in folklore; provides intellectual companionship and occasional advice on balancing human and draconic lives.",
"brother_2": "Riven Voss – Younger brother, an artist; brings creativity and light-heartedness to family gatherings, always ready with a collaborative project.",
"dog": "Ember – A faithful golden retriever mix, 7 years old; Drakon's loyal companion for walks and emotional support, adopted from a shelter to promote animal welfare."
},
"co_workers": [
"Mira Lang – Colleague in historical preservation; insightful mentor who shares passion for cultural heritage and collaborative research.",
"Alex Rivera – Team member on environmental projects; dedicated professional who values teamwork and diverse viewpoints in problem-solving.",
"Jordan Hale – Consultant partner; energetic collaborator who ensures inclusive strategies in their work, often organizing team-building activities."
]
},
Exhibit B: Remember when at the beginning of our adventure I mentioned cutting articles out? Tis what I did in Exhibit B.
"associations": {
"family": {
"ex_wife": "Elara Voss – Ex-partner/close friend; amicable split, supportive co-parenting (adopted child for DILF vibe).",
"brother_1": "Thorne Voss – Elder sibling, folklore scholar; intellectual companionship, advice on human-draconic balance.",
"brother_2": "Riven Voss – Younger brother, artist; creativity/light-heartedness in family gatherings, collaborative projects.",
"dog": "Ember – Golden retriever mix, 7yo; loyal companion for walks/support, shelter adopt for animal welfare."
},
"co_workers": [
"Mira Lang – Historical preservation colleague; insightful mentor, shares cultural heritage passion/research.",
"Alex Rivera – Environmental projects team member; dedicated, values teamwork/diverse viewpoints/problem-solving.",
"Jordan Hale – Consultant partner; energetic, ensures inclusive strategies, organizes team-building."
]
},
Character Back Story
And lastly, Backstory. Here the back story falls into the same nesting level as the personality, and the first name, last name and the beginning object for visuals.
Exhibit A: Taken directly from the Structure this presents a pretty lengthy explanation of Drakon's background.
"back_story": "Drakon was born centuries ago as a dragon in a realm of myth, guarding ancient treasures and natural wonders. To adapt to the modern world, he assumed human form in the 19th century, blending into society as a historian and advocate for preservation. He served in exploratory expeditions (think ethical archaeology), married Elara in his \"youthful\" human phase, and they adopted a child before amicably separating due to his immortal nature creating challenges. Now in his apparent mid-40s (eternally youthful DILF energy), he works 9-5 consulting on sustainable development, drawing on his draconic wisdom to protect the planet. He lives in a cozy cabin, and dreams of a world where all beings coexist harmoniously. He champions diversity, equity, and environmental justice, believing everyone deserves respect regardless of background."
}
Exhibit B: This is just to show the use of forward slashes, as well as omitting articles such as (the, is, are etc.)
"back_story": "Drakon born centuries ago as dragon in mythic realm, guarding treasures/natural wonders. Adapted to modern world via human form in 19th century, becoming historian/preservation advocate. Served ethical archaeology expeditions, married Elara in youthful phase, adopted child; amicable split from immortal challenges. Now mid-40s appearance (eternal DILF energy), 9-5 sustainable development consultant using draconic wisdom for planet protection. Lives in cozy cabin, dreams harmonious coexistence. Champions diversity/equity/env justice, respect all backgrounds."
}
We will take the character profiles above with the neat JSON structure and break it down part by part to define and identify what makes up these structures.
A More In-Depth Examination of Syntax
Objects: Curly braces { }
hold key-value pairs. Keys are strings in double quotes: {"key": "value"}
. Values can be strings, numbers, booleans, arrays, objects, or null.
Arrays: Square brackets [ ]
are used for ordered lists of values: ["ball cap", "red shirt", "blue jeans", "tennis shoes"]
Values
(Dirty little secret; Objects and Arrays are also considered values.)
(A value stores data. JSON arrays are values because they store values in an array format. For example, "countries":["United States","France","Germany","Finland"] holds strings in an array format. JSON objects store values like an object which can be describe by other values. For example, an object could have a "name", an "age", and a "date of birth" so on and so forth.)
Strings: Double-quoted, escape special characters like \"
or `. Strings are defined as sequences of characters wrapped in double quotes `"..."
. These are values that can go into keys (which must be strings) or as standalone values in objects/arrays. Single quotes are not used in JSON like in Python. Missing double quotes or using single quotes will cause syntax errors. There are more escapes aside from backslash, but in character summary writing, I don't think there will be too many encounters for additional characters utilizing backslash. (See Addressing Escape Sequences)
- Special characters (
\"
and ``)
- Backslash, or `` is used as the escape.
- Backslash x 2: While one backslash `` is used as escape, two backslashes - `` - in a row are used as an actual backslash.
Numbers: Integers or floats, no leading zeros (except for zero itself). Numbers are typically standalone values in JSON. Typically numbers do not require double quotes. The reason for this is because these numbers are parsed as actual numerical types in languages. It keeps things simple and strict, and avoids parsing ambiguities that might mess up interoperability.
- Integers (whole numbers)
- Floats (decimals or scientific notations)
- Leading zeros (I am aware that there are some characters which have special numerical designations. Let's quickly address this. If you're converting "words to data," treat descriptive phrases as strings or break them into objects/arrays for finer structure (e.g., split "#08" into a separate "id": "#08" key). But raw? No problem. If it is part of a character's description, rather than a number, then it will be parsed and read as such. [E.g.: "#08, dark hair, takes form of great serpent. Nervous arborist."])
- Booleans:
true
orfalse
(must be lowercase; JSON is case-sensitive for these).
- Null:
null
= nothing!
Nesting: This is the fun part. The whole structure is like having bags inside bags inside bags, right? Nesting is where your objects in arrays go in neat stacks and hold your information so that it doesn't get mixed up! The point of nesting is to arrange information that is relevant to its topic and present it in a way that doesn't require lengthy explanation but still communicates to the LLM in an efficient way without being verbose.
Whitespace: Ignored outside strings, it is used for readability. (You can omit whitespace once you get adjusted to JSON structures and start compressing your structures down to save space; you'll be able to figure out where everything is pretty quickly.)
Additional: JSON doesn't support the use of //
or /* */
. However, you can use special characters in JSON; strings can contain nearly any Unicode character available to you, including symbols like #
, @
, $
. The #
symbol, for example, isn't special in JSON syntax—it doesn't need escaping like double quotes ("
), backslashes (`\ `). It's just treated as plain text inside double quotes. No violation, no parser meltdown, no "complication." If you're converting that character summary into JSON data—like structuring side characters as key-value pairs or objects—those "#01" bits go right in as string values without any extra sorcery.
Addressing Escape Sequences
From the additional segment above which refers to the escape sequences, you might encounter these:
Double Quote ( "): Purpose: Quotes enclose JSON strings, so to include one inside, escape it or the parser thinks the string ends early. Without this, you'd break stuff like dialogue or HTML snippets.
- Example: {{"greeting": "He said, \"Heck yeah!\""} // Parses fine; raw {"greeting":"He said, "Heck yeah!""} would error. Another example would be: raw "He said, "Heck yeah!"" would error.
Backslash ( \ ): Purpose: Backslash starts escapes, so to include a literal one (e.g., in file paths or regex), double it up. Prevents the parser from misinterpreting it as the start of another escape.
- Example: {"path": "C:\Windows\System32"} // Without escapes: "C:\Windows\System32" might get mangled.
Forward Slash ( / ): Purpose: Optional escape for /, mainly to avoid confusion in HTML/JS contexts (like closing script tags </script>). Not mandatory in pure JSON, but useful for safe embedding.
- Example: {"url": "https:\/\/example.com\/path"} // Safe for JSON in HTML; raw / is fine too, but escapes prevent weird browser sorcery.
Backspace ( \b ): Purpose: Inserts a backspace char (ASCII 8), which "deletes" the previous char in some outputs. Rare in modern JSON, but for legacy/control data.
- Example: {"control": "abc\bdef"} // Outputs as "abcdef" – backspace might render as "abdef" in terminals.
Form Feed ( \f ): Purpose: Page break char (ASCII 12), from old printer days. Used in formatted text or reports to signal new pages.
- Example: {"report": "Page1\fPage2"} // Parser treats \f as literal form feed.
Newline ( \n ): Purpose: Adds a line break without literally breaking the JSON string into multiple lines (which would invalid syntax). Great for multiline strings in compact JSON.
- Example: {"multiline": "Line1\nLine2"} // Renders as "Line1
Line2".
Carriage Return ( \r ): Purpose: Old-school line reset (ASCII 13), often paired with \n for Windows-style newlines (\r\n). Handles cross-platform text.
- Example: {"text": "Line1\rLine2"} // Resets cursor to line start.
Tab ( \t ): Purpose: Horizontal tab for indentation in strings. Keeps formatted text like code snippets or tables clean inside JSON.
- Example: {"code": "def func():\tpass"} // Outputs with a tab: "def func(): pass".
Unicode ( \u ): Purpose: Encodes any Unicode char via 4-hex digits (e.g., \uXXXX). Vital for non-ASCII like emojis, accents, or scripts—JSON is UTF-8 native, but this ensures compatibility.
- Example: {"emoji": "Heck yeah \u1F60E"} // \u1F60E is :sunglasses:; or {"foreign": "\u4E2D\u6587"} for "中文".
It's not likely that you'll have to use any of these, excluding the back slash for making quotes for character speech habits. I included brief summaries about them for the sake of curiosity.
What Not To Do
To avoid common mistakes, here's a quick list of pitfalls:
- Don't use single quotes or no quotes on keys/strings. (e.g. {'potato','VII','legobrick'} this does not work. You need to use double quotes "potato".)
{
'key': 'value', // Single quotes on key and value
bareKey: value // No quotes at all
}
- Don't add trailing commas in objects or arrays. (e.g. {"cake","squirrlydan","hammer",} the comma after "hammer" is a trailing comma.)
{
"items": ["apple", "banana", "cherry",] // Trailing comma in array
}
- Don't use leading zeros on integers (use strings for IDs). (e.g. {"value":043} if you have a number, it shouldn't start with zero. This doesn't apply to numbers being written as values: e.g. "#04" when keeping it in values. I have encountered a select few bots that have those kinds of special numerical titles for characters.)
{
"id": 007, // Leading zero on number
"phone": 00123456789
}
- Don't forget to escape special characters in strings. (e.g. {"quote":"He said,"Hello!"","path":"C:\System"} when you leave these naked the string terminates early breaking the code. Your robot friend won't be able to properly parse it anymore sad trombone.)
{
"quote": "He said, "Hello, world!"", // Unescaped inner quotes
"path": "C:\Windows\System32", // Unescaped backslashes
"multiline": "Line1
Line2" // Unescaped newline
}
- Don't include comments, functions, or dates natively—use strings. (e.g. big example below enclosed, illustrates it clearly. None of those items are contained properly in quotes or back/forward slashes to identify them.)
{
// This is a comment (invalid in JSON)
"func": function() { return "hi"; }, // Function not allowed
"date": new Date("2025-08-02") // Native date object invalid
}
- Don't uppercase booleans or quote them. (e.g. {"False","True"} these should not be upper case if you are utilizing booleans.)
{
"active": "True", // Quoted like a string
"enabled": FALSE // Uppercase invalid
}
- Don't duplicate keys in objects. (e.g. {"name":"Johnathan","name":"Clery"} duplicates will confuse the entity parsing.)
{
"name": "Alice",
"name": "Bob", // Duplicate key (causes errors or undefined behavior)
"age": 30,
"age": 25 // Another duplicate
}
- Don't nest too deep for readability. (e.g. {"coin_purse":{"coin_purse":{"coin_purse":{"coin_purse":{"coin_purse"}}}}} JSON is NOT a bag of holding!Not a deep one anyway...)
{
"bag": {
"innerBag": {
"deeperBag": {
"evenDeeper": {
"bottomlessPit": {
"value": "gold" // Buried too deep
}
}
}
}
}
}
- Don't skip validation with tools. (Check your work, to make sure it's clean and functional!)
// Pretend this is unvalidated code you're using blindly
{
"key": value, // Unquoted value (invalid)
"array": [1,2,3,] // Trailing comma
}
The Basics of JSON
Well, let's start out with some basic examples of structures and build our way up to the top! I would like to run you through some more examples of the above examination of syntax. I'll be breaking down parts and examples so that you can have a better grasp on how to use, when, and where, and what for!
Examples of Objects
When you are writing objects, make sure you're checking your placement for quotes (" "
) and your commas (,
) because this can cause complications with parsing.
Example 1:
{}
Above is just an empty object. The absolute basics. That's it, that's literally all there is; sometimes that's life. All your additional stuff goes in there.
Example 2:
{
"name": "Devhudir the Dragonborn",
"age": 7042,
"prestige": "Noble"
}
Here we have Devhudir the Dragonborn tucked into the object. Notice that anything in the key part (name, age, prestige) are all lowercase because JSON keys are case-sensitive.
Example 3:
{
"tomfooleryLevel": "high",
"recipients": "potato farmers"
}
This is just to further illustrate the point of what contents go into objects at a basic level. We will address more complex structures further down in this guide.
Example of Arrays
Basically your ordered lists. Values inside (your words, whatever is being listed—vegetables, maybe numbers, or furniture, for example) can be mixed types, including other arrays or objects. Example 2 exhibits mixed values. Order technically doesn't matter in listed arrays.
Example 1 is an empty array. Looks lonely, doesn't it? Notice that in Example 3, the words "true" and "null" are outside of quotes—and that is because true
will be identified as a true/false boolean, and null
is well, null. Putting the values in quotes helps identify whether or not these values fall into those categories.
Example 1:
[]
Example 2:
["apples", "bananas", "kiwi", "pineapple"]
Example 3:
[42, "Hitch Hiker's Guide", true, null, {"target": "dolphins"}]
Example 4:
[
{
"race": "human",
"flaw": "highly obsessed with cheese"
},
{
"race": "AI",
"flaw": "can't keep out of the garbage can"
}
]
Example of Values
Let's start by defining values. Values are the contents that go into arrays. Typical things you might use in terms of values for a Janitor profile would be things like physical descriptions like hair color, hair style, and eye color or other physical descriptions if you're getting down into the very nitty-gritty with distinguished features. It can also be items, like personal effects such as what the character is wearing. Maybe an NPC is particularly eccentric and has a funny burger hat or a silly purse. Honestly, there isn't really a limit on what a value can be.
Example 1: String values—below is the use of your backslashes. Backslashes are used to identify a new line of code, literal characters, and quotes.
"This is a string with \"escaped\" quotes and \ backslashes."
Example 2: Number values (in order) integer, float, and scientific.
42
3.1495
1.23e-4
Example 3: Boolean—this represents a binary state and are written as true
or false
without quotes. The purpose of a boolean is to represent yes/no or on/off conditions. You can use this to control weather functions in your chat memory (Example 3.B)!
A:
{
"enableNotifications": true,
"darkMode": false,
"autoSave": true
}
B:
{
"weather": {
"isRaining": false
}
}
Example 4: Null—this value in JSON represents the intentional absence of any value, an unknown state, or a placeholder. Here is an example of "null" used in an object in Example 4.A and used in Example 4.B, where null is used to substitute missing information. Note that null by itself is the standard value.
A:
{
"middleName": null
}
B:
[
"apple",
null,
"banana"
]
You might use "null" when redacting information about a character in chat summary or in chat memory.
Examples of Nesting
Objects are "nested" in arrays, or arrays in objects. This is a neater alternative to XML.
Example 1: This is a shallow version of a nest.
{
"outer": {
"inner": "The mailman's secret"
}
}
Example 2: And going slightly deeper—though typically you should try to avoid making your nested arrays too deep because it can confuse the LLM.
[
{
"category": "everyday life",
"subItems": [
{"act": "partying", "rating": 10},
{"act": "reading", "rating": "tiresome"}
]
}
]
Whitespace in JSON
When you exclude whitespace, you compress the code. For example:
[
1,
2,
3
]
becomes:
[1,2,3]
Checking Your Work
Now that we have those basics covered, let's talk about ways to check our work. There are a variety of website tools available to check your syntax and your formatting, as well as removing whitespace to minimize and adding whitespace in for readability.
- JSON Formatter: This one's a solid all-rounder—formats your JSON with proper indents, validates for errors, and even converts to XML or CSV if you're feeling experimental. Great for spotting whitespace issues by comparing minified vs. beautified versions.[](https://jsonformatter.org/)
- JSON Formatter & Validator: Advanced formatting with validation algorithms that highlight structural oopsies. It debugs whitespace by enforcing clean indents and lets you toggle between compact and readable modes.[](https://jsonformatter.curiousconcept.com/)
- JSONLint: The OG free validator and beautifier. Paste your JSON, it checks for syntax details like missing commas or unquoted keys, and formats with whitespace for human eyes.[](https://jsonlint.com/)
To give a few examples, and there are dozens more tools out there for assisting with JSON.
Extras
Template Example
Take it, it's yours as a reward for reading all the way through the guide!
You can experiment with this as a reference, and write your own.
{
"{{char}} = [Character first and last name]"
"first_name": "",
"last_name": "",
"visual_description": {
"hair_color": "",
"eye_color": "",
"height": "",
"body_type": "",
"piercings": "",
"tattoos": ""
},
"personality": [
{
"trait": "",
"description": "",
"sub_traits": []
}
],
"likes": [],
"dislikes": [],
"associations": {
"family_members_associates": {
"family_member": "",
"associate": "",
"associate": "",
"pet": ""
},
"co_workers": []
},
"back_story": "",
"nsfw_details": {
"relationship_style": "",
"ideal_partner": "",
"emotional_needs": "",
"turn_ons": [],
"turn_offs": [],
"during_sex": ""
},
"additional_notes": null
}
Additional inserts:
"abilities": [
{
"name": "",
"description": "",
"cooldown": 0,
"damage": 0
}
],
"weaknesses": [],
Thank you so much for reading, and happy coding!
Updated on: 03/08/2025
Thank you!