botbook/src/06-gbdialog/templates/announcements.md

13 KiB

Announcements Template

The announcements template provides a company communication system for sharing weekly updates, circulars, and organizational news through an AI-powered conversational interface.

Topic: Company Announcements & Communications

This template is perfect for:

  • Weekly company announcements
  • Internal circulars distribution
  • Multi-topic news aggregation
  • Organizational communications
  • Employee information portals

The Code

resume1 = GET BOT MEMORY("resume")
resume2 = GET BOT MEMORY("auxiliom")
resume3 = GET BOT MEMORY("toolbix")

SET CONTEXT "general"  AS resume1
SET CONTEXT "auxiliom" AS resume2
SET CONTEXT "toolbix"  AS resume3

CLEAR SUGGESTIONS

ADD SUGGESTION "general" AS "Weekly announcements"
ADD SUGGESTION "general" AS "Latest circulars"
ADD SUGGESTION "auxiliom" AS "What is Auxiliom?"
ADD SUGGESTION "auxiliom" AS "Auxiliom services"
ADD SUGGESTION "toolbix" AS "Toolbix features"
ADD SUGGESTION "toolbix" AS "Toolbix for business"

ADD TOOL "change-subject"

TALK resume1
TALK "Ask me about any announcement or circular."

Sample Dialogs

These conversations show how the announcements template works in real-world scenarios.

Dialog 1: Weekly Announcements

📢
Company News
online
Today
Company News

📰 Weekly Announcements - Week 3

• Q4 results exceeded expectations by 15%

• New health benefits program launching Feb 1

• Office closure Jan 20 for maintenance

Ask me about any announcement or circular.

09:00

Tell me more about the health benefits

09:01

🏥 New Health Benefits Program

Effective: February 1, 2025

Key Changes:

• Mental health coverage increased to $5,000/year

• Dental now covers orthodontics

• New telemedicine option at no cost

• Gym membership reimbursement up to $50/month

📧 HR will send enrollment forms by Jan 25.

09:01

Dialog 2: Switching Topics

📢
Company News
online

What is Auxiliom?

10:30

🔧 Auxiliom Overview

Auxiliom is our enterprise support platform that provides:

• 24/7 IT infrastructure monitoring

• Automated incident response

• Service desk integration

• Performance analytics dashboard

Would you like to know more about specific Auxiliom services?

10:30

Switch to Toolbix

10:31

🛠️ Toolbix Platform

Toolbix is our productivity suite designed for modern teams:

• Project management & task tracking

• Team collaboration tools

• Document sharing & version control

• Integration with 50+ business apps

What would you like to know about Toolbix?

10:31

Dialog 3: Latest Circulars

📢
Company News
online

Show me the latest circulars

14:00

📋 Recent Circulars

CIR-2025-003 (Jan 15)

Updated Travel Expense Policy

CIR-2025-002 (Jan 10)

Remote Work Guidelines 2025

CIR-2025-001 (Jan 3)

Annual Compliance Training Schedule

Which circular would you like to read?

14:00

Keywords Used

Keyword Purpose
GET BOT MEMORY Retrieve stored announcement summaries
SET CONTEXT Define contexts for different topics
CLEAR SUGGESTIONS Reset quick reply options
ADD SUGGESTION Create topic-based quick replies
ADD TOOL Register topic switching tool
TALK Display announcements to user

How It Works

  1. Load Content: Pre-stored summaries are retrieved from bot memory
  2. Multi-Context Setup: Different contexts for each announcement topic
  3. Topic Suggestions: Quick replies organized by topic category
  4. Dynamic Display: Current announcements shown on start
  5. Topic Switching: Users can change subjects using the tool

Template Structure

announcements.gbai/
├── announcements.gbdialog/
│   ├── start.bas           # Main entry point
│   ├── auth.bas            # Admin authentication
│   ├── change-subject.bas  # Topic switching
│   └── update-summary.bas  # Update announcements
├── announcements.gbkb/
│   ├── auxiliom/           # Auxiliom topic KB
│   ├── news/               # General news KB
│   └── toolbix/            # Toolbix topic KB
└── announcements.gbot/
    └── config.csv          # Bot configuration

Change Subject Tool: change-subject.bas

PARAM subject AS STRING LIKE "toolbix" DESCRIPTION "Topic to switch to: general, auxiliom, toolbix"

DESCRIPTION "Change the current announcement topic"

subject_lower = LCASE(subject)

IF subject_lower = "general" OR INSTR(subject_lower, "news") > 0 OR INSTR(subject_lower, "announcement") > 0 THEN
    resume = GET BOT MEMORY("resume")
    SET CONTEXT "current" AS resume
    TALK "📰 Switched to **General Announcements**"
    TALK resume
ELSE IF subject_lower = "auxiliom" THEN
    resume = GET BOT MEMORY("auxiliom")
    SET CONTEXT "current" AS resume
    TALK "🔧 Switched to **Auxiliom**"
    TALK resume
ELSE IF subject_lower = "toolbix" THEN
    resume = GET BOT MEMORY("toolbix")
    SET CONTEXT "current" AS resume
    TALK "🛠️ Switched to **Toolbix**"
    TALK resume
ELSE
    TALK "Available topics: General Announcements, Auxiliom, Toolbix"
    TALK "Which topic would you like?"
END IF

RETURN subject_lower

Update Summary Tool: update-summary.bas

PARAM topic AS STRING LIKE "general" DESCRIPTION "Topic to update"
PARAM content AS STRING DESCRIPTION "New summary content"

DESCRIPTION "Update the announcement summary for a topic (admin only)"

' Verify admin access
IF NOT IS_ADMIN(user_id) THEN
    TALK "⚠️ This action requires administrator privileges."
    RETURN NULL
END IF

topic_lower = LCASE(topic)

IF topic_lower = "general" THEN
    SET BOT MEMORY "resume", content
ELSE IF topic_lower = "auxiliom" THEN
    SET BOT MEMORY "auxiliom", content
ELSE IF topic_lower = "toolbix" THEN
    SET BOT MEMORY "toolbix", content
ELSE
    TALK "Unknown topic. Use: general, auxiliom, or toolbix"
    RETURN NULL
END IF

' Log the update
WITH updateLog
    timestamp = NOW()
    updatedBy = user_id
    topicUpdated = topic_lower
    contentLength = LEN(content)
END WITH

SAVE "announcement_log.csv", updateLog

TALK "✅ " + topic + " summary updated successfully!"
TALK "Changes are now live."

RETURN topic_lower

Customization Ideas

Add Email Distribution

ADD TOOL "send-announcement"

PARAM announcement AS STRING DESCRIPTION "Announcement to distribute"
PARAM recipients AS STRING LIKE "all" DESCRIPTION "Recipients: all, managers, department name"

' Get recipient list
IF recipients = "all" THEN
    employees = FIND "employees.csv"
ELSE IF recipients = "managers" THEN
    employees = FIND "employees.csv", "role = 'manager'"
ELSE
    employees = FIND "employees.csv", "department = '" + recipients + "'"
END IF

FOR EACH emp IN employees
    SEND MAIL emp.email, "Company Announcement", announcement
    WAIT 1
NEXT

TALK "📧 Announcement sent to " + UBOUND(employees) + " recipients."

Add Announcement Categories

CLEAR SUGGESTIONS

ADD SUGGESTION "hr" AS "HR Updates"
ADD SUGGESTION "it" AS "IT Announcements"
ADD SUGGESTION "finance" AS "Finance News"
ADD SUGGESTION "events" AS "Upcoming Events"
ADD SUGGESTION "policy" AS "Policy Changes"
ADD SUGGESTION "all" AS "All Announcements"

Add Read Receipts

' Track who has read announcements
WITH readReceipt
    userId = user_id
    announcementId = current_announcement_id
    readAt = NOW()
END WITH

SAVE "read_receipts.csv", readReceipt

' Check read percentage
total = COUNT("employees.csv")
reads = COUNT("read_receipts.csv", "announcementId = '" + current_announcement_id + "'")
percentage = (reads / total) * 100

TALK "📊 " + FORMAT(percentage, "#0") + "% of employees have read this announcement."

Add Scheduled Announcements

PARAM schedule_time AS STRING LIKE "2025-01-20 09:00" DESCRIPTION "When to publish"
PARAM announcement AS STRING DESCRIPTION "Announcement content"

SET SCHEDULE schedule_time

SET BOT MEMORY "resume", announcement

' Notify all employees
employees = FIND "employees.csv"
FOR EACH emp IN employees
    TALK TO emp.phone, "📢 New announcement: " + LEFT(announcement, 100) + "..."
NEXT

TALK "Announcement published and distributed."

Best Practices

  1. Keep It Current: Update announcements regularly
  2. Organize by Topic: Use clear topic categories
  3. Summarize: Start with key points, allow drill-down
  4. Archive Old News: Move outdated items to archive
  5. Track Engagement: Monitor which topics get most questions