openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Expand TinyHumans Discord bot: ticket support (RAG), meme engagement, and daily AI digest relay

Open Al629176 opened this issue 4 months ago • 2 comments

Summary

https://claude.ai/code/artifact/d3ac292a-e64b-4bdc-b811-ee11a67e0b1a

Expand the existing TinyHumans Robot App Discord bot (already live, running GM streak + OpenHuman reward-task integration) with three new capabilities. No new bot or application needed — add to the same bot.

# Capability Trigger Destination
1 Ticket support (RAG-grounded) New message in support ticket channel/thread Reply in same ticket
1a Unresolved-ticket escalation User indicates bot didn't solve it Internal escalations channel
1b Daily ticket recap Daily, 8:00 AM EST Same internal escalations channel
2 Meme / engagement bot Scheduled interval #meme channel
3 Daily AI digest relay Daily, 8:30 AM EST #opehumanbot-updates channel

Feature 1 — Ticket Support Bot

What it does

When a user opens a support ticket (or posts in a designated support channel/thread), the bot:

  1. Reads the user's message
  2. Retrieves relevant context from the knowledge base (RAG — see §KB below)
  3. Posts a draft reply to a staff-only thread for a moderator to approve/edit before sending (start here; graduate to auto-send only after accuracy is proven over a trial period)

Knowledge base

Source: Marketing Team Drive — read via Google Drive API service account (read-only). Pull on a 15–30 min schedule or on-demand per ticket. Embed into a small vector store (RAG) rather than stuffing raw file contents into every prompt.

Key files:

  • references/PRODUCT.md — product facts
  • references/PROJECT.md — project context
  • references/MESSAGING.md — approved messaging/positioning
  • references/LINKS.md — canonical links
  • references/MARKET-AND-COMPETITORS.md — for "how is this different from X" questions

Note: If ticket volume is mostly product-support (not marketing/brand) questions, create a dedicated SUPPORT-FAQ.md curated for this bot rather than reusing the marketing KB as-is.

Guardrails — MUST

  • Answer only from retrieved KB content. If the answer isn't in the KB, say so honestly and route to a human — never guess
  • Reference which doc/section the answer came from (for moderator auditability), even if not shown to the end user
  • Immediately route to a human (no bot reply) for: refund/billing requests, account security issues (lost funds, compromised account), complaints about the team or product, emotionally charged messages, legal/compliance questions
  • Log every ticket + reply (question, retrieved context, answer, confidence score) for KB improvement
  • Respect Discord API rate limits

Guardrails — MUST NOT

  • Never fabricate a product fact, price, timeline, or promise not in the KB
  • Never issue refunds, compensation, reward-point adjustments, or make financial commitments
  • Never share another user's private data (wallet addresses, DMs, personal info)
  • Never argue with or lecture a frustrated user — de-escalate and hand off
  • Never claim to be human or claim capabilities it doesn't have

1a — Escalation (hard rule, not best-effort)

If the user indicates the bot's answer didn't resolve their issue (negative reaction, asks for a human, reposts the same question, or uses /human):

  1. Stop trying to auto-resolve
  2. Post to the internal escalations channel (https://discord.com/channels/1470856511193616498/1471029249400897587) tagging @aisystemsgal and @connor.tinyhumans
  3. Include: link to the ticket/thread, user's original question, what the bot answered, and (if inferable) why it didn't satisfy them

An unresolved ticket must never sit unescalated.

1b — Daily ticket recap (8:00 AM EST)

Post to the same internal escalations channel: total ticket count, one-line summary per ticket (question + outcome: resolved / escalated / unanswered), rollup of how many were escalated. If zero tickets, still post saying so.


Feature 2 — Meme / Engagement Bot

Periodically generate and post a meme (image + optional caption) to the meme channel: https://discord.com/channels/1470856511193616498/1470860872758067406

Guardrails — SHOULD:

  • Stay on-brand: OpenHuman/TinyHumans voice, per BRAND.md in the Marketing Team Drive
  • Disclose AI-generated content where brand rules require it (BRAND.md §12)
  • Keep it fun/light — community engagement content, not product announcements
  • Have a simple undo path (mod-reaction to delete) in case a meme lands badly
  • Start at 1/day max to avoid channel fatigue

Guardrails — SHOULD NOT:

  • Never punch down at or disparage competitors, competitor founders, or their products
  • No NSFW, political, or off-brand content
  • No memes referencing real individuals without care — avoid anything that could read as harassment or targeted mockery

Open questions for dev:

  • Meme generation method: marketing team already uses Higgsfield for image generation — worth reusing for visual consistency
  • Frequency: daily or a few times a week?
  • Pre-post approval step, or fully autonomous?

Feature 3 — Daily AI Digest Relay (8:30 AM EST)

Post a daily summary of AI/agentic-AI news and competitor activity to #opehumanbot-updates: https://discord.com/channels/1470856511193616498/1527132000115490906

Source of content

"Community Crawls" folder in the Marketing Team Drive (same Drive as Feature 1). Files already generated daily by a separate automation at ~8:00–8:15 AM:

  • Community Crawls/DAILY-AI-PULSE.md — daily agentic AI / models / trends / news digest
  • Community Crawls/COMPETITOR-DIGEST.md — competitor product / blog / funding activity
  • Community Crawls/FOUNDER-COMPETITOR-SCOUT.md — notable founder/competitor activity (internal review only — see guardrail below)

Each file is a running log with the newest entry prepended under a ## YYYY-MM-DD heading. The bot should post only the top-most (newest) section of each file per day — not the whole file.

How it should work

  1. Run at 8:30 AM EST (trailing Pooja's automation by 30 min so content already exists)
  2. Read the latest dated section from each of the three files
  3. Combine into one message (or one per file) and post to #opehumanbot-updates
  4. If a file has no new entry for today, skip that section — never repost yesterday's content as if it were new
  5. Split into multiple messages if a section exceeds Discord's 2,000-character limit — never truncate silently

Guardrails

  • Internal/team visibility only — fine to post full digest content as-is
  • FOUNDER-COMPETITOR-SCOUT.md is explicitly for internal review only. The bot may relay its content to this internal channel for humans to read, but must never auto-QT, auto-reply to, or otherwise act on any tweets or posts it references
  • Never auto-engage with any external content referenced in the digest files

Open question for dev: Does the bot need live Google Drive API access, or would a simpler webhook-style push from Pooja's existing automation be easier? (Pending a fix to a Wick/ZTS security-bot restriction currently blocking webhook creation on this server.) Sync with Pooja before building — the two approaches could converge.


General guardrails (all three features)

  • Log all bot actions to an internal #bot-logs channel so behaviour can be audited
  • Never modify server settings, roles, permissions, or delete messages/channels as a side effect
  • If a feature errors or can't complete (KB unreachable, Drive file missing, etc.), fail silently to the end user but alert visibly to the dev/mod team — never expose raw errors publicly
  • Request only the permissions actually needed per feature (e.g. message-content intent for tickets; channel-send scoped to the specific meme / digest channels) — do not broaden the bot's existing permission scope wholesale

Open questions for dev team

  • §2.5 auto-send vs. review-first — final call on Feature 1; if review-first, who is the reviewer?
  • Hosting — same infra as the current bot, or new (Railway / Fly.io)?
  • Ticket scope — which channels/categories count as "tickets"? All of them to start, or a pilot subset?
  • Dedicated SUPPORT-FAQ.md — needed as a separate doc from the marketing KB?
  • "User still isn't satisfied" detection — keyword/sentiment matching, a reaction emoji, an explicit /human command, or a combination?

Acceptance criteria

  • [ ] Feature 1: bot replies (draft mode) to new support tickets grounded in KB; drafts visible to mods before sending
  • [ ] Feature 1a: escalation fires within 60 s of user expressing dissatisfaction; internal channel pinged with full context
  • [ ] Feature 1b: daily recap posted at 8:00 AM EST every day; posts even if zero tickets
  • [ ] Feature 2: meme posted to #meme channel on schedule; mod can delete via reaction; BRAND.md guardrails applied
  • [ ] Feature 3: digest posted to #opehumanbot-updates at 8:30 AM EST; only today's section posted; 2k-char limit respected
  • [ ] All features log to #bot-logs; errors never surface raw to end users
  • [ ] No server settings, roles, or permissions modified by any feature
  • [ ] Minimum Discord permission scopes only

Related

  • Existing TinyHumans Robot App bot (GM streak, reward-task integration)
  • Marketing Team Drive KB (Google Drive API service account needed)
  • #4841 — Discord community integration
  • #4883 — Discord bot chat/NLP issues
  • #5058 — Multi-pod socket routing for channel messages

Implementation Plan

Triage Assessment

  • Valid feature request for the TinyHumans Robot App Discord bot ecosystem. Well-scoped with guardrails, acceptance criteria, and open questions.
  • Impact: improved community support, engagement, and information dissemination.

Proposed Scope

  • In-scope: Three features as described: ticket support (RAG), meme engagement, daily AI digest relay. Plus all stated guardrails.
  • Non-goal: Creating a new Discord bot application. Uses the existing one.
  • Note: This involves bot infrastructure (hosting, Google Drive API, Discord API) that may live outside the openhuman codebase. Coordinate with the team on where the implementation lives.

Implementation Steps

  1. RAG knowledge base: Set up Google Drive API service account (read-only) to access Marketing Team Drive. Pull key files (PRODUCT.md, PROJECT.md, MESSAGING.md, LINKS.md, MARKET-AND-COMPETITORS.md) on a 15-30 min schedule. Embed into a lightweight vector store.
  2. Ticket support bot: On new support ticket message, retrieve relevant KB context, post draft reply to a staff-only thread for moderator review/approval. Implement all guardrails (KB-only answers, no financial commitments, escalation triggers).
  3. Escalation handler (1a): If user expresses dissatisfaction (negative reaction, asks for human, reposts), post to internal escalations channel with full context. Must fire within 60s.
  4. Daily recap (1b): Scheduled at 8:00 AM EST. Post total count, per-ticket summary, escalation rollup.
  5. Meme bot (2): Scheduled at 1/day max. Generate on-brand image + caption per BRAND.md. Mod-reaction undo path.
  6. Digest relay (3): Scheduled at 8:30 AM EST. Read latest section from each crawl file, post to #opehumanbot-updates. Respect 2k character limit, never repost stale content.
  7. Logging: All bot actions logged to #bot-logs. Errors fail silently to end users.

Verification

  • Manual: trigger each feature, verify output in the appropriate Discord channels.
  • Confirm guardrails: try to elicit off-policy responses, verify the bot refuses appropriately.

Risks and Open Questions

  • Hosting: same infra as current bot or new? Coordinate before building.
  • Feature 1 auto-send vs. review-first: decision needed from team.
  • Feature 2 (meme) generation method: coordinate with marketing team.
  • Feature 3: webhook push from existing automation vs. live Google Drive API.
  • Ticket scope: all channels, or a pilot subset?

Acceptance Criteria

  • [ ] Feature 1: bot replies to support tickets grounded in KB; drafts visible to mods
  • [ ] Feature 1a: escalation fires within 60s with full context
  • [ ] Feature 1b: daily recap at 8:00 AM EST
  • [ ] Feature 2: meme posted on schedule; mod-reaction undo; guardrails applied
  • [ ] Feature 3: digest posted at 8:30 AM EST; only today's section; 2k-char limit
  • [ ] All features log to #bot-logs; errors never surface raw to end users
  • [ ] Minimum Discord permission scopes only

Al629176 avatar Jul 20 '26 20:07 Al629176

Pre-implementation RCA / scoping note

Flagging some blockers before anyone opens a PR, because as written this can't be picked up as a normal code task.

1. This isn't a change to the openhuman repo (as far as the code shows)

The premise — "add to the same bot… already live, running GM streak + reward-task integration" — assumes an existing bot that isn't in this repo. There's no GM-streak logic, no reward-task integration, no slash-command handler, and no "TinyHumans Robot App" code anywhere in the tree.

What openhuman does have Discord-wise are two different things, neither of which is that bot:

  • vendor/tinychannels/src/providers/discord/channel.rs — a generic conversational relay bot (mention/DM the bot → routed to the OpenHuman agent → reply posted back). No scheduling, no slash commands, no streaks/rewards.
  • app/src-tauri/src/discord_scanner/ — a CDP webview scanner that passively reads the logged-in user's own Discord session. Not a bot at all.

So the bot this issue wants to expand either lives in a separate codebase or doesn't exist yet. (The auto-triage note already hints at this: "this involves bot infrastructure … that may live outside the openhuman codebase.") Can we confirm where the TinyHumans Robot App bot actually lives? That determines whether this issue belongs on this repo at all.

2. Hard external blockers, independent of the repo question

Even setting that aside, three of these can't be built/verified without external access that isn't in-repo:

  • Google Drive service account (read-only) for the Marketing Team Drive. There's no native Drive client here — only Composio Drive tool slugs. Needs real credentials + Drive access.
  • Higgsfield access for meme generation (Feature 2).
  • Hosting decision (same infra vs Railway/Fly.io) is unmade.
  • Live Discord guild/channel IDs + coordination with Pooja (digest automation / webhook vs Drive API) and the escalation targets @aisystemsgal / @connor.tinyhumans.

3. Product decisions in "Open questions for dev team" are still open

These are blocking, not cosmetic: auto-send vs. review-first (and who reviews), ticket scope (all channels vs. pilot), dedicated SUPPORT-FAQ.md vs. reusing the marketing KB, and how "user still isn't satisfied" is detected. Building before these are decided is guessing.

4. What is reusable if we do build a slice on this repo

For the record, the substrate exists here:

  • RAG: src/openhuman/embeddings/ + src/openhuman/memory_search/vector/ (vector + hybrid search).
  • Scheduling: src/openhuman/cron/ runs daily jobs and can deliver output into channels — enough for the 8:00 / 8:30 AM posts.
  • Discord send/receive: the tinychannels relay bot (Gateway + POST /channels/{id}/messages).

Recommendation

This is a multi-week epic, not a single fix. Suggest we:

  1. Confirm which codebase owns the TinyHumans Robot App bot (this repo vs. separate).
  2. Resolve the Drive-access / hosting / auto-send-vs-review decisions.
  3. Then split into per-feature issues (Feature 3 digest relay is the most self-contained starting point and maps cleanly onto the existing cron + channel-delivery infra).

Happy to spec whichever slice once ownership + the Drive access are settled.

CodeGhost21 avatar Jul 28 '26 07:07 CodeGhost21

For this Issue steve closed the pr with the message: https://github.com/tinyhumansai/backend/pull/1249#issuecomment-5218750300

YellowSnnowmann avatar Aug 10 '26 10:08 YellowSnnowmann