Migrating Lore Data Between AI Roleplay Platforms

Converting lorebooks between different AI roleplay applications is often more complex than simply copying and pasting text. Each platform uses distinct data structures to manage character memory, context triggers, and narrative constraints. When moving from a service like JanitorAI to a self-hosted client like SillyTavern, users frequently encounter broken formatting or lost context because the underlying JSON schemas do not align perfectly.
The core challenge lies in how each app defines 'lore.' Some platforms treat lore as simple text blocks, while others rely on specific keys for priority, depth, and trigger words. Without a proper conversion strategy, your character’s personality might vanish, or the AI might ignore critical background information entirely. This guide explains the structural differences and provides a reliable method to migrate your data.
By understanding the technical requirements of both systems, you can ensure that your character’s backstory, relationships, and behavioral traits are preserved accurately. This process is essential for maintaining immersion, especially when switching between cloud-based services and local inference engines. We will cover the manual steps, the necessary JSON transformations, and how to verify that your converted lorebook functions correctly in the new environment.
Frequently asked questions
What is a lorebook in AI roleplay?
A lorebook is a structured database of facts, character traits, and narrative rules that the AI references during conversation. It acts as an external memory bank, allowing the model to recall specific details about a character’s appearance, history, or personality without relying solely on the chat history. It ensures consistency in roleplay scenarios.
How does JanitorAI lore differ from SillyTavern lore?
JanitorAI uses a simplified, often flat structure for lore entries, focusing on ease of use. SillyTavern, however, supports a more complex JSON format with fields for priority, depth, and specific trigger keys. SillyTavern allows for finer control over when and how often lore is injected into the context, offering more granular management of the AI’s attention.
Which is better for detailed character memory?
SillyTavern is generally better for detailed memory management due to its advanced JSON structure. It allows for nested lore entries, specific trigger words, and priority levels that help the model prioritize relevant information. JanitorAI is simpler but may struggle with large, complex lorebooks, leading to context overflow or ignored details.
What is the main difference in data structure?
The main difference is the level of nesting and metadata. SillyTavern uses a nested JSON object with specific keys for each lore entry, including metadata like 'depth' and 'priority'. JanitorAI often uses a simpler list or dictionary format. This structural difference requires manual reformatting when migrating data between the two platforms.
Why do some lore entries disappear after conversion?
Lore entries may disappear if the conversion process fails to map the source fields to the target fields correctly. SillyTavern requires specific keys like 'entryID', 'key', and 'content'. If these are missing or incorrectly formatted, the app may ignore the entry. Additionally, priority settings might be lost, causing the lore to be deprioritized in the context window.
Can I convert multiple lorebooks at once?
Yes, you can convert multiple lorebooks by processing them in bulk. However, you must ensure that each lorebook is exported in a compatible format, such as JSON. You can then write a script to iterate through each file, transform the data structure, and save the converted files. This approach is efficient for users with large collections of characters.
What is the role of 'priority' in lorebooks?
Priority determines how often a lore entry is injected into the context window. Higher priority entries are more likely to be included in the AI’s context, ensuring that critical information is always present. Lower priority entries are only included if there is space in the context window. This feature helps manage context limits and prevents irrelevant information from cluttering the prompt.
How do I verify my converted lorebook works?
To verify your converted lorebook, start a new conversation with the character and ask specific questions about their lore. Check if the AI recalls the correct details, such as their name, appearance, or backstory. You can also monitor the context window in SillyTavern to see if the lore entries are being injected correctly. If the AI forgets key details, you may need to adjust the priority or trigger words.
Step by step
- Export Lorebook — Export your lorebook from JanitorAI in JSON format to preserve data integrity. Avoid CSV or plain text exports to prevent formatting issues.
- Inspect Data — Open the exported JSON file and inspect the structure. Identify fields like 'name', 'content', and 'id' that need to be mapped to SillyTavern's format.
- Map Fields — Map JanitorAI's fields to SillyTavern's required fields: 'content', 'key', 'priority', and 'depth'. Ensure metadata is preserved for proper context injection.
- Convert and Save — Use a Python script or manual editing to convert the data. Save the converted lorebook in SillyTavern's JSON format.
- Import to SillyTavern — Import the converted JSON file into SillyTavern. Verify that all entries are present and formatted correctly in the lorebook manager.
- Test and Debug — Start a conversation with the character and ask specific questions about their lore. Monitor the context window and use the console to debug any issues.
Understanding the Data Structures
Before attempting any conversion, it is crucial to understand how each platform structures its data. JanitorAI typically exports lorebooks in a simplified JSON format that prioritizes ease of use over granular control. This format often lacks the metadata fields that SillyTavern relies on for advanced context management. The absence of fields like 'priority' or 'depth' can lead to issues when importing data into SillyTavern, as the app may not know how to prioritize certain entries.
SillyTavern, on the other hand, uses a more complex JSON structure that includes metadata for each lore entry. This structure allows for precise control over how and when lore is injected into the context window. The 'priority' field determines the likelihood of an entry being included, while the 'depth' field controls how far back in the conversation history the lore is relevant. Understanding these differences is the first step in a successful conversion.
JanitorAI Format Overview
JanitorAI's format is straightforward, often using a simple list of objects. Each object contains the lore content and possibly a name or ID. This simplicity makes it easy to read but difficult to map to SillyTavern's more complex requirements. The lack of metadata means that all entries are treated equally, which can lead to context overflow in SillyTavern.
SillyTavern Format Overview
SillyTavern's format is nested and metadata-rich. Each lore entry is an object with specific keys like 'entryID', 'key', 'content', 'priority', and 'depth'. This structure allows for fine-tuned control over context injection. The 'key' field defines the trigger words that activate the lore, while 'priority' controls its importance. This level of detail is essential for managing large lorebooks.
- JanitorAI uses a flat JSON structure with minimal metadata.
- SillyTavern uses a nested JSON structure with metadata like 'priority' and 'depth'.
- SillyTavern requires specific keys like 'entryID' and 'key' for proper functioning.
Exporting Lore from JanitorAI
The first step in the migration process is to export your lorebook from JanitorAI. Most platforms allow you to export data in JSON format, which is the standard for SillyTavern. Ensure that you select the JSON option during export to maintain the data integrity. If the platform offers a CSV or plain text export, you may need to manually convert the data, which increases the risk of errors.
Once you have exported the lorebook, open the JSON file in a text editor or a JSON viewer. This will allow you to inspect the structure of the data and identify any fields that need to be mapped to SillyTavern's format. Pay close attention to the 'content' field, as this is where the actual lore text resides. You will need to ensure that this text is correctly formatted for SillyTavern.
Exporting as JSON
Exporting as JSON is the most reliable method for preserving data integrity. JSON is a lightweight data-interchange format that is easy to parse and manipulate. Most modern AI platforms support JSON export, making it the standard for data migration. Always choose JSON over CSV or plain text to avoid formatting issues.
Inspecting the Data
After exporting, inspect the JSON file to understand its structure. Look for fields like 'name', 'content', and 'id'. These fields will need to be mapped to SillyTavern's required fields. If any fields are missing, you may need to manually add them or adjust the conversion script to handle missing data.
- Always export lorebooks in JSON format for best results.
- Inspect the exported JSON file to understand its structure.
- Look for fields like 'name', 'content', and 'id' for mapping.

Mapping Fields for SillyTavern
Mapping fields correctly is the most critical step in the conversion process. SillyTavern requires specific fields such as 'entryID', 'key', 'content', 'priority', and 'depth'. You need to map JanitorAI's fields to these required fields. For example, JanitorAI's 'name' might map to SillyTavern's 'key', while the 'content' field remains the same. Mismapping these fields can result in lore entries that do not trigger correctly or are ignored by the AI.
It is also important to consider the 'priority' and 'depth' fields. SillyTavern uses these fields to control how often and how far back in the conversation history the lore is injected. If you do not set these fields correctly, the AI may ignore important lore or include too much irrelevant information. You may need to experiment with different priority levels to find the right balance for your character.
Mapping Content and Keys
The 'content' field in SillyTavern holds the actual lore text. This field should be mapped directly from JanitorAI's 'content' field. The 'key' field defines the trigger words that activate the lore. You can map JanitorAI's 'name' or 'id' to this field, or you can create custom trigger words that are more specific to the lore entry.
Setting Priority and Depth
Priority and depth are crucial for managing context. Priority determines how often the lore is included, while depth determines how far back in the conversation it is relevant. You can set priority to 'High', 'Medium', or 'Low', and depth to a specific number of messages. Experiment with these settings to find the right balance for your character.
- Map 'content' to SillyTavern's 'content' field.
- Map 'name' or 'id' to SillyTavern's 'key' field.
- Set 'priority' and 'depth' to control context injection.
Writing a Conversion Script
For users with large lorebooks, manual conversion can be tedious and error-prone. Writing a Python script to automate the conversion process is a more efficient solution. The script can read the JanitorAI JSON file, map the fields to SillyTavern's format, and save the converted data. This approach ensures consistency and reduces the risk of human error. It also allows for easy updates if the data structure changes in the future.
The script should handle edge cases, such as missing fields or invalid data. It should also allow for customization, such as setting default priority levels or adding custom trigger words. By automating the conversion process, you can save time and ensure that your lorebooks are consistently formatted across all your characters.
Basic Conversion Logic
The basic logic involves reading the source JSON, iterating through each lore entry, and creating a new object with the mapped fields. The script should handle missing fields by assigning default values or skipping the entry. It should also validate the data to ensure that all required fields are present before saving the converted file.
Handling Edge Cases
Edge cases include missing fields, invalid data, or duplicate entries. The script should handle these cases gracefully by logging warnings or errors. It should also allow for customization, such as setting default priority levels or adding custom trigger words. This flexibility ensures that the script can handle a wide variety of lorebooks.
- Use Python to automate the conversion process.
- Handle edge cases like missing fields and invalid data.
- Allow for customization of priority and trigger words.
import json
def convert_lorebook(janitor_json, output_file):
with open(janitor_json, 'r', encoding='utf-8') as f:
data = json.load(f)
converted = []
for entry in data:
new_entry = {
'entryID': entry.get('id', 'unknown'),
'key': entry.get('name', 'default'),
'content': entry.get('content', ''),
'priority': 'Medium',
'depth': 10
}
converted.append(new_entry)
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(converted, f, indent=4)
print(f'Converted lorebook saved to {output_file}')
Importing to SillyTavern
Once you have converted your lorebook, the next step is to import it into SillyTavern. SillyTavern supports importing lorebooks in JSON format, so you can simply load the converted file into the app. Make sure to select the correct file type and ensure that the file is not corrupted. If the import fails, check the console for error messages and verify that the JSON structure is correct.
After importing, you should verify that the lorebook has been loaded correctly. Check the lorebook manager in SillyTavern to ensure that all entries are present and formatted correctly. You can also test the lorebook by starting a conversation with the character and asking specific questions about their lore. If the AI recalls the correct details, the import was successful.
Loading the JSON File
Loading the JSON file is straightforward. In SillyTavern, go to the Lorebook section and select 'Import'. Choose the converted JSON file and confirm the import. SillyTavern will parse the file and add the lore entries to the character's lorebook. Ensure that the file is in the correct format to avoid parsing errors.
Verifying the Import
After importing, verify that all entries are present. Check the lorebook manager to ensure that the entries are formatted correctly. You can also test the lorebook by starting a conversation with the character. Ask specific questions about their lore to see if the AI recalls the correct details. If the AI forgets key details, you may need to adjust the priority or trigger words.
- Import the converted JSON file into SillyTavern.
- Check the console for error messages if the import fails.
- Verify that all entries are present and formatted correctly.
Testing and Debugging
Testing is essential to ensure that your converted lorebook functions correctly. Start a new conversation with the character and ask specific questions about their lore. Check if the AI recalls the correct details, such as their name, appearance, or backstory. If the AI forgets key details, you may need to adjust the priority or trigger words. You can also monitor the context window in SillyTavern to see if the lore entries are being injected correctly.
Debugging involves identifying and fixing issues with the lorebook. Common issues include missing entries, incorrect formatting, or low priority settings. You can use SillyTavern's console to log errors and warnings. This can help you identify problems with the conversion process or the lorebook itself. By systematically testing and debugging, you can ensure that your lorebook works as intended.
Conducting Conversation Tests
Conducting conversation tests is the best way to verify the lorebook. Ask specific questions about the character's lore and check if the AI recalls the correct details. If the AI forgets key details, you may need to adjust the priority or trigger words. You can also monitor the context window to see if the lore entries are being injected correctly.
Using the Console for Debugging
SillyTavern's console can be used to log errors and warnings. This can help you identify problems with the conversion process or the lorebook itself. Look for messages about missing fields, invalid data, or context overflow. By addressing these issues, you can ensure that your lorebook works as intended.
- Ask specific questions about the character's lore.
- Monitor the context window to see if lore entries are injected.
- Use the console to log errors and warnings.

Optimizing Lorebook Performance
Optimizing your lorebook for performance is crucial for maintaining a smooth roleplay experience. Large lorebooks can slow down the AI and cause context overflow. To optimize, you can reduce the number of entries, adjust priority levels, or use trigger words more effectively. You can also split large lorebooks into smaller, more manageable chunks. This approach ensures that only relevant information is included in the context window.
Another optimization strategy is to use 'depth' settings to limit how far back in the conversation history the lore is relevant. This can prevent old lore from cluttering the context window and wasting tokens. By carefully managing priority, depth, and trigger words, you can ensure that your lorebook is both effective and efficient.
Reducing Context Overload
Context overload occurs when the lorebook includes too much information, causing the AI to ignore important details. To reduce overload, you can reduce the number of entries, adjust priority levels, or use trigger words more effectively. Splitting large lorebooks into smaller chunks can also help manage context limits.
Using Depth Settings
Depth settings limit how far back in the conversation history the lore is relevant. This can prevent old lore from cluttering the context window and wasting tokens. By setting appropriate depth values, you can ensure that only recent and relevant lore is included in the context window.
- Reduce the number of entries to avoid context overload.
- Adjust priority levels to control context injection.
- Use depth settings to limit lore relevance.
Common Conversion Pitfalls
There are several common pitfalls that users encounter when converting lorebooks. One common issue is mismapping fields, which can result in lore entries that do not trigger correctly. Another issue is losing metadata, such as priority and depth, which can affect how the AI uses the lore. It is important to carefully map fields and preserve metadata during the conversion process.
Another pitfall is failing to test the converted lorebook thoroughly. Without proper testing, you may not notice issues with priority, trigger words, or context overflow. By systematically testing and debugging, you can identify and fix these issues before they become major problems. It is also helpful to keep a backup of the original lorebook in case you need to revert changes.
Mismapping Fields
Mismapping fields is a common error that can result in lore entries that do not trigger correctly. Ensure that you map fields like 'content', 'key', 'priority', and 'depth' correctly. Mismapping can lead to lore entries that are ignored by the AI or included at the wrong time.
Losing Metadata
Losing metadata, such as priority and depth, can affect how the AI uses the lore. Ensure that these fields are preserved during the conversion process. If metadata is lost, you may need to manually add it or adjust the conversion script to include it.
- Mismapping fields can cause lore entries to trigger incorrectly.
- Losing metadata like priority and depth can affect AI behavior.
- Test thoroughly to identify and fix common pitfalls.

Test our unfiltered 35B model right now with no key, no account, and no limits.
Home →