Creating custom AI Bot personas

How do you select personas? and what are personas vs ai bot enabled chat commands ?

Specifically, how do you do this?

1 Like

Personas are the best way @sam found to allow us to support more and better commands. Instead of a “single bot” that tries to to everything but eventually forgets and fails because of well know LLM limitations, picking the appropriate persona on the start gets you a way better experience.

2 Likes

Aha! That’s awesome. I had been starting my chats as PMs myself.

This also explains a bug. If you start a PM and send it to a GPT, it covers up the subject so you can’t send the message. No one who was using the plugin sensibly would do this.

Why I never used the icon to start a chat I cannot explain. I even told a user that they could start a chat that way, but I never thought to do it myself!?

My next question is how easy it is or will be to create new personas. (I’ll next look at the code.)

For example, I created a template (that works with the AI chatbot plugin) like this:

@AIBot 

You are a friendly and helpful tutor. Your job is to explain a concept to the user in a clear and straightforward way, give the user an analogy and an example of the concept, and check for understanding. blah blah blah
. . . 

and so on.

I’d love to be able to make that the persona.

EDIT: At first glance, it looks like just a few files need to get changed to add a persona. The person itself, and then entry_point.rb needs to require it and there needs to be a setting to enable it. Oh! Or maybe there could be a custom persona that would take the prompt as a site setting. I guess that’s a longer-term solution. Would it make sense for me to try my hand at a PR for that, or should I just fork my own version for now?

3 Likes

We plan on making prompts customizable in the future, but it’s too early for that still.

I’d start in a fork, in this “preview” state of the plugin we are moving a lot and can’t commit to keeping internal code structure stable.

If you get something that you think is generally useful and can get it to the same standard as other personas then you can open a topic in feature to discuss a PR.

6 Likes

@pfaffman we are thinking about all the different types of personas we can have for the AI Bot. So far we have narrowed it down to the following but still experimenting…

  • Forum Helper: General purpose AI bot capable of performing various tasks. Can search your current Discourse instance and use that information to build responses
    • i.e - What are the top posts for AI?
  • SQL Helper: AI Bot specialized in helping craft SQL queries on this Discourse Instance (aware of your current DB schema)
    • i.e - Write me a query to find all the AI bot messages by a specific customer/user
  • Artist: AI Bot specialized in generating images
    • i.e - Draw me a picture of a cat
  • Settings Explorer: AI Bot specialized in helping explore Discourse site settings. (aware of Discourse source code)
    • i.e - How do I enable Discourse AI on my Discourse site?
  • Researcher: AI Bot with Google access to research information for you
    • i.e - How many legs does a dinosaur have?

Were there other personas you would like to see for the AI Bot? Would you find any value in developing your own “custom” persona (if you didn’t like the ones posted above)?

1 Like

My idea, that I have done zero work on, is to have a category for personas that would have the OP of the topic be the prompt. I’m envisioning custom prompts like this one that will create a prompt to give to an AI image generator: ChatGPT Prompt Genius Engineering | MetricsMule, or a prompt from Now is the time for grimoires - by Ethan Mollick that starts with

I think that custom prompts/personas are likely to be a useful feature for lots of communities and would make it trivial to add new prompts to core (oh, but it might also make it more difficult for core to update those prompts since it would be hard to know if they had been edited on purpose. . .)

Or maybe rather than a topic just have a setting that included an array of prompts, which might be a better way to manage them than topics (which is working for canned-replies).

3 Likes

What in this persona builds on top of the Discourse integration, other than using the Discourse UI as a front-end for the external LLM?

For most of our personas we are looking into doing RAG, were we can create something that using an out of the shelf LLM won’t also give you.

3 Likes

Oh. Uh. . .

Yeah. That’s what I’m wanting.

My use case is to create course assignments (like the helpful tutor) that guide people through some AI-generated activity. Discourse is my hammer, so I want everything to be in Discourse. (I spent like 12 hours this weekend finding and installing a URL shortener/QR code generator–I think I could have done it faster as a Discourse plugin!).

Looking at what I and my students have been paying for API calls, it looks much cheaper to have Discourse as a way to use GPT4 than to pay $20/month to use their interface.

If anyone else is listening, I think he means this: What is retrieval-augmented generation? | IBM Research Blog.

Oh, sorry. Yeah, I’m far afield from that.

2 Likes

Can I add “Socratic tutor” to this list? I have been experimenting with a web app which runs a set of structured prompts against a student’s essay to provide them feedback. I would love to be able to have a hidden topic which provides source material for a learning dialogue based on RAG

Something like: You are a wise and kindly teacher who wants to help students with their work without ever providing a direct answer. You want to give students enough information to solve their own problems. The source materials in [this category or posts or single topic] are accurate and provide all the information you need to answer the students specific queries. Only use information from these sources to answer questions.

2 Likes

We certainly want to add support for “custom personas” where you get to choose:

  • Temperature
  • System Message
  • LLM
  • Commands

We need to build a UI for this so it may take a tiny bit to build, that said I can see this as a very powerful and useful feature.

At the extreme, end users should be allowed to create custom personas as well, V0 would probably be an admin feature.

Long term vision would be for you to also be allowed to define custom commands so you can interface with whatever systems you have (think of it like web hooks etc…, and make API calls to a custom system to fill in context for the bot)

All of this stuff is still just in my mind castle for now, but we will get there… so

Phase 0

  • Admins can define custom personas and pick commands/temp/system message/llm

Phase 1

  • Allowed groups can define a “personal persona” - Eg: I want my creative persona to be more creative / more concise / etc… like Open AI custom instructions, but more powerful

Phase 2

  • Allowing custom commands, so you can integrate with third party systems
8 Likes

This all sounds cool.

Phase 0 and 1 would be much more powerful though, if the idea of a persona was supplemented with the concept of a memory bank. That is, you can write a little character sketch to describe how the bot will behave, but you can also use a topic, topic category, category or a set of tags to define what the bot knows.

In forums where some people know a lot or can be canonical on a subject, and other people ask questions or have less-informed discussions, this makes a big difference. You don’t want the bot rehashing old or confused discussions on a topic… you want to be able to constrain it to a validated set of facts.

Persona editor is up and running!

Going to close this off, feel free to open new feature requests for the persona editor.

4 Likes