goji Goji Project goji

Goji is the first ecological calendar platform to use AI-powered question answering and real-time indicator mapping based on your location and curiosity. By combining large language models with ecological data, Goji turns seasonal events into an interactive, personalized experience of nature's rhythms.

Inspiration

An ecological calendar is a composition of seasonal indiactors that mark the transitional periods between seasons. For instance, a flower blooming could mark the transitional period between Winter and Spring, or the sighting of bird migrations could represent that Fall is ending.

What if ecological indicators move along hidden paths—higher-dimensional trajectories shaped by complex relationships—beyond what we can easily observe?

This project is a step toward modeling, visualizing, and understanding those invisible interactions—using relivant and updated data, AI interpretation, and ecological theory.

View a demo of Goji here: (https://youtu.be/evHEawFvunQ)

Design

Why Perplexity Sonar API?

Perplexity Sonar API is ideal for an AI engine like Goji because of its:

  • Advanced contextual understanding: Sonar handles complex ecological queries with higher nuance and precision compared to most general-purpose LLMs.
  • Web-aware architecture: This ability is especially useful for Goji becuase the ecology is constantly changing, and it's crucial that recent data is considered when making an Ecological Calendar.
  • Fast and cost-effective inference: Compared to heavier LLMs, Sonar offered a practical tradeoff between performance and cost for near real-time usage.

The raw results from Perplexity are passed to Gemini (via parsers.py) for intelligent postprocessing and structuring into a MongoDB-ready JSON format.


Architectural Decisions

Frontend

The frontend is built in React with Tailwind CSS, chosen for:

  • Component-based design: Enables modular UI development (e.g., ChatBot.jsx, EcoCalendar.jsx, etc.)
  • Speed and scalability: Tailwind CSS accelerates prototyping and enforces consistent styling across the app.
  • Visual clarity: React is ideal for dynamic UI rendering, such as drawing indicator arcs on the calendar in response to JSON data.

Backend

The backend is powered by FastAPI, selected for:

  • Speed and async support: Handles multiple external API requests (e.g., Perplexity, Nominatim) efficiently.
  • Modular routing and service layer: Routes are cleanly separated from services (e.g., chat_logic.py, calendar_service.py), making the codebase scalable and maintainable.
  • MongoDB integration: Each user has a dedicated document that evolves through the app’s steps: name → location → question → calendar.

Geolocation with Nominatim

Location data is essential to tailoring ecological calendars. We use geo_utils.py to:

  • Convert ZIP codes into latitude/longitude
  • Perform reverse geocoding for user-friendly location labels
  • Normalize geographic input for consistent MongoDB entries

Goji Architecture Diagram


Why This Structure?

Goji is built around a three-stage user journey:

  1. Identity: User.jsx captures the user's name → initializes an empty calendar in MongoDB.
  2. Place: LocationForm.jsx resolves geographic intent using geo_utils.py.
  3. Purpose: ChatBot.jsx captures the user's ecological inquiry → flows through chat_logic.py and parsers.py → results render in EcoCalendar.jsx.

This structure reflects Goji's core goal: turning curiosity into seasonal, place-based ecological insight, using the strengths of modern LLMs and data pipelines.

Project Structure

This project is organized into two parts, a frontend–backend split using React + Tailwind/Vite and FastAPI, with MongoDB as the data store and integration with AI and ecological data APIs.

goji-frontend/
├── .gitignore
├── README.md
├── package.json
├── package-lock.json
├── index.html
├── tailwind.config.mjs
├── vite.config.js
├── eslint.config.js
├── node_modules/
├── public/
│ ├── goji berry mini.png
│ └── vite.svg
├── src/
│ ├── App.css
│ ├── App.jsx
│ ├── index.css
│ ├── main.jsx
│ ├── assets/
│ │ └── react.svg
│ ├── components/
│ │ ├── BackgroundArcs.jsx                   # Uses p5.js to draw Arcs in the background
│ │ ├── CategoryDropdown.jsx
│ │ ├── ChatBot.jsx                          # Chat Box application: Third Page
│ │ ├── EcoCalendar.jsx                      # Ecological Calendar application: Third Page
│ │ ├── LocationForm.jsx                     # Location form entered by user: Second Page
│ │ └── User.jsx                             # Username page: First Page
│ ├── hooks/
│ │ └── useLocationApi.js
│ └── lib/
│ ├── api.js
│ └── geoUtils.js

goji-backend/
├── .env
├── .gitignore
├── README.md
├── requirements.txt
├── venv/
├── json/
│ ├── example.json
│ └── indicator_type_cache.json
├── app/
│ ├── init.py
│ ├── db.py
│ ├── geo_utils.py                           # Location utilities (Nominatim, zip resolution)
│ ├── llm_utils.py                           # Shared AI helpers (if not in services)
│ ├── main.py                                # FastAPI entry point
│ ├── parsers.py                             # Gemini logic for parsing AI results
│ ├── routes/
│ │ ├── calendar.py
│ │ ├── chat.py
│ │ ├── location.py
│ │ ├── update_calendar_location.py
│ │ └── user.py
│ ├── schemas/
│ │ └── calendar_schema.py                   # Pydantic models
│ └── services/
│ ├── calendar_service.py                    # Business logic for calendar building
│ └── chat_logic.py                          # Handles AI querying + pre/postprocessing

## Project Root

├── .git/                                    # Git version control metadata
├── .gitignore                               # Ignored files for Git
├── goji-frontend/                           # React + Tailwind CSS frontend
├── goji-backend/                            # FastAPI backend with LLM, Geo, and Calendar logic

README.md                                    # Project overview and setup instructions

Next Steps & Challenges

Next Steps

  • Enhanced Indicator Visualization: Incorporate more dynamic visual layers to represent ecological indicator intensity and frequency.
  • User Customization: Allow users to filter, save, and compare ecological calendars across locations and seasons.
  • Chat Memory: Let users revisit old chats with Goji.
  • I want Goji to have the ability to, once generate an ecological calendar, inform its code from the indicators it drew to draw new conclusions about when seasons acrually occur. Signs of a season show through the indicators, so if I could have a way to update its-self after it has learned something theen maybe it can infer more predictability for when particualr seasonal indicators appear. Such as prediciting when weather patterns occur inferred by insect populations or bird activity.

Challenges

  • Parsing AI Responses Reliably: LLM outputs (e.g., from Perplexity + Gemini) are inconsistent and require strict parsing to create usable JSON.
  • Geographic Resolution: Determining the most meaningful spatial scale (e.g., zip code vs. ecoregion) for ecological relevance is ongoing.
  • Temporal Sensitivity: Seasonal shifts are increasingly unpredictable due to climate change, making "typical" patterns harder to define.

Important

Human ecology takes on a dynamic role. It is not a linear genealogical notion of relatedness (or kinship), but rather a progenerative idea of all-encompassing relationships. Relationships are not closed nor static; they are continuously shaped by external forces that impact the system as a whole. The building of an ecological calendar is an intimate process becuase it recognizes the cocreation of interactions in our natural world. Goji is a tool to assist in cogenerative learning about our beautiful world.

Contanct

Stay tuned for updates. Roman Q. Chavez (rqc3@cornell.edu)

Built With

Share this project:

Updates