🌿 TrailMate AI: Explore More, Scroll Less - An Offline AI Nature Companion A developer built TrailMate AI, an open-source, privacy-focused Progressive Web App that runs a CLIP vision-language model entirely in the browser to identify natural objects from user photos without uploading them to a server. The app pairs offline AI inference with 20 curated outdoor missions, local IndexedDB journaling, and a minimal interface designed to reduce screen time, and is deployed via GitHub Pages under the MIT license. Model weights total roughly 154 MB, with a reproducible offline test procedure documented in the repository. What if AI could help us spend less time on our phones and more time experiencing the world around us? We usually build technology to keep people engaged with screens. For this Hacktoberfest challenge, I wanted to explore the opposite: an AI-powered application that encourages people to put their phones away, step outside, and reconnect with nature. That's how TrailMate AI came to life. TrailMate AI is an open-source, privacy-focused Progressive Web App PWA that combines offline artificial intelligence, outdoor missions, and personal nature journaling. TrailMate AI is a digital outdoor companion designed for hikers, students, families, nature enthusiasts, and anyone who wants a healthier balance between technology and the outdoors. The concept is simple: Open the app. Pick an adventure. Explore nature. Put your phone away. Instead of endless feeds and notifications, TrailMate offers purposeful interactions that encourage real-world exploration. TrailMate includes 20 curated outdoor missions that turn ordinary walks into small adventures. Examples include: Each mission includes instructions, an estimated duration, progress tracking, and completion controls. The goal isn't to keep users interacting with an application. It's to give them a reason to go outside. This is where open-source AI becomes central to the project. TrailMate uses a locally executed CLIP vision-language model to analyze photographs of natural objects. Users can take or upload a picture, and the AI compares it against a curated collection of nature-related descriptions. The application displays the three closest candidate categories using cosine similarity. Unlike traditional cloud-based image recognition applications, TrailMate performs inference inside the browser. Your photos are not uploaded to an AI server. The feature is intended for educational exploration rather than scientific species identification. Users can select "Unknown / Not Sure" or manually correct a suggested category. Outdoor experiences deserve to be remembered. TrailMate includes a personal journal where users can: Journal entries are stored locally using IndexedDB. No account or cloud database is required. The most important feature is also one of the simplest. After starting an outdoor mission, users can switch to a minimal interface designed to reduce unnecessary screen interaction. The application tracks mission time using persisted timestamps, allowing sessions to survive page reloads. Users can focus on their surroundings instead of repeatedly checking the app. TrailMate also provides a lightweight progress dashboard displaying completed missions, recorded outdoor time, observations, and weekly activity. The emphasis is on celebrating time spent outside rather than creating another addictive engagement system. Live application: https://hsc-logic.github.io/TrailMate-AI/ https://hsc-logic.github.io/TrailMate-AI/ TrailMate AI is deployed as a PWA through GitHub Pages. TrailMate provides an explicit option to prepare its AI model for offline use. The model weights total approximately 154 MB , with additional tokenizer and runtime files required. Once the application and necessary model assets are cached, the architecture is designed to support local inference without a network connection. A reproducible offline test procedure is available in the repository. Demo video: To be added after recording a real outdoor test. TrailMate AI is publicly available on GitHub. GitHub Repository: https://github.com/HSC-Logic/TrailMate-AI https://github.com/HSC-Logic/TrailMate-AI The project is released under the MIT license for its original code. Developers can explore the implementation, contribute improvements, experiment with other compatible models, or adapt the application for different environments. To run it locally: \ bash git clone https://github.com/HSC-Logic/TrailMate-AI.git cd TrailMate-AI npm ci npm run dev \ \ The repository also includes architecture documentation, offline testing instructions, AI model provenance, and contribution guidelines. I wanted TrailMate to be lightweight, privacy-focused, and accessible without requiring expensive cloud infrastructure. | Component | Technology | |---|---| | Frontend | React + TypeScript | | Build Tool | Vite | | Styling | Tailwind CSS | | AI Model | CLIP ViT-B/32 | | AI Runtime | Transformers.js + ONNX Runtime Web | | Local Database | IndexedDB + Dexie | | Offline Support | Workbox / Service Workers | | Icons | Lucide | | Testing | Vitest + Playwright | | Deployment | GitHub Pages + GitHub Actions | The core AI implementation uses the browser-compatible Xenova/clip-vit-base-patch32 model, based on OpenAI's CLIP architecture. Instead of sending an image to an external API, the application processes it locally. The inference workflow looks like this: User Photo → Local Vision Encoder → Image Embedding → Similarity Comparison → Top 3 Nature Categories The application also processes 15 curated text descriptions through CLIP's text encoder. The resulting image and text embeddings are compared using cosine similarity. This makes it possible to suggest nature-related categories without a traditional backend inference service. The implementation uses quantized ONNX model artifacts and CPU-based WebAssembly execution. TrailMate uses service workers and browser caching to support offline operation. The application separates initial model preparation from regular usage: First-time setup: Download and cache the application resources and AI model while connected. Outdoor usage: Access cached resources, run local inference, complete missions, and save observations without relying on a cloud AI API. The application also checks the availability of cached model artifacts instead of assuming that registering a service worker means everything is offline-ready. TrailMate does not require users to create accounts or upload their photographs to an external AI provider. Photos and observations remain in local browser storage. Users control their journal data through export, import, and deletion options. The application does contact external hosting services to retrieve its initial resources and model artifacts, but the actual image inference is designed to happen on the user's device. This was the most important design decision behind TrailMate AI. I didn't want to build another application that simply forwards every photograph to a paid AI API. I wanted to explore what becomes possible when the model, inference runtime, and application are open and locally executable. With a hosted proprietary vision API, every request can introduce additional cost. TrailMate uses an open-weight model and local execution, so individual image analyses do not require paid API calls. This makes experimentation and community-driven development more accessible. Nature exploration can involve personal photographs and location-related information. Local inference means the user's photograph does not need to leave their device for AI analysis. For me, this is an important example of technology respecting the people who use it. Some of the most interesting outdoor locations have unreliable connectivity. A system that requires a cloud API for every AI operation is a poor fit for those environments. Local model execution provides a path toward an experience that remains useful even when mobile data is unavailable, provided the necessary assets have already been downloaded. Open innovation allows developers to inspect the inference pipeline, change candidate descriptions, evaluate different compatible models, and improve the system for specific communities. For example, future contributors could explore models and datasets better suited to tropical biodiversity in Sri Lanka. Perhaps the biggest reason open innovation matters here is accessibility. A small community project shouldn't need expensive infrastructure to help people explore their surroundings. TrailMate demonstrates how an open AI stack can support a practical application whose success isn't measured by how long someone stays online. The best interaction with TrailMate is the one that ends with someone putting their phone away and going outside. Building an offline-first AI application introduces several challenges. Model size: Local inference requires downloading and storing model weights, which can be difficult on devices with limited storage. Browser compatibility: WebAssembly support, available memory, and storage behavior can vary between devices. Recognition accuracy: CLIP similarity rankings are not scientifically validated species identifications. A model can produce plausible candidates even when the correct category is missing. Offline reliability: A cached application shell alone is not enough. The model, tokenizer, and runtime dependencies must also be available offline. These limitations shaped the design of TrailMate. Rather than hiding uncertainty, the application exposes similarity results and provides manual correction options. The repository includes reproducible testing instructions, while real-device performance, field accuracy, and outdoor testing remain areas for further validation. TrailMate AI is a starting point for exploring how open-source AI can encourage healthier digital experiences. Some possible future improvements include: I would also love to see contributors experiment with smaller models, improved offline inference, and new mission collections for different regions. The Touch Grass challenge inspired a different way of thinking about AI. We often measure AI products by how many tasks they automate or how much time they save. But what if we also measured them by how much time they give back to real life? TrailMate AI is my attempt to build technology that helps people disconnect, explore, and reconnect with the natural world. It's open-source, designed around local AI, and built with a simple philosophy: Try the app: https://hsc-logic.github.io/TrailMate-AI/ https://hsc-logic.github.io/TrailMate-AI/ Explore the code: https://github.com/HSC-Logic/TrailMate-AI https://github.com/HSC-Logic/TrailMate-AI If you have ideas for improving TrailMate, contributions and feedback are welcome