TouchGrass AI: Building a Local AI Companion That Gets You Outside ๐ฟ
TouchGrass AI: Building a Local AI Companion That Gets You Outside ๐ฟ An AI companion designed to help you spend less time on screens and more time in the real world. 1. The Problem: We're Spending Too Much Time on Screens As developers, we spend hours staring at terminals, code editors, documentation, and pull requests. Even when our eyes feel tired and our minds need a break, stepping away fromโฆ
TouchGrass AI is an innovative local AI companion designed to help users spend more time in the real world and less time on their screens. The creator of the app aimed to build a tool that encourages people to step away from their devices and explore the outdoors, especially during the "Touch Grass" themed Hacktoberfest 2026 Week 1.
When you use TouchGrass AI, it takes into account your available time, mood, surroundings, and preferred activities to generate a personalized outdoor micro-adventure. You can choose the duration of your adventure between 10 to 120 minutes, your current mood (Stressed, Bored, Energetic, Curious, or Peaceful), the activity you want to engage in (Walking, Gardening, Observation, Birdwatching, or Surprise), and the environment you're in (Neighborhood, Park, Garden, Campus, or Balcony).
The generated adventure consists of a creative title, a short narrative hook, three to five clear sequential steps, a sensory observation challenge, a screen-free instruction to silence and put away your phone, and a reflection question to ponder upon returning. The app also features an active mode that displays only the necessary information before heading out.
One of the key reasons behind choosing a local AI instead of a cloud API is to prioritize privacy. By running inference locally using Google Gemma through Ollama, the app ensures that your mood, preferences, and reflections remain private. Additionally, the offline capability allows the app to function without an internet connection, making it perfect for preparing activities before leaving home or visiting locations with poor connectivity.
The app's modular Python architecture includes Streamlit for the user interface, Ollama for local model serving, Pydantic for input and output validation, and SQLite for adventure history and observation progress tracking. The application follows a specific flow, starting with the Streamlit interface, collecting user preferences, and displaying the generated missions in a nature-inspired visual design.
The biggest challenge encountered during the development of TouchGrass AI was ensuring that small local models return structured and usable mission data. To address this, the app employs three layers of protection: using Ollama's JSON mode, extracting JSON from the output, and validating the extracted object against a Pydantic model called OutdoorMission.
If the generation fails or the output cannot be validated, the application falls back to its curated offline mission library, clearly labeled as "๐ Curated Offline Library" to distinguish it from locally generated AI missions.
Written by urgent.news from Dev.to's reporting โ not their text. Machine-written โ may contain errors; check the original before relying on it.