Project Info
Inspiration
30% of US teens use AI chatbots daily. A third of them prefer talking to AI over talking to people for personal conversations. Common Sense Media found that every major chatbot fails to appropriately handle mental health conditions in young people. A 14-year-old died by suicide after forming an emotional bond with an AI companion. 83% of parents think their children's mental health is getting worse. Kids are already using AI unsupervised, at scale, and nothing out there was built for them. Parents have no visibility. No control. The $70 billion tutoring market is still gated by cost, and the "kid-safe" AI tools that exist are dumbed-down wrappers that children outgrow fast. Pebble started as a voice-first study companion for college students. A dedicated Android device, Canvas LMS integration, on-device speech recognition, cloud inference for tutoring. That was the plan going into TreeHacks, and for most of the 36 hours, that's what I built. Then, past 1 AM on Sunday, with submissions due at 9:30 that morning, I pivoted to children. I added a full parent management system, a real-time web dashboard, age-calibrated guardrails across four tiers (elementary, middle, high, college+), content blocking, device locking, and a multi-layered safety architecture. The college experience stayed intact as the top tier, but the product became something bigger: an AI learning device that parents can actually trust. How I built it Solo build. Three components, 36 hours: a Node.js/TypeScript backend, a native Kotlin/Jetpack Compose Android app, and a React parent dashboard. The Android device runs ONNX Whisper for speech-to-text entirely locally. No child's voice ever leaves the phone. But I didn't try to force the device to do more than it should. The real inference (Socratic tutoring, safety evaluation, tool orchestration) runs through foundation models in the cloud. Claude (Haiku) handles primary chat, with delegation to Sonnet and Opus for harder tasks. The system also routes to OpenAI (GPT) and Google (Gemini) via OpenRouter, so the agent picks the best model for a given task. Parents can select their child's preferred provider from device settings. Regardless of which model is working, all safety guardrails are enforced before any delegation happens. The agentic loop itself is built on Anthropic's Claude Agent SDK, which manages the full tool-use cycle, subagent delegation, and streaming. All 20+ Pebble tools (Canvas data, web scraping, study sessions, quizzes, persistent memory) are exposed to the SDK via an MCP server, and custom hooks bridge SDK events into SSE for the Android client in real-time. The AI teaches through active recall and Socratic questioning, never just giving answers. Canvas integration went smooth thanks to Laura Schauer's OpenAPI spec. Safety This is the part I care about most. If you're building AI for children, safety can't be a system prompt disclaimer. It has to be architectural. Pebble uses three layers. First, heuristic detection: after every response, the backend scans for redirect phrases as a fallback, catching safety events the model didn't explicitly flag. Second, an explicit tool (flag_safety_redirect) the model can call to formally log when it redirects away from a blocked topic, with structured metadata that flows to the parent dashboard. Third, emergency lockout: for critical violations, the model calls emergency_lock_device, which immediately locks the device, flags the conversation for parent review, and pushes a real-time alert via SSE. No further interaction until a parent unlocks it. Every interaction is also shaped by age-calibrated guardrails. Parents can block custom topics and set daily time limits. And the parent web dashboard shows every conversation, every study session, every safety redirect, plus AI-generated weekly summaries, mastery tracking, Canvas grades, and proactive alerts. The dashboard isn't a token gesture. It's the product's other half. Challenges SSE streaming with agentic tool-use loops was the hardest part. The model calls multiple tools mid-response, and the client needs to know what's happening at every step. I built incremental streaming that emits tool status, text deltas, heading tags, quiz payloads, study session updates, and safety events over a single connection. Most of the bugs I squashed during my all-nighter lived here: the model starting a study session but forgetting to quiz (solved with continuation nudging), text deltas arriving mid-tag, the client disconnecting mid-tool-loop. Each one was small, but they stacked up. The kid pivot at 1 AM was its own challenge. Not because the code was hard, but because the scope was enormous. Parent accounts, a web dashboard, real-time alerts, device locking, activity logging, age-calibrated prompts, and a safety architecture I could stand behind. All in under eight hours. What I learned The right abstraction boundaries make ambitious projects possible. On-device STT, cloud inference. Architectural safety, not prompt-level. The parent dashboard as a first-class component, not a bolt-on. Each decision made the system easier to reason about, even at 4 AM when nothing was compiling. Building for kids forces you to think harder. When your user is a 7-year-old, "it usually works" isn't good enough.
Pebble
A dedicated AI learning device for kids. Voice-first. Parent-managed. Built solo at TreeHacks 2026 in 36 hours.
Why
30% of US teens use AI chatbots daily. A third of them prefer talking to AI over talking to people. Common Sense Media found that every major chatbot fails to safely handle young people's mental health. A 14-year-old died by suicide after bonding with an AI companion.
Kids are already using AI unsupervised, at scale, and nothing out there was built for them. Parents have no visibility. No control. The "kid-safe" AI tools that exist are dumbed-down wrappers that children outgrow fast.
Pebble is a purpose-built Android device that runs a voice-first AI tutor, managed entirely by parents. It's not an app. It's an appliance for learning.
What It Does
For kids: Tap the orb, ask a question, hear an answer. Pebble connects to Canvas LMS, knows your courses and deadlines, and teaches through Socratic questioning and interactive quizzes. It doesn't give answers. It teaches.
For parents: A real-time web dashboard showing every conversation, every study session, every time the AI redirected away from something unsafe. Set the age group (elementary, middle, high, college+), block specific topics, set daily time limits. The dashboard isn't a token gesture. It's the product's other half.
For college students: The same powerful tutor, minus the parental guardrails. Full Canvas integration, guided study sessions, mastery tracking, proactive deadline alerts. Self-managed.
Safety
This is the part I care about most. If you're building AI for children, safety can't be a system prompt disclaimer. It has to be architectural.
Pebble uses three layers:
- Heuristic detection - After every response, the backend scans for redirect phrases as a fallback, catching safety events the model didn't explicitly flag.
- Explicit tooling - The model can call
flag_safety_redirectto formally log when it redirects away from a blocked topic, with structured metadata that flows to the parent dashboard. - Emergency lockout - For critical violations,
emergency_lock_deviceimmediately locks the device, flags the conversation for parent review, and pushes a real-time alert. No further interaction until a parent unlocks it.
Every interaction is also shaped by age-calibrated guardrails. A 7-year-old gets simple words, lots of encouragement, one concept at a time. A 16-year-old gets full vocabulary, Socratic questioning, college prep focus. Parents can block custom topics on top of the defaults. And all of this is enforced before any model delegation happens, so safety guardrails hold regardless of which model is doing the work.
Architecture
Three components:
Android App (Kotlin/Compose) Backend (Node.js/TypeScript) Web Dashboard (React)
├── On-device ONNX Whisper STT ├── Express API server ├── Parent auth
├── Voice orb UI (4 states) ├── Claude agentic tool-use loop ├── Child device linking
├── Interactive quiz overlay ├── Canvas LMS proxy ├── Activity feed
├── Study session progress ├── Multi-model delegation ├── Progress tracking
├── Drawing canvas + vision ├── Web scraper (external syllabi) ├── Safety redirect log
├── Kiosk mode lockdown ├── Parent account system ├── Guardrail settings
└── ElevenLabs TTS (system fallback) ├── Safety enforcement pipeline └── Proactive alerts
├── PostgreSQL persistence
└── SSE streaming
Privacy: Speech recognition runs entirely on-device with Whisper. No child's voice ever leaves the phone.
Model delegation: Claude Haiku handles primary chat (fast, cheap). It delegates to Sonnet for moderate complexity and Opus for hard problems. GPT and Gemini are also available via OpenRouter. Haiku always acts as the safety gatekeeper before any delegation.
Canvas integration: Courses, assignments, grades, announcements, modules, pages. External course websites (like math department sites that Canvas doesn't know about) are detected and scraped automatically.
Voice Conversation Flow
- Kid taps the orb. Audio recorded at 16kHz mono.
- ONNX Whisper transcribes on-device. Transcript sent to backend.
- Claude runs an agentic tool-use loop (up to 10 iterations, 20+ tools available).
- SSE streams back: tool status, text deltas, quiz events, study session updates, safety events.
- Response spoken via ElevenLabs TTS (or system TTS as fallback).
- Orb transitions: idle -> listening -> thinking -> speaking -> idle.
Study Sessions
Say "help me study for math" and Pebble pulls real assignments from Canvas, identifies weak topics from past mastery data, and walks you through active recall. Interactive quizzes with instant grading. It remembers what you got wrong last time and comes back to it. Mastery scores persist across sessions.
Running It
Backend
cd backend
npm install
npm run db:migrate # PostgreSQL migrations (idempotent)
npm run dev # Development server with verbose logging
Needs a .env with: ANTHROPIC_API_KEY, DATABASE_URL (PostgreSQL), PORT (default 3001). Optional: OPENROUTER_API_KEY for GPT/Gemini delegation.
Android
Open android/ in Android Studio. Set BACKEND_URL, ELEVENLABS_API_KEY, and ELEVENLABS_VOICE_ID in android/local.properties. Default backend URL for emulator: http://10.0.2.2:3001.
Web Dashboard
cd web
npm install
npm run dev # Vite dev server
npm run build # Builds to dist/ (served by backend as static files)
Demo UI (Splash Site)
cd demo-ui
npm install
npm run dev
Stack
- Android: Kotlin 2.1, Jetpack Compose, ONNX Runtime, Retrofit, minSdk 26
- Backend: Node.js, TypeScript (strict), Express, PostgreSQL, Anthropic SDK, Claude Agent SDK
- Web: React 19, TypeScript, Vite, Tailwind CSS
- AI: Claude (Haiku/Sonnet/Opus), GPT-4o, Gemini 2.5 Pro via OpenRouter
- Speech: ONNX Whisper tiny.en (on-device STT), ElevenLabs (cloud TTS)
Background
This started as a voice-first study companion for college students. Canvas integration, on-device speech recognition, cloud inference for tutoring. That was the plan going into TreeHacks.
Then, past 1 AM on Sunday, with submissions due at 9:30 that morning, I pivoted to children. I added a full parent management system, a real-time web dashboard, age-calibrated guardrails across four tiers, content blocking, device locking, and a multi-layered safety architecture. The college experience stayed intact as the top tier, but the product became something bigger: an AI learning device that parents can actually trust.
Building for kids forces you to think harder. When your user is a 7-year-old, "it usually works" isn't good enough.
Built With
Built solo by Zane St. John at TreeHacks 2026 (Stanford, Feb 14-16).
License
MIT. See LICENSE.
Analysis
View
Metric
- 12
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- CSSIn code
- ExpressIn code
- HTMLIn code
- JavaScriptIn code
- KotlinIn code
- OpenAIIn code
- PostgreSQLIn code
- ReactIn code
- SQLIn code
- Tailwind CSSIn code
- TypeScriptIn code
- Google GeminiClaimed
- Node.jsClaimed
12 of 14 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeConfig · Commits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
2.4 MB
Source files
171
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
zane-programs/treehacks-pebble
200 files · 74.4 MB · @ fafe6ce
Structure
Interface
79 files · 40%Screens, components and styles rendered to the user.
API & routing
10 files · 5%Request entry points: routes, handlers and controllers.
Application logic
57 files · 28%Domain rules, services and shared utilities.
+2 moreData & schema
20 files · 10%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- YAML64%
- TypeScript18%
- Kotlin16%
- Markdown2%
- SQL0%
- XML0%
- Other (3)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
backend/package.json
npm · 24- @anthropic-ai/claude-agent-sdk
- @anthropic-ai/sdk
- @ngrok/ngrok
- @types/bcryptjs
- @types/jsonwebtoken
- @types/pg
- bcryptjs
- cors
- dotenv
- express
- html-to-text
- jsdom
- jsonwebtoken
- openai
- pg
- qrcode-terminal
- zod
- +7 more
web/package.json
npm · 19- @tailwindcss/vite
- input-otp
- lucide-react
- react
- react-dom
- react-router-dom
- tailwindcss
- +12 more
demo-ui/package.json
npm · 10- @tailwindcss/vite
- framer-motion
- react
- react-dom
- tailwindcss
- +5 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.