Core concepts
Mode Injection
A manually toggled snippet. Enable it on an assistant and it is always injected whenever that assistant is active. Ideal for “modes” like a formal writing style or a step-by-step reasoning format.
Lorebook
A named collection of entries. Each entry carries keywords; when those keywords appear in recent messages, the entry’s content is automatically injected. Perfect for world-building reference material or project glossaries.
Injection positions
Every injection targets a specific location in the message list. Choose the position that best matches the intent of your content.Before System Prompt
Before System Prompt
Inserts the content immediately before the existing system message. Use this for high-priority framing that should precede all other instructions.
After System Prompt
After System Prompt
Appends the content to the end of the system message. This is the most common position — it extends the system prompt without replacing it.
Top of Chat
Top of Chat
Places the content just before the first user message in the conversation history. Useful for setting scene context that appears once at the start.
Bottom of Chat
Bottom of Chat
Inserts the content immediately before the most recent user message. Good for reminders or dynamic context that should be fresh in the model’s attention.
At Depth
At Depth
Inserts at a specific depth from the end of the message list (e.g., depth 4 = four messages from the bottom). Use this for precise placement relative to recent conversation turns.
Creating a mode injection
1
Open Settings
Tap the settings icon from the main screen.
2
Navigate to Prompts
Select Prompts (also accessible from the Extensions tab of an assistant via the Go to Prompts button).
3
Add a mode injection
Tap + in the Mode Injections section. Give it a name, write the content, choose an injection position, set a role (User or Assistant), and assign a priority.
4
Save
Tap Save. The injection is now available to attach to any assistant.
Creating a lorebook
1
Open Settings → Prompts
Navigate to the Lorebooks section and tap + to create a new lorebook.
2
Name the lorebook
Give it a descriptive name such as “Fantasy World Lore” or “Project Glossary”.
3
Add entries
Inside the lorebook, tap + to create an entry. For each entry, configure:
- Keywords — the words or patterns that trigger this entry.
- Content — the text to inject when triggered.
- Injection position and role.
- Scan depth — how many recent messages to check for keyword matches.
- Use regex — treat keywords as regular expressions instead of plain text.
- Case sensitive — whether matching respects letter case.
- Constant active — inject this entry unconditionally, regardless of keywords.
4
Save the lorebook
Tap Save. The lorebook and all its entries are now ready to attach to assistants.
Attaching injections to an assistant
1
Open the assistant's Extensions tab
Go to Settings → Assistants, tap an assistant, and select the Extensions tab.
2
Enable mode injections
Switch to the Mode Injections sub-tab and toggle on any injections you want active for this assistant.
3
Enable lorebooks
Switch to the Lorebooks sub-tab and toggle on any lorebooks whose entries should be available in this assistant’s conversations.
Key assistant fields
set
The set of mode injections that are active for this assistant. Any injection in this set is included in every conversation, regardless of message content.
set
The set of lorebooks attached to this assistant. Entries within those lorebooks fire automatically when their keywords are detected in recent messages.
boolean
default:"false"
When enabled, each individual conversation can override this assistant’s system prompt. Turn this on if you want to customise the system prompt on a per-chat basis without changing the assistant’s default.
boolean
default:"false"
When enabled, each conversation can bind its own set of mode injections and lorebooks, overriding the assistant-level selection. Enable this when you want to mix and match injections dynamically per conversation.
Message template
The message template wraps every user message before it is sent to the model. The default value is{{message}}, which sends the message as-is. You can add surrounding context, formatting, or persona hints around it.
string
default:"{{message}}"
A template string applied to each outgoing user message. Must include
{{message}} somewhere so the user’s actual text is passed through. Rikka will flag an error if this placeholder is missing.Placeholder variables
Placeholder variables can be used inside the message template, the system prompt, or any injection content. Rikka replaces them with live values at the time each message is sent. Both{{variable}} and {variable} syntax are accepted.
Tap any variable chip shown beneath the system prompt or template editor to insert it at the cursor position.
How injection priority works
When multiple injections target the same position, Rikka sorts them by their priority value in descending order — higher number means injected first. Injections with the same role at the same position are merged into a single message to keep the conversation structure clean.Rikka is careful not to insert injected messages between a user message and an immediately following assistant message that contains tool calls, because some providers (such as DeepSeek) require those two messages to be adjacent for correct reasoning.