DEV Community

Karan Ray
Karan Ray

Posted on

Trailhead: An Offline-First Outdoor Companion

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

Trailhead is an offline-first outdoor companion. You open the app for 30 seconds. It tells you the absolute best thing to do outside today (based on your interests, the weather, and what's in season). It reads it aloud to you, gives you a route, and you put your phone away. That's it. No doomscrolling. No streaks. Just an excuse to get off the screen and into the woods.

Demo

🔗 trailhead-zv53.vercel.app

Try it out on mobile! Put in your location and hit "Find Today's Outing".

Code

(Visit the repo on GitHub: github.com/karanray06/trailhead)

How I Built It

We built Trailhead entirely on open-source, local AI tooling:

  1. Mastra: An open-source TS framework orchestrating our workflows.
  2. Ollama + Gemma 3: Running locally to generate the "daily brief". Swappable via a simple MODEL_NAME env var.
  3. TabPFN: An open-source tabular foundation model from Prior Labs. We use it in our Python microservice to predict the probability of a "good outdoor day" using zero-shot inference on historical weather data. (On Vercel Serverless, we automatically fall back to Random Forest to respect the bundle size limits!).
  4. OpenStreetMap + OSRM: Completely open data for routing and finding nearby parks.

Why Does Open Innovation Matter?

When you're out on a trail, you don't always have a 5G connection. A closed API approach (like GPT-4) would mean the app completely breaks the moment you step off the grid. With open weights (like Gemma), we can run inference directly on-device or locally, keep all location data completely private, and guarantee zero running costs for daily usage.

Our TabPFN microservice is particularly powerful here — it doesn't need to be retrained. It just looks at a tiny CSV of 2 years of local weather data and immediately gives calibrated probabilities for cold snaps, frost risk, and general outdoor comfort without any API calls.

My Agent Session

Here's how my AI pair and I fought through the updated Mastra type definitions and got the workflow to compile:

Trailhead: Mastra Agent Setup & TS Fixes
You

Let's build the Mastra Agent definition and tools for the Trailhead backend.

Agent

I'll create the 5 tools: weather-forecast, frost-dates, suggest-activity, build-route, and seasonal-checklist. Then I'll set up the Mastra workflow and Express server.

You

The typescript compiler says Property 'context' doesn't exist on type {latitude, longitude} and Property 'step' does not exist on type 'Workflow'.

Agent

Ah, the Mastra Tool API and Workflow APIs were recently updated. The tool execute function now takes the context payload directly rather than wrapping it in a {context} object. I'll fix the destructuring. For the Workflow, we now supply the steps in the constructor and bypass the .step() builder chain.

You

complete it fast and publish it to dev

Prize Categories

  • Touch Grass

Top comments (0)