Architecture Report

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.

Primary Interface
Slack
Single configured channel, thread-aware replies
LLM
OpenRouter
anthropic/claude-sonnet-4-6
Tools
15 total
12 Results API, 3 Questions API
Hosting
Railway + Cloudflare
Bot on Railway, data APIs on Workers/Pages
Historical snapshot: Golden Bot has been superseded by LIFE-bot for Slack Q&A, ingest, and digest. Keep this report for architecture history only; do not use the Golden Bot Railway endpoint or prompt details below as the current setup.

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.

Slack
User sends message in configured channel or thread
  • Events API posts to bot webhook
  • Bot replies back into same thread
Golden Bot
Node/Express service on Railway
  • Verifies Slack signature
  • Builds thread-aware prompt context
  • Runs agentic tool loop
OpenRouter
Function-calling LLM backend
  • Chooses tools
  • Synthesizes final answer
Results API
Cloudflare Worker + D1
  • Runs, grades, summaries, rubrics
  • Meditation content and bot config
Questions API
Golden Questions Manager
  • Question search and lookup
  • Question-level metadata and stats
Slack → Golden Bot → OpenRouter ↔ Tools ↔ Results API / Questions API → Slack

Current Production State

These values reflect the currently deployed system and the APIs Golden Bot is calling.

Benchmark Runs
1
Current run: 20260317-153200
Grades
3563
Across 11 judges and 3 variants
Summaries
324
Per scenario + variant rollups
Questions DB
4002
356 marked golden

Deployed 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: 1
  • rubrics: 11
  • meditation_content: 63
  • system_prompts: 1
Known data issue: stage statistics are currently broken in production. The live grades are stored with short IDs like 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

1

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.

2

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.

3

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.

4

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.

5

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.

6

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.

Layer 1: Slack Interface
This is the outer shell. Slack handles user input and final delivery, but none of the benchmark intelligence lives here.
1

User sends a message

A person posts in the configured Slack channel, either as a new top-level message or a thread follow-up.

2

Slack posts the event

Slack sends the payload to /slack/events with message text, user, channel, timestamp, and thread metadata.

3

Golden Bot validates it

The bot verifies the Slack signature, ignores bots and irrelevant subtypes, filters to the configured channel, and returns fast.

Layer 2: Bot Orchestration on Railway
This is the control plane. It builds context, fetches the live bot prompt, and prepares the LLM request.
4

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
5

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
6

LLM context is assembled

The request becomes: system prompt + previous thread turns + current user turn + all 15 tool schemas.

Layer 3: Reasoning and Data Retrieval
OpenRouter does the reasoning, but the actual benchmark facts live in cloud APIs that the model can query through tools.
7

OpenRouter chooses a path

anthropic/claude-sonnet-4-6 either answers immediately or emits tool calls for missing information.

8

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
9

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.

Layer 4: Answer Delivery
Once the model has enough data, the bot formats the response for Slack and closes the request cleanly.
10

Final answer is generated

The model stops calling tools and returns a final text response based on the retrieved data.

11

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.

12

Reply lands back in thread

The answer is posted to the same thread, the temporary thinking message is deleted, and the interaction completes.

Slack UI layer only
Railway Bot Orchestration and control
OpenRouter Reasoning and tool selection
Results + Questions APIs Source of truth for benchmark data
Operational reading: Slack is just the interface, Railway is the orchestrator, OpenRouter is the reasoning engine, and the real knowledge lives in the Results API and Questions API.

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-run protected 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.

Settling into stillness... Turning the wheel of dharma... Resting in awareness... Breathing in, breathing out... Contemplating the question... Sitting with this... Observing without attachment... Following the breath... Letting wisdom arise... In the space between thoughts...
Everything Else the Model Sees
  • The current user message text
  • The prior Slack thread, converted to user and assistant turns
  • Tool definitions with JSON schemas
  • Tool outputs returned as tool messages 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.

Results API

Run and score analytics

  • get_latest_run and list_runs
  • get_grades with filters: run, scenario_id, judge, min_score, max_score, variant
  • get_summaries with agreement and scenario filters
  • get_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”.

Results API

Raw artifacts and benchmark context

  • get_response for the actual variant response text
  • get_rubric for expert judge rubric content
  • get_meditation_content for a stage and optional content type
  • get_system_prompt for 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”.

Questions API

Golden questions lookup

  • search_questions by text, stage, topic, safety, source
  • get_question by numeric ID
  • get_question_stats for database-wide distribution

Example asks: “show me GQ43”, “find RED safety questions from reddit”, “how many questions are in 2.4?”.

Threading

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

  • GQ43 style 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.3 sensations content
  • Stage 2.1 breathwork 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
Important constraint: it is not a general-purpose web assistant. Its power is narrow but strong: benchmark analytics, question lookup, prompt/rubric inspection, and meditation content retrieval.

Backend Data Layers

Results API tables

  • runs
  • grades
  • summaries
  • responses
  • rubrics
  • meditation_content
  • system_prompts
  • bot_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.

Subtle architectural distinction: Golden Bot’s own system prompt is stored in 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.