AI Post Analyzer for Chat

Install this theme component

Hello :wave:

This theme component adds a button to each post, allowing users to send the post to an AI bot for analysis via a direct chat message. The button appears after the post info (top right of each post).
Screenshot 2025-05-01 at 11.14.28

When clicked, it:

  1. Opens (or creates) the AI DM chat channel.

  2. Sends the post URL with the text:
    “Analyze this post: post_link
    so that the AI can respond immediately.

There are some theme settings where you can set up the bot username this is important to know which DM channel should open or create if not exist. You can change the default icon too in posts.

And you can change/translate the “Analyze this post” text too in Theme Translation section. It’s great on multilingual sites translate different languages so ai persona will know which language it should answer.

That’s it :slight_smile:


Persona tip
I’ve add the following to my AI persona system prompt but of course it’s up to you.

Rules
### Post Analysis Rule:

If you receive a command to analyze a post, always process the request regardless of the post's topic.  

When analyzing a post **search external sources on Google** if needed. Use these to verify claims, provide context, or enrich the analysis with additional background or perspective.

When applicable, cite sources.

**Follow these steps:**

- Consider the topic context, including what the topic is about, what the post replies to, and relevant replies to this post (if any).
- Evaluate the post’s technical accuracy (facts, recommendations, legality, risks).
- Check clarity: Is it understandable? Is important context missing?
- Determine usefulness for others: Does it contain unique insight or practical help?
- Optionally provide suggestions or helpful additions if appropriate.
- If the post contains claims, provide supporting or contradicting sources and always include direct links to sources.
- Never add greetings, closings, or personal tone (e.g., “Dear X”, “Regards”). Keep it formal and concise.


This component was inspired by the Grok button seen on X posts, featuring something similar functionality.

11 Likes

This is fantastic! I’m testing/ using it on my forum instance and it works great. I love it! Great work Don, thanks! :smiley: :clap:

I had to mess around a bit with some category permissions to get it to analyze secure categories, even though bot is TL4 and had read access. :thinking: I will play around with that part some more - it’s likely my config…

3 Likes

Bit disappointed it uses the name but doesn’t support Chatbot :frowning:

2 Likes

I think it’s probably your persona setting :thinking: Is the Read Private option checked in on the persona setup page?

Sorry, I’m not attached to the name if it could be misleading. I just wanted to somehow indicate that this only works with the chat AI bot. Any idea for a better name? Or Can it work with the Chatbot plugin too somehow? :slightly_smiling_face: Doesn’t it work by simply adding the Chatbot username in the settings, so it will create or open a chat with the Chatbot?

2 Likes

It’s this line. It assumes Discourse AI is installed.

Otherwise should work.

A bit tricky to support both perhaps. Might consider shipping Chatbot with the same feature out of the box (and will include a credit to you)

3 Likes

Yeah I see. :thinking:

I think this would be the best solution then. If you think it would be a good feature in Chatbot, feel free to add it. :slightly_smiling_face:
I’m pretty bad at naming :sweat_smile: but I will try to change it to make it less confusing. Maybe just add a space between chat bot is enough? :sweat_smile:

2 Likes

Just wondering… could it use private messages instead of chat?

1 Like

I like! :thumbs_up:

It gives instant context to a breakout conversation.

2 Likes

Okay, I’ve renamed the component and updated the OP too. :slight_smile:

2 Likes

Chatbot version is in any case on the way. Cheers

3 Likes

This very much reminds me of this X feature:

I am open to integrating this into discourse ai as well as an optional feature longer term cc @Falco / @awesomerobot

Note… we already kind of have the feature here but it is very hidden.

5 Likes

没有显示AI图标啊

You are propably using wrong name of AI. It is not person’s name as Analyzer but you must create a public user, that can use chat, and you give its name, like Analyzer_bot.

1 Like

感谢您解答,我再研究一下

We also have the explain highlighted content feature, similar but a little less flexible

Maybe when chat is enabled this opens the drawer instead of the pop-over? I guess it’s a little buried either way…

A little unsure about adding another icon to every post, we’re starting to overload this area too… activity pub, translations, edits…

image

I think if we were to define some rules this is the “metadata” area of a post, so an AI button would make more sense along with the post controls as “actions”? at that point an admin can decide if it’s important enough to be visible on every post by deciding whether it’s in the drawer or always exposed

3 Likes

I thought about this too and might apply this advice to Chatbot now that I’ve got things working.