Golden Bot
Full runtime breakdown of the Slack benchmark bot: request flow, prompt stack, tool surface, dynamic data sources, follow-up behavior, deployment topology, and current known limitations.
High-Level Architecture
Golden Bot is a Slack event consumer with a tool-calling LLM core. It does not hold benchmark data locally. It dynamically fetches most answerable data from external services at runtime.
- Events API posts to bot webhook
- Bot replies back into same thread
- Verifies Slack signature
- Builds thread-aware prompt context
- Runs agentic tool loop
- Chooses tools
- Synthesizes final answer
- Runs, grades, summaries, rubrics
- Meditation content and bot config
- Question search and lookup
- Question-level metadata and stats
Current Production State
These values reflect the currently deployed system and the APIs Golden Bot is calling.
20260317-153200Deployed Endpoints
- Golden Bot:
https://overflowing-sparkle-production-95d2.up.railway.app - Results API:
https://results-api.cloudflare-manly597.workers.dev - Questions API:
https://golden-questions.life-labs.dev
Key Current Data Traits
runs: 1rubrics: 11meditation_content: 63system_prompts: 1
GQ43 rather than stageful IDs like GQ-1.3-043, so get_stage_stats collapses everything to unknown.
What Happens When Someone Messages the Bot
Slack event ingress
Slack posts to /slack/events. The bot verifies the HMAC signature using SLACK_SIGNING_SECRET, rejects stale payloads, ignores bot messages, and only processes the configured channel.
Thread context assembly
If the message is in a thread, Golden Bot fetches the thread history from Slack first, before posting its temporary “thinking” message. This prevents the placeholder reply from leaking into the LLM context.
Dynamic system prompt load
For every request, the bot fetches /api/config/system_prompt from the Results API. The system prompt is not bundled statically into the deploy.
Agentic loop
The current thread messages plus the fetched system prompt are sent to OpenRouter with all 15 tool schemas. The model may answer directly or call tools over up to 10 iterations.
Tool execution
Tool calls are routed either to the Results API client or the Questions API client. Questions API access is cookie-authenticated and cached after login; Results API uses bearer auth.
Slack response
The final response is posted back into the same thread. Long responses are split under Slack’s 4000-character limit. The temporary “thinking” message is then deleted.
Architecture Flow Chart Breakdown
This is the same architecture shown as a more explicit execution path, including the decision points around thread history, tool use, and final Slack delivery.
User sends a message
A person posts in the configured Slack channel, either as a new top-level message or a thread follow-up.
Slack posts the event
Slack sends the payload to /slack/events with message text, user, channel, timestamp, and thread metadata.
Golden Bot validates it
The bot verifies the Slack signature, ignores bots and irrelevant subtypes, filters to the configured channel, and returns fast.
Thread context is loaded
If the message is in a thread, Golden Bot loads prior thread history before posting its temporary thinking reply.
- Keeps thread follow-ups coherent
- Prevents placeholder messages from leaking into context
System prompt is fetched live
The bot fetches /api/config/system_prompt from the Results API on every request.
- No redeploy needed to change the bot’s behavior prompt
- Fallback prompt is used only on fetch failure
LLM context is assembled
The request becomes: system prompt + previous thread turns + current user turn + all 15 tool schemas.
OpenRouter chooses a path
anthropic/claude-sonnet-4-6 either answers immediately or emits tool calls for missing information.
Tool router dispatches calls
Each tool call is sent to the correct backend.
- Results API: runs, grades, summaries, stats, rubrics, meditation content, config
- Questions API: question search, lookup, and stats
Tool results loop back in
Tool outputs are appended as tool messages, then the model gets another turn. This loop can run up to 10 iterations.
Final answer is generated
The model stops calling tools and returns a final text response based on the retrieved data.
Output is made Slack-safe
The bot splits long output under Slack’s 4000-character limit and logs query usage for the daily cap warning system.
Reply lands back in thread
The answer is posted to the same thread, the temporary thinking message is deleted, and the interaction completes.
Main Services Inside Golden Bot
Slack Edge
- Signature verification
- Channel filtering
- Background processing after fast
200
Message Orchestrator
- Thread history load
- Thinking-message lifecycle
- Usage counting and cap warning
LLM Core
- OpenRouter chat completions
- Function calling
- Tool-call replay across iterations
Results Data Adapter
- Runs and grade analytics
- Rubrics and meditation content
- Config and Wisdom prompt inspection
Questions Data Adapter
- Question search
- ID lookup
- Question database stats
Notification Endpoint
/notify/new-runprotected by Results API key- Posts top-level Slack benchmark upload summaries
What Data the Bot Loads at Runtime
Golden Bot is thin by design. Most meaningful state is pulled live on demand.
Loaded on every Slack query
- Current Slack event payload
- Thread history from Slack replies API for threaded messages
- Golden Bot system prompt from
/api/config/system_prompt - Tool schemas statically defined in code
Loaded only if the LLM asks for it
- Runs, grades, summaries, failure modes, judge stats
- Rubrics for any expert judge
- Meditation path content for any stage
- Question search results and question metadata
- Archived Wisdom system prompts via inspection tool
Auth and session state
- Results API uses
Authorization: Bearer <RESULTS_API_KEY> - Questions API uses password login and a cached session cookie
- Slack posting uses
SLACK_BOT_TOKEN - Incoming Slack verification uses
SLACK_SIGNING_SECRET
What is not persisted by the bot
- No long-term conversation memory beyond the current Slack thread
- No local benchmark database inside the bot service
- No cross-channel reasoning context
- No vector store or retrieval layer
All Prompt-Like Inputs the Bot Uses
There are fewer prompt layers here than it looks like. Golden Bot has one real system prompt, one fallback prompt, a small thinking-message set, and user/thread context.
Live Golden Bot System Prompt
Fetched dynamically from the live Results API on every request.
You are Golden Bot, a data access tool for the LIFE meditation app benchmarking team. You have 15 tools — use them. Never guess or fabricate data.
Keep responses terse — the team knows the system. Use plain text with *bold labels*, bullet points, and code blocks. No tables. No headers. If you can't find data, say so honestly. Don't speculate.
Default to the latest benchmark run unless the user specifies otherwise.
After answering, add a brief "Related:" section if there's a non-obvious connection worth surfacing. When showing grades, include failure modes if any were flagged. For analytics queries, show the data then add brief interpretation.
--- DOMAIN KNOWLEDGE ---
EXPERT JUDGES (11):
- dzogchen — Tibetan Buddhism / Dzogchen
- mahayana — Mahayana Buddhism
- theravada — Theravada / Pali Buddhism
- neidan — Chinese Internal Alchemy
- zen — Zen Buddhism
- gestalt — Gestalt / Relational therapy
- depth-psychology — Depth Psychology / Jungian
- coaching — Western Coaching / Positive Psychology
- ai-safety — AI Safety & Ethics
- kundalini-tantra — Kundalini & Tantric practices
- western-mystical — Western Mystical / Hermetic traditions
MEDITATION STAGES:
Stage 1 (Awareness): 1.1 Posture, 1.2 Opening/Closure, 1.3 Sensations, 1.4 Emotions, 1.5 Thoughts, 1.6 Awareness
Stage 2 (Awakening): 2.1 Breathwork, 2.2 Love, 2.3 Clarity, 2.4 Intrinsic Awareness
SAFETY LEVELS: GREEN, YELLOW, ORANGE, RED
COMMON FAILURE MODES:
- student-absent
- conceptual-overlay / concept-over-contact
- missing-embodiment
- filler-warmth
- premature-action
- anatomical-reductionism
- generic-wellness-flattening
SCORING:
- Each scenario has A, B, C variants
- Scores: 1-10 per judge, weighted by relevance
- Agreement levels: STRONG, GOOD, NEEDS_WORK, FAIL
SCENARIO IDS: Format is GQ-{stage}-{number}, e.g. GQ-1.3-043. When a user says "GQ43" they mean question ID 43 — use get_question to look it up, then use the scenario_id from the result for grades/summaries.
--- TOOLS ---
Results API (12 tools):
- get_latest_run
- list_runs
- get_grades
- get_summaries
- get_judge_stats
- get_stage_stats
- compare_runs
- get_failure_modes
- get_response
- get_rubric
- get_meditation_content
- get_system_prompt
Questions API (3 tools):
- search_questions
- get_question
- get_question_stats
Fallback Prompt Used If Config Fetch Fails
You are Golden Bot, a data access tool for the LIFE meditation app benchmarking team. Keep responses terse.
Thinking Messages
A temporary Slack placeholder is posted while the request runs, then deleted.
Everything Else the Model Sees
- The current user message text
- The prior Slack thread, converted to
userandassistantturns - Tool definitions with JSON schemas
- Tool outputs returned as
toolmessages during the loop
There are no other handcrafted conversational prompt templates in the bot itself.
What the Bot Can Actually Answer
The model cannot answer benchmark questions from raw memory. It answers by choosing from these 15 tools.
Run and score analytics
get_latest_runandlist_runsget_gradeswith filters:run,scenario_id,judge,min_score,max_score,variantget_summarieswith agreement and scenario filtersget_judge_stats,get_stage_stats,compare_runs,get_failure_modes
Example asks: “how many runs have we done?”, “average score by judge”, “what failed most often?”, “compare the last two runs”.
Raw artifacts and benchmark context
get_responsefor the actual variant response textget_rubricfor expert judge rubric contentget_meditation_contentfor a stage and optional content typeget_system_promptfor current or run-specific Wisdom prompt inspection
Example asks: “show me what Wisdom actually said”, “show the zen rubric”, “give me stage 2.1 meditation content”.
Golden questions lookup
search_questionsby text, stage, topic, safety, sourceget_questionby numeric IDget_question_statsfor database-wide distribution
Example asks: “show me GQ43”, “find RED safety questions from reddit”, “how many questions are in 2.4?”.
Follow-up behavior
- Follow-ups work inside the same Slack thread
- The bot reuses prior thread turns as context
- If Slack has not yet surfaced the latest user reply in history, the current event is appended explicitly
Example follow-ups: “what are the key insights from that run?”, “tell me more about the neidan score”, “what were the failure modes there?”.
What Kinds of Questions It Can Follow
Benchmark operations
- Run counts and latest run status
- Judge harshness / averages / ranges
- Top failure modes and failure-mode drilldowns
- Scenario-level grade inspection
Scenario and question drilldowns
GQ43style lookup- Question metadata: stage, topic, safety, source
- Question search by topic or stage
- Follow-up exploration within the same thread
LIFE path content inspection
- Stage
1.3sensations content - Stage
2.1breathwork material - Specific content types:
EXPLANATION,MEDITATION,TECHNIQUE,FAQ
Prompt and rubric introspection
- Current Wisdom system prompt
- Prompt used in a particular run
- Full evaluator rubrics for each judge
Backend Data Layers
Results API tables
runsgradessummariesresponsesrubricsmeditation_contentsystem_promptsbot_config
Results API route surface
/api/runs,/api/runs/latest,/api/runs/:timestamp/api/runs/:timestamp/grades/api/runs/:timestamp/summaries/api/runs/:timestamp/responses/api/stats/judges,/api/stats/stages,/api/stats/failure-modes,/api/stats/compare/:ts1/:ts2/api/rubrics,/api/rubrics/:judge/api/meditation/:stage/api/system-prompt/current,/api/system-prompt/:runRef/api/config/:key
Questions API schema
- Question fields: text, source, source_detail, stage, topic, safety_level, notes
- Flags:
archived,golden - Optional tags relationship
- Grouped and paginated list API
Questions API live distributions
- By safety: GREEN 2881, YELLOW 741, ORANGE 301, RED 79
- By topic: teaching 1125, tradition 948, troubleshooting 667, safety 553, beginner 421, advanced 288
- Large stage buckets include general 1381, 2.4 430, 2.1 329
Known Constraints and Gotchas
Single-channel scope
The bot only processes the configured SLACK_CHANNEL_ID. Messages from other channels are ignored.
No cross-thread memory
Reasoning context is scoped to the current Slack thread. Outside the thread, there is no retained conversational state.
Daily cap warning is soft
The bot tracks daily query count in memory and can warn after the cap, but it does not hard-stop requests.
Stage stats bug
get_stage_stats currently reflects an upstream data mismatch: the uploaded benchmark IDs are short GQ43-style IDs, while the stage parser expects GQ-1.3-043-style IDs.
bot_config.system_prompt and loaded every query. The system_prompts table holds Wisdom benchmark prompts and is exposed mainly for inspection with get_system_prompt.
Bottom Line
Golden Bot is a narrow, tool-using Slack analytics agent for the LIFE benchmarking stack. It is not reasoning over a local knowledge base. Its real architecture is:
- Slack as UI
- Railway-hosted Node service as orchestrator
- OpenRouter as the tool-calling LLM
- Results API as benchmark truth store
- Questions API as golden-question lookup store
Its strongest capabilities are scenario drilldown, judge analytics, prompt/rubric inspection, and question lookup. Its biggest current data weakness is stage aggregation, caused by shortened scenario IDs in the uploaded run.