DEV Community

Feng Yu
Feng Yu

Posted on AI-assisted

I Built a Fully Local AI Agent That Turns Screen Stress Into Outdoor Missions

Hacktoberfest: Maintainer Spotlight

Week 1 of the Hacktoberfest Open-Source AI Challenge asked us to build something that gets people outside. Here's what I shipped: **GrassTrace* — a local LLM agent that reads your stress signal and generates a concrete 10-minute outdoor mission.*

If you spend your day in front of markets, dashboards, or a ticket queue, you know the feeling: eyes tired, mind buzzing, and "take a break" never converts into an actual action. Nudges don't work because they're generic. What actually works is a specific task: go to the street-corner park, find five different colors of flowers, listen for bird calls, feel the wind. Ten minutes. Done.

GrassTrace is that agent. It runs 100% locally — open-weight model, no API calls, your data never leaves your machine.

The problem: stress signals you can't act on

A stress signal like "I've been staring at charts for four hours" is real, but it doesn't tell you what to do. Generic advice ("take a walk!") is exactly what your brain ignores. The fix is to make the advice concrete, sensory, and short enough to not feel like a chore.

What GrassTrace does

You describe how you feel — stress type, intensity, how many minutes you have — and a local LLM generates a structured mission:

  • diagnosis — one sentence on why you need to leave the screen
  • mission — a walkable place, a specific action, and 3 observable details (colors, sounds, textures, scents)
  • reflection — a guided question for when you come back (closes the loop, makes it stick)

Example output (Chinese, the model is bilingual):

{
  "diagnosis": "眼睛疲劳可能是因为长时间盯着屏幕,建议休息一下并进行户外活动。",
  "mission": {
    "action": "在楼下人行道上走动,观察周围环境",
    "place": "楼下人行道",
    "observe": ["花的颜色", "树的形状", "路人的表情", "路旁的气味", "路面的温度"],
    "duration_min": 10
  },
  "reflection": "10分钟的观察活动之后,你是否感觉到眼睛的酸胀有所缓解?"
}
Enter fullscreen mode Exit fullscreen mode

Architecture: one inference pass, JSON in, JSON out

Three-step prompt pipeline in a single local inference pass:

  1. Diagnose — why leaving the screen matters right now
  2. Mission — action + walkable place + 3 specific observations + duration
  3. Reflection — a guided question for when you return

The model is constrained to output nothing but a JSON object; invalid outputs are retried with schema validation (max 3 attempts). A deterministic seed keeps output reproducible. The system prompt explicitly forbids market commentary or investment advice — this is not a financial tool, it tells you to go outside.

Stack:

Piece Choice
Inference llama-cpp-python (OpenAI-compatible API, CPU)
Model Qwen2.5-3B-Instruct GGUF Q4_K_M (open-weight, ~2 GB, bilingual)
UI Streamlit with a "I'm back" check-in loop

On my reference machine (i7-4790, 16 GB RAM, no GPU) a mission takes ~30 seconds. That's the honest cost of local CPU inference — and the privacy/ownership tradeoff is worth it.

Why local matters

  • Privacy by default: stress is personal. No cloud, no logs, no prompts sent anywhere.
  • Zero marginal cost: the model runs on hardware you already own; you can even disconnect the internet.
  • The spirit of the challenge: open-weight models + local inference is exactly what this week's challenge asks for.

Try it

GitHub: https://github.com/fengyuGbt/grasstrace

The README has full setup: download the GGUF from ModelScope (or Hugging Face), pip install llama-cpp-python streamlit, one command to run, and you have a working agent.

Roadmap

  • English mission cards (the model is bilingual; UI is currently Chinese-first)
  • Auto-trigger on market volatility — the stress signal comes to you instead of you typing it
  • Voice input and a PWA shell for phone use

AI disclosure: this post and the project were built with heavy AI assistance; the author reviewed, tested, and verified everything. The project itself is fully local — the AI that powers it runs on your own machine.

Top comments (0)