🌿 Overview: Bringing AI Outdoors ("Touch Grass")
Developers spend countless hours glued to screens and debugging code. For Week 1 of the Hacktoberfest Open-Source AI Challenge under the "Touch Grass" theme, I built the Local Micro-Garden & Frost Date Advisor Agent.
This interactive CLI agent evaluates regional frost limits, identifies cold-hardy crops, and creates an actionable outdoor task list based on how many hours you want to spend outside getting your hands in the soil.
🛠️ Tech Stack & Local Setup
The agent runs 100% locally on a Mac with zero external API dependencies or cloud key limits:
-
Framework: Mastra (
@mastra/core) for agent orchestration and tool execution. -
LLM Engine: Local
llama3.1model running via Ollama with native tool-calling support. - Type Safety & Validation: Zod for strict tool input/output schema enforcement.
-
Runtime: Node.js + TypeScript (
tsx).
💡 Architecture & Tools
The agent coordinates two Mastra tools to build the garden plan:
-
getFrostDataTool: Analyzes historical frost dates and recommends cold-weather crops (such as Spinach, Garlic, Kale, and Winter Cabbage). -
generatePlanTool: Converts your target outdoor time into a step-by-step checklist covering soil prep, mulching, and frost sheet installation.
🤖 Local Agent Definition (src/agent.ts)
import { Agent } from '@mastra/core/agent';
import { createOpenAI } from '@ai-sdk/openai';
import { getFrostDataTool, generatePlanTool } from './tools.js';
// Connect to local Ollama instance running llama3.1
const ollama = createOpenAI({
baseURL: '[http://127.0.0.1:11434/v1](http://127.0.0.1:11434/v1)',
apiKey: 'ollama',
});
export const gardenAgent = new Agent({
id: 'micro-garden-agent',
name: 'Micro-Garden Frost Advisor',
instructions: `
You are an AI assistant designed for the "Touch Grass" challenge.
Your goal is to evaluate local frost dates and produce an outdoor weekend gardening plan.
Encourage hands-on outdoor physical activity and practical soil maintenance.
`,
model: ollama('llama3.1'),
tools: {
getFrostData: getFrostDataTool,
generatePlan: generatePlanTool,
},
});
📸 Demo & Terminal Output
Running the CLI with Bengaluru and 5 outdoor hours:
🌱 --- Micro-Garden & Frost Date Advisor Agent --- 🌱
Enter your City or ZIP code: Bengaluru
How many hours do you want to spend outside gardening this weekend? 5
Consulting outdoor garden advisor...
--- YOUR WEEKEND OUTDOOR PLAN ---
Here is your customized outdoor action plan for Bengaluru:
- Soil Prep: Apply a thick mulch layer to protect cold-hardy crops.
- Planting Checklist: Plant Spinach, Garlic, and Winter Cabbage.
- Frost Covers: Install simple protection sheets over sensitive beds.
Enjoy your 5 hours outdoors in the garden! 🌻
🔗 Repository & Quickstart
GitHub Repository: github.com/2AJ0/touch-grass-micro-garden-agent
How to Run Locally
# 1. Pull the tool-calling model in Ollama
ollama pull llama3.1
# 2. Clone & Install
git clone [https://github.com/2AJ0/touch-grass-micro-garden-agent.git](https://github.com/2AJ0/touch-grass-micro-garden-agent.git)
cd touch-grass-micro-garden-agent
npm install
# 3. Launch CLI Agent
npx tsx index.ts
What winter crops are you planning for your garden this season? Let me know in the comments! 🍃
Top comments (0)