[GH-ISSUE #5236] [Feature]: improved macro behavior for character and persona cards #2896

Closed
opened 2026-10-21 05:57:45 +07:00 by bsakaguchi · 8 comments
Owner

Originally created by @stclaire on GitHub (Aug 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5236

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

The ability to have characters in a chat know about characters and/or personas aside from those that are added to the chat, without wasted tokens. This is useful for when you want the chat characters to have knowledge about another character but you don't want that other character to be a participant. This is especially useful for them to have knowledge of an additional persona, given that only a single persona can be added to a chat at a time.

The character card macro provides this, however it adds fields that aren't useful and therefore waste tokens. The persona card macro currently does not provide this at all. Please see details under "additional context" below.

(Apologies if this would have been better as a bug. I was torn between the feature request vs bug as it's half and half.)

Proposed solution

I think have both macros insert the card details, limited to the useful fields like are included for the cards that are added directly to the chat, at the location indicated by the lorebook entry (rather than inserting the character name there). I don't think there's much benefit to inserting just the name via this macro as the name could be added directly just as easily as adding the ID (but maybe there are use cases I haven't considered).

Alternatives considered

Alternatively, keep it in the "referenced characters" section, but maybe expose that in the preset editor, and ensure the persona details are added there as well, and reduce it to the useful fields. The nice thing with the other approach is this same behavior can be achieved via an outlet, so that approach gives a bit more flexibility.

Additional context

  • Using the {{21-character-card-ID}} macro in a lorebook entry results in the character name being inserted at the insertion point specified by the entry, and the card contents being inserted into a special "Referenced Characters" section. This section doesn't appear in the preset editor so cannot be configured. More problematically, the absolute entire card contents are included, not just what is included under for the characters added to a chat normally (such as <character_id>, , <character_version>, <creator_notes>, and ).

  • Using the {{persona-21-character-card-ID}} macro in a lorebook entry results in the persona name being inserted at the insertion point specified by the entry (just as with the character card macro) but the card contents itself does not seem to be inserted anywhere.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @stclaire on GitHub (Aug 18, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5236 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? The ability to have characters in a chat know about characters and/or personas aside from those that are added to the chat, without wasted tokens. This is useful for when you want the chat characters to have knowledge about another character but you don't want that other character to be a participant. This is especially useful for them to have knowledge of an additional persona, given that only a single persona can be added to a chat at a time. The character card macro provides this, however it adds fields that aren't useful and therefore waste tokens. The persona card macro currently does not provide this at all. Please see details under "additional context" below. (Apologies if this would have been better as a bug. I was torn between the feature request vs bug as it's half and half.) <!-- Describe the pain point or gap this feature would address --> ## Proposed solution <!-- What would you like to see added or changed? --> I think have both macros insert the card details, limited to the useful fields like are included for the cards that are added directly to the chat, at the location indicated by the lorebook entry (rather than inserting the character name there). I don't think there's much benefit to inserting just the name via this macro as the name could be added directly just as easily as adding the ID (but maybe there are use cases I haven't considered). ## Alternatives considered Alternatively, keep it in the "referenced characters" section, but maybe expose that in the preset editor, and ensure the persona details are added there as well, and reduce it to the useful fields. The nice thing with the other approach is this same behavior can be achieved via an outlet, so that approach gives a bit more flexibility. <!-- Any other approaches you thought about? --> ## Additional context - Using the {{21-character-card-ID}} macro in a lorebook entry results in the character name being inserted at the insertion point specified by the entry, and the card contents being inserted into a special "Referenced Characters" section. This section doesn't appear in the preset editor so cannot be configured. More problematically, the absolute entire card contents are included, not just what is included under <characters> for the characters added to a chat normally (such as <character_id>, <creator>, <character_version>, <creator_notes>, and <tags>). - Using the {{persona-21-character-card-ID}} macro in a lorebook entry results in the persona name being inserted at the insertion point specified by the entry (just as with the character card macro) but the card contents itself does not seem to be inserted anywhere. <!-- Optional: mockups, related issues, references, or examples --> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:57:45 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Aug 19, 2026):

Why not just use lorebooks then?

<!-- gh-comment-id:5339411443 --> @SpicyMarinara commented on GitHub (Aug 19, 2026): Why not just use lorebooks then?
Author
Owner

@stclaire commented on GitHub (Aug 19, 2026):

Lorebook entries are where I place the macro, in order for it to be triggered as needed, such as by keyword of the character name in chat. However, without the macro, I have to copy all the contents from the character/persona card into the lorebook entry and update both anytime I want to update the character/persona. If I could inject via the macro, then it would stay in sync automatically.

(I don't have permission to reopen the issue, so hopefully you see this reply 🙂)

<!-- gh-comment-id:5342820028 --> @stclaire commented on GitHub (Aug 19, 2026): Lorebook entries are where I place the macro, in order for it to be triggered as needed, such as by keyword of the character name in chat. However, without the macro, I have to copy all the contents from the character/persona card into the lorebook entry and update both anytime I want to update the character/persona. If I could inject via the macro, then it would stay in sync automatically. (I don't have permission to reopen the issue, so hopefully you see this reply 🙂)
Author
Owner

@SpicyMarinara commented on GitHub (Aug 19, 2026):

You don't have to write those manually, you can use macros for that. They resolve in lorebook entries just fine.

https://github.com/Pasta-Devs/Marinara-Engine/blob/main/docs/prompts/macros.md

<!-- gh-comment-id:5342886762 --> @SpicyMarinara commented on GitHub (Aug 19, 2026): You don't have to write those manually, you can use macros for that. They resolve in lorebook entries just fine. https://github.com/Pasta-Devs/Marinara-Engine/blob/main/docs/prompts/macros.md
Author
Owner

@stclaire commented on GitHub (Aug 19, 2026):

I am using the macros. I'm reporting that the persona one only resolves to the persona name and does not inject the persona card data at all, and while the character one does inject the card data, it injects fields that are not meant for the AI to consume and also it injects them in a section of the prompt that cannot be modified as opposed to where the lorebook entry sets the injection (it only injects the character name at that location).

<!-- gh-comment-id:5346643516 --> @stclaire commented on GitHub (Aug 19, 2026): I am using the macros. I'm reporting that the persona one only resolves to the persona name and does not inject the persona card data at all, and while the character one does inject the card data, it injects fields that are not meant for the AI to consume and also it injects them in a section of the prompt that cannot be modified as opposed to where the lorebook entry sets the injection (it only injects the character name at that location).
Author
Owner

@SpicyMarinara commented on GitHub (Aug 19, 2026):

It works perfectly fine for me. I am using it myself in lorebooks and it injects my entire persona info.

Image Image

For specific parts of your character card, just use these.

Image
<!-- gh-comment-id:5346715811 --> @SpicyMarinara commented on GitHub (Aug 19, 2026): It works perfectly fine for me. I am using it myself in lorebooks and it injects my entire persona info. <img width="850" height="725" alt="Image" src="https://github.com/user-attachments/assets/f13db48e-10d8-466d-90c0-58140a4e53bd" /> <img width="770" height="125" alt="Image" src="https://github.com/user-attachments/assets/d8a367ca-7405-480d-9277-acbbce4d3faa" /> For specific parts of your character card, just use these. <img width="529" height="404" alt="Image" src="https://github.com/user-attachments/assets/602608b9-41e2-49c1-9489-7e1a16f0eac6" />
Author
Owner

@stclaire commented on GitHub (Aug 19, 2026):

It's not for the currently selected persona or character, it's for one that has not been added to the chat. Using the {{persona-21character-card-ID}} and {{21-character-card-ID}} macros.

Checking again just now to make screenshots though, I discovered that when the persona card macro is used and no character card macro is used, the persona does actually get inserted and behaves exactly like the character card macro now, but filling a "referenced personas" section. But when both "referenced characters" and "referenced personas" exist, only "referenced characters" is created.

I don't think the field specific macros have a way to refer to a character or persona card that is not added to the chat as a normal character/persona, only the currently active one in chat, but if there's a way please let me know.

Here are some screenshots showing with just a persona referenced and where it is injected and how the sections don't show in the preset editor.

Image Image Image Image Image
<!-- gh-comment-id:5347651404 --> @stclaire commented on GitHub (Aug 19, 2026): It's not for the currently selected persona or character, it's for one that has not been added to the chat. Using the {{persona-21character-card-ID}} and {{21-character-card-ID}} macros. Checking again just now to make screenshots though, I discovered that when the persona card macro is used and no character card macro is used, the persona does actually get inserted and behaves exactly like the character card macro now, but filling a "referenced personas" section. But when both "referenced characters" and "referenced personas" exist, only "referenced characters" is created. I don't think the field specific macros have a way to refer to a character or persona card that is not added to the chat as a normal character/persona, only the currently active one in chat, but if there's a way please let me know. Here are some screenshots showing with just a persona referenced and where it is injected and how the sections don't show in the preset editor. <img width="1080" height="1024" alt="Image" src="https://github.com/user-attachments/assets/713a7efc-a7b6-4776-896d-65dbdf373ab6" /> <img width="1080" height="858" alt="Image" src="https://github.com/user-attachments/assets/a852bc30-59f1-4eb5-b92c-f3207617a582" /> <img width="1080" height="1394" alt="Image" src="https://github.com/user-attachments/assets/a6d782f7-f54f-4316-9257-7c2a7613182e" /> <img width="1080" height="515" alt="Image" src="https://github.com/user-attachments/assets/7d290271-50e9-4166-a706-bb24c875ed43" /> <img width="1079" height="1575" alt="Image" src="https://github.com/user-attachments/assets/6d550666-5064-467c-99d7-a2ba72377559" />
Author
Owner

@SpicyMarinara commented on GitHub (Aug 19, 2026):

Pookie, you can turn those personas into character cards with one click and use character macros for those.

<!-- gh-comment-id:5347770857 --> @SpicyMarinara commented on GitHub (Aug 19, 2026): Pookie, you can turn those personas into character cards with one click and use character macros for those.
Author
Owner

@stclaire commented on GitHub (Aug 19, 2026):

True, but then one has to manually keep them in sync when any update is made. And it's definitely unexpected that the referenced persona stops working when a character is referenced at the same time, so I imagine that would lead to users expecting a persona to be injected and then struggling to figure out why it wasn't. I thought the macro was broken altogether until I tried just a referenced persona to test and grab the screenshots for this. If you don't want to make both work at the same time, then maybe at least add something to the macro docs to indicate that the persona one won't inject the card if character cards are also injected, just to save folks wondering what's going on?

It also doesn't address the inability to set where the card info is inserted, or restrict it to just the fields that are relevant for the AI (the ones that appear for the characters or persona actually active in the chat). Alternatively, maybe add macros for the specific fields (like the macros you mentioned above) but for a given character or persona card, maybe something like {{description-persona-21character-card-ID}} and {{description-21-character-card-ID}} etc...? That would be the most flexible, though that is a lot of macros to add.

In any case, thanks very much for considering.

<!-- gh-comment-id:5349042516 --> @stclaire commented on GitHub (Aug 19, 2026): True, but then one has to manually keep them in sync when any update is made. And it's definitely unexpected that the referenced persona stops working when a character is referenced at the same time, so I imagine that would lead to users expecting a persona to be injected and then struggling to figure out why it wasn't. I thought the macro was broken altogether until I tried _just_ a referenced persona to test and grab the screenshots for this. If you don't want to make both work at the same time, then maybe at least add something to the macro docs to indicate that the persona one won't inject the card if character cards are also injected, just to save folks wondering what's going on? It also doesn't address the inability to set where the card info is inserted, or restrict it to just the fields that are relevant for the AI (the ones that appear for the characters or persona actually active in the chat). Alternatively, maybe add macros for the specific fields (like the macros you mentioned above) but for a given character or persona card, maybe something like {{description-persona-21character-card-ID}} and {{description-21-character-card-ID}} etc...? That would be the most flexible, though that is a lot of macros to add. In any case, thanks very much for considering.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2896
No description provided.