Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: conversation topics (aka: character cards) #2382

Open
Arcitec opened this issue May 19, 2024 · 0 comments
Open

feat: conversation topics (aka: character cards) #2382

Arcitec opened this issue May 19, 2024 · 0 comments

Comments

@Arcitec
Copy link

Arcitec commented May 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant