This example builds a personal fitness coach bot on Telegram. It is the simplest complete Heypi example: no SSH tools, no approval workflows, and no admin UI. Instead it focuses on the fundamentals—a multi-skill agent folder, file-backed memory for user profiles and workout plans, a heartbeat job for daily check-ins, and three small custom tools that read and write local Markdown files.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hunvreus/heypi/llms.txt
Use this file to discover all available pages before exploring further.
What’s Included
Onboarding Skill
First-time setup collects goals, equipment, schedule, and constraints, then saves a structured profile with
save_profile.File-Backed Memory
state/memory/profile.md holds the user’s plan; state/memory/workouts.md accumulates workout log entries.Daily Heartbeat
A heartbeat job fires every 24 hours. If the conversation has been idle for at least 8 hours, the agent runs the
daily-checkin skill. It suppresses itself with [SILENT] on rest days.Weekly Review
The
weekly-review skill summarizes training consistency, identifies patterns, and suggests one clear focus for the next week.Setup
Set environment variables
Get a bot token from @BotFather in Telegram (Leave the allowlists empty for a DM-only smoke test. Set comma-separated chat or user IDs to restrict which conversations may trigger the agent.
/newbot), then edit .env:Find your chat ID (optional)
To restrict the bot to a specific group or DM, run the observe command, then send a message to the bot in Telegram:Copy the printed chat ID into
HEYPI_TELEGRAM_CHATS. For a DM-only setup, leave the allowlists empty.Configuration
scope: { telegram: {} }). The idleMs: 8h setting means the agent only sends a check-in message when the conversation has been quiet for at least 8 hours—it won’t interrupt an active thread.
Custom Tools
The three custom tools inindex.ts implement simple file-backed memory using Node’s fs APIs and TypeBox parameter schemas.
get_profile — Read Saved Profile
Reads state/memory/profile.md and returns it, or reports that no profile has been saved yet:
save_profile — Write Profile and Plan
Overwrites state/memory/profile.md with a structured summary of the user’s goal, plan, equipment, schedule, preferences, and any constraints:
log_workout — Append a Workout Entry
Appends a single timestamped line to state/memory/workouts.md whenever the user reports a completed session:
Agent Skills
Theagent/ folder contains four skills that the model selects based on conversation context:
onboarding
Triggered when the user is new or hasn’t shared enough context. Asks for goal, equipment, schedule, and constraints, then calls
save_profile.daily-checkin
Used by the heartbeat job. Reads the saved profile, checks whether today is a training or rest day, and either asks a short accountability question or returns
[SILENT].daily-workout
Handles real-time workout reports—what the user did, how it felt, and what the next step is. Calls
log_workout to persist the entry.weekly-review
Summarizes training across the week, identifies the most useful pattern or blocker, and suggests one clear focus for the next week.
Heartbeat Job
The daily check-in is configured as akind: "heartbeat" job, which differs from a cron job in one important way: instead of firing at a fixed wall-clock time, it fires on a rolling interval relative to the last activity in each conversation scope.
everyMs— how often Heypi evaluates each in-scope thread.idleMs— the minimum quiet window required before the agent will send a message.scope—{ telegram: {} }means the job applies to every chat that has had at least one message.