[GH-ISSUE #2382] feat: conversation topics (aka: character cards) #51529

Closed
opened 2026-05-05 12:34:52 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Arcitec on GitHub (May 19, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/2382

Is your feature request related to a problem? Please describe.
Getting help with creative novel writing, or creating Dungeons & Dragons adventures, is very very very difficult in OpenWebUI. It doesn't have enough context to remember the story's characters at all.

After a few generations, the AI has no clue whatsoever about anything and begins to hallucinate in Open-WebUI, totally changing character names and personality automatically, etc.

Other UIs have solved this by having "character cards".

Describe the solution you'd like
In other story-focused UIs, such as TavernAI and KoboldAI, there's a UI where you can create and name permanent characters and describe their personality, inventory (if any), appearance, etc.

Whenever you mention a character by name in your prompt, those UIs inject the appropriate character info back into the model's input/context, to remind the model about those characters. I am not sure, but they possibly also do this when the AI model generates any of the keywords as a token by itself (which could be implemented by pausing when the token is encountered, injecting more context, and then resuming generation; but only do this if the context didn't already contain that topic/character card).

It uses keywords to know when to re-inject each character's descriptions. Each character/topic can have multiple different keywords which all trigger the text injection. Comma-separated lists are frequently used for this purpose.

Example: You are writing a book about Harry Potter (let's just use a famous example). You would have a Character Card for "Harry Potter", set keywords to something appropriate like "harry" and "potter", and have an appearance that describes that he has short black hair, round glasses, and a scar on his forehead. And a summary that says that he wants to find and stop Voldemort.

Whenever you write about Harry in the story, each AI model output will then accurately remember who Harry is and will create lines such as referencing that Harry's scar hurts when Voldemort is nearby, and so on.

This feature is incredible for writing novels and D&D adventures, and can apply to other things such as business planning, by including important concepts based on keywords. It helps the AI stay completely coherent and on topic.

Therefore I suggest that the feature would be named something else, such as "Topics", where the user can set up any title, keywords (which is what triggers the inclusion), and the exact text that gets injected into the user's context whenever the keyword is mentioned. That would be more flexible than the existing solutions from other projects.

So you'd have a text field for the extra context to inject, along with a counter showing how long your injected text is (to encourage people to keep it short to not waste context).

I also suggest that the Topics can be shared between stories, such as by "link topic" which lets you pick another conversation and click a topic in it to re-use the same one (as an actual link which edits the original source if any settings are tweaked, to avoid duplicate data).

Lastly, I suggest that the feature intelligently avoids duplicating the info, by placing all of the injected characters at the oldest (topmost) portion of the context, and only injecting each relevant topic/character once per generation, so that it doesn't waste too many tokens on these injections. For example, in the Harry Potter example, the character info would be placed at the top, and then the story so far would be in the remaining context tokens below that.

Describe alternatives you've considered
There are alternative "story" UIs but they're nowhere near as professional as Open-WebUI, usually very janky and unpleasant to use. Open-WebUI is simply the greatest LLM UI of them all.

There's a character card editor at https://zoltanai.github.io/character-editor/ which can help with inspiration for such a feature. Click on "New Character" and hover over the info-bubbles to see examples of what kind of information someone would want to include in the story's context and why it's useful. Although I don't suggest having static fields at all. Just having a single "exactly what to add to the LLM context when this topic/keyword is mentioned" would be more appropriate and more powerful in Open-WebUI.

Related issues: #467

Originally created by @Arcitec on GitHub (May 19, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/2382 **Is your feature request related to a problem? Please describe.** Getting help with creative novel writing, or creating Dungeons & Dragons adventures, is very very very difficult in OpenWebUI. It doesn't have enough context to remember the story's characters at all. After a few generations, the AI has no clue whatsoever about anything and begins to hallucinate in Open-WebUI, totally changing character names and personality automatically, etc. Other UIs have solved this by having "character cards". **Describe the solution you'd like** In other story-focused UIs, such as TavernAI and KoboldAI, there's a UI where you can create and name permanent characters and describe their personality, inventory (if any), appearance, etc. Whenever you mention a character by name in your prompt, those UIs inject the appropriate character info back into the model's input/context, to remind the model about those characters. I am not sure, but they possibly also do this when the AI model generates any of the keywords as a token by itself (which could be implemented by pausing when the token is encountered, injecting more context, and then resuming generation; but only do this if the context didn't already contain that topic/character card). It uses keywords to know when to re-inject each character's descriptions. Each character/topic can have multiple different keywords which all trigger the text injection. Comma-separated lists are frequently used for this purpose. Example: You are writing a book about Harry Potter (let's just use a famous example). You would have a Character Card for "Harry Potter", set keywords to something appropriate like "harry" and "potter", and have an appearance that describes that he has short black hair, round glasses, and a scar on his forehead. And a summary that says that he wants to find and stop Voldemort. Whenever you write about Harry in the story, each AI model output will then accurately remember who Harry is and will create lines such as referencing that Harry's scar hurts when Voldemort is nearby, and so on. This feature is incredible for writing novels and D&D adventures, and can apply to other things such as business planning, by including important concepts based on keywords. It helps the AI stay completely coherent and on topic. Therefore I suggest that the feature would be named something else, such as "Topics", where the user can set up any title, keywords (which is what triggers the inclusion), and the exact text that gets injected into the user's context whenever the keyword is mentioned. That would be more flexible than the existing solutions from other projects. So you'd have a text field for the extra context to inject, along with a counter showing how long your injected text is (to encourage people to keep it short to not waste context). I also suggest that the Topics can be shared between stories, such as by "link topic" which lets you pick another conversation and click a topic in it to re-use the same one (as an actual link which edits the original source if any settings are tweaked, to avoid duplicate data). Lastly, I suggest that the feature intelligently avoids duplicating the info, by placing all of the injected characters at the oldest (topmost) portion of the context, and only injecting each relevant topic/character *once* per generation, so that it doesn't waste too many tokens on these injections. For example, in the Harry Potter example, the character info would be placed at the top, and then the story so far would be in the remaining context tokens below that. **Describe alternatives you've considered** There are alternative "story" UIs but they're nowhere near as professional as Open-WebUI, usually very janky and unpleasant to use. Open-WebUI is simply the greatest LLM UI of them all. There's a character card editor at https://zoltanai.github.io/character-editor/ which can help with inspiration for such a feature. Click on "New Character" and hover over the info-bubbles to see examples of what kind of information someone would want to include in the story's context and why it's useful. Although I don't suggest having static fields at all. Just having a single "exactly what to add to the LLM context when this topic/keyword is mentioned" would be more appropriate and more powerful in Open-WebUI. Related issues: #467
Author
Owner

@tjbck commented on GitHub (Jun 17, 2024):

Just added a basic support for character cards on latest dev, you should be able to import your card by clicking on the image profile button from the model create page! Let me know if you encounter any issues!

<!-- gh-comment-id:2172862327 --> @tjbck commented on GitHub (Jun 17, 2024): Just added a basic support for character cards on latest dev, you should be able to import your card by clicking on the image profile button from the model create page! Let me know if you encounter any issues!
Author
Owner

@bryanmcguire commented on GitHub (Jun 23, 2024):

To make this work the same way as TavernAI/SillyTavern, you'd have to have the option to automatically prepend a username to your messages and prompt the model to start its response with the character's name. Something like this for ChatML instruct models:

<|im_start|>user
Gondor: *Gondor's heart races and he's unsure why, but he goes with it* Sure, Niko. I'm all ears. What's your secret?<|im_end|>
<|im_start|>assistant
Niko:

You'd have to have some way of setting up the {{user}} and {{char}}, and there would have to be some work to make this not look janky and unpleasant.

<!-- gh-comment-id:2184403454 --> @bryanmcguire commented on GitHub (Jun 23, 2024): To make this work the same way as TavernAI/SillyTavern, you'd have to have the option to automatically prepend a username to your messages and prompt the model to start its response with the character's name. Something like this for ChatML instruct models: ``` <|im_start|>user Gondor: *Gondor's heart races and he's unsure why, but he goes with it* Sure, Niko. I'm all ears. What's your secret?<|im_end|> <|im_start|>assistant Niko: ``` You'd have to have some way of setting up the {{user}} and {{char}}, and there would have to be some work to make this not look janky and unpleasant.
Author
Owner

@justinh-rahb commented on GitHub (Jun 23, 2024):

Good news, there is such a variable now. I don't know if off the top of my head, but it's out there..

<!-- gh-comment-id:2184754205 --> @justinh-rahb commented on GitHub (Jun 23, 2024): Good news, there is such a variable now. I don't know if off the top of my head, but it's out there..
Author
Owner

@nonetrix commented on GitHub (Oct 25, 2024):

Needs intro message support and auto importing of tags

<!-- gh-comment-id:2436738896 --> @nonetrix commented on GitHub (Oct 25, 2024): Needs intro message support and auto importing of tags
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#51529