DEV Community

Cover image for Pattern Hunter
Harshraj Gupta
Harshraj Gupta

Posted on

Pattern Hunter

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

Pattern Hunter 🌿: An Offline AI Companion for Discovering Patterns in Nature

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

What I Built

Pattern Hunter is a local-first AI-powered nature exploration app that encourages people to step away from their screens and discover the hidden patterns around them.

Have you ever looked at a leaf and wondered why its veins branch the way they do? Or noticed symmetry in a flower, spirals in a shell, or repeating patterns in tree bark?

Pattern Hunter turns that curiosity into a hands-on exploration experience.

Instead of spending more time scrolling through the internet to learn about nature, you get a mission, go outside, observe the world, and record what you discover.

Here's what it can do:

  • 🌱 AI-Generated Nature Missions: Llama 3.2 1B generates observation missions that encourage users to discover symmetry, spirals, branching, repetition, lines, and geometric patterns in nature.
  • 📸 AI-Powered Image Analysis: Upload a nature photo and let Moondream analyze visible structures, shapes, textures, and patterns.
  • 📓 Nature Journal: Record your observations, add personal notes, and preserve your discoveries in the browser.
  • 📴 Offline-First AI: Run the AI models locally through Ollama, so the core AI features can work without an internet connection once the models are installed.

I built Pattern Hunter for curious people, students, nature lovers, and anyone who wants to turn an ordinary walk into an opportunity to learn something new.

The idea is simple: use AI to inspire curiosity about the real world, not to keep people trapped inside an app.

Demo

Pattern Hunter currently runs locally on my laptop.

Demo video: https://drive.google.com/file/d/1OSiQxXgpk_1h8AX-WSRZPz6tSTE20jfe/view?usp=sharing

Code

GitHub repository: https://github.com/HarshrajNoob/pattern-hunter

The project is built with Python, Flask, HTML, CSS, JavaScript, and Ollama.

The source code includes the Flask backend, frontend interface, AI integration, and browser-based journal functionality.

How I Built It

I built Pattern Hunter step by step, starting with a basic Flask application and gradually integrating local AI capabilities.

1. The web application

I used Python and Flask to create the backend, with HTML, CSS, and JavaScript powering the frontend.

The backend exposes endpoints for generating nature missions and analyzing uploaded images.

2. Local AI with Ollama

I used two lightweight, open-weight models:

  • Llama 3.2 1B: Generates nature observation missions from prompts.
  • Moondream: Analyzes uploaded nature photographs and describes visible patterns.

Both models run locally through Ollama. This allows the application to use AI without sending every request to a remote inference API.

3. Image analysis

When a user uploads a supported image, the Flask backend validates the file, encodes the image, and sends it to Moondream for analysis.

The model is prompted to identify visible structures and patterns, explain the visual evidence, and acknowledge uncertainty where appropriate.

4. Nature Journal

I added a journal where users can record observations and notes. The interface can also transfer an AI analysis into the journal for the user to review and expand.

Journal entries are stored in the browser using localStorage, so they persist across page refreshes in the same browser.

5. Debugging and offline testing

One important debugging lesson was discovering that my mission endpoint was selecting from a predefined list instead of calling the AI model. I corrected the route to invoke Llama and retained the predefined missions as a fallback.

I then tested mission generation, image analysis, and journal persistence with the internet disconnected.

This project taught me that integrating AI isn't just about making a model respond. It's also about connecting the right components, handling failures, and making the overall experience useful.

Why Does Open Innovation Matter?

For Pattern Hunter, local AI isn't just a technical experiment. It directly supports the purpose of the project.

1. Access beyond reliable internet

Nature exploration often happens in parks, gardens, trails, and other places where connectivity may be unreliable. Once the models are installed, local inference makes the core AI features available without an internet connection.

2. More control over personal data

Nature photographs and personal observations can remain on the user's own device during local inference, rather than requiring every image to be uploaded to a third-party AI service.

3. Freedom to experiment

Using open-weight models means I can change prompts, adjust generation settings, compare models, and improve the application without being tied to a single hosted AI API.

4. Lower barriers to learning and building

I built this project on my own laptop using a lightweight local setup. I could experiment, debug, and learn how the AI integration works without needing a paid inference API for every request.

Open innovation made it possible to build something practical, learn from the process, and keep control of the experience.

For a project designed to encourage exploration of the natural world, having an AI companion that doesn't depend on a constant internet connection feels especially fitting.

My Agent Session

I used an iterative development process to build the application, test its features, identify bugs, and improve the integration between the frontend, Flask backend, and local AI models.

Prize Categories

I'm not claiming a partner-specific prize category at this stage. Pattern Hunter currently uses Flask, Ollama, Llama 3.2 1B, and Moondream, rather than the listed challenge partner technologies.

Final Thoughts

Pattern Hunter started as an experiment in combining local AI with a simple idea: help people notice more of the world around them.

It doesn't need to replace the experience of being outdoors. It just needs to give someone a reason to look a little closer.

Less scrolling. More observing. More curiosity. More time outside. 🌿

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.