Skip to content
/ askfia Public

askFIA - AI-powered natural language interface for querying USDA Forest Service FIA data | Part of fiatools.org

Notifications You must be signed in to change notification settings

mihiarc/askfia

Repository files navigation

askFIA

Ask questions, get forest answers

FIAtools Ecosystem Live App License: MIT Python 3.11+

Part of the FIAtools Python Ecosystem
pyFIA · gridFIA · pyFVS · askFIA


A conversational AI interface for forest inventory data. Ask natural language questions about USDA Forest Service FIA data and get instant answers.

What can you ask?

"How much timber volume is in North Carolina?"

"Compare loblolly pine biomass between Georgia and Alabama"

"What are the top species by basal area in Oregon?"

"How has forest area changed in the Southeast?"

"Show me mortality trends in the Pacific Northwest"

Try It

Visit ask.fiatools.org to start asking questions.

Features

Capability Description
Natural language Ask questions in plain English
Conversational Follow-up questions with context
Streaming Real-time response streaming
FIA data access Queries USDA Forest Service inventory data

Architecture

graph TD
    A[ask.fiatools.org] --> B[askfia-api.onrender.com]
    B --> C[pyFIA]
    C --> D[MotherDuck]
Loading

API Usage

The backend API is available at https://askfia-api.onrender.com.

Streaming Chat

curl -X POST https://askfia-api.onrender.com/api/v1/chat/stream \
  -H "Content-Type: application/json" \
  -d '{"message": "What is the total forest area in Oregon?"}'

Direct Queries

# Forest area
curl -X POST https://askfia-api.onrender.com/api/v1/query/area \
  -H "Content-Type: application/json" \
  -d '{"state": "OR"}'

# Timber volume
curl -X POST https://askfia-api.onrender.com/api/v1/query/volume \
  -H "Content-Type: application/json" \
  -d '{"state": "NC", "species": "loblolly pine"}'

# Biomass
curl -X POST https://askfia-api.onrender.com/api/v1/query/biomass \
  -H "Content-Type: application/json" \
  -d '{"state": "GA"}'

Health Check

curl https://askfia-api.onrender.com/health

Local Development

# Clone the repository
git clone https://github.com/mihiarc/askfia.git
cd askfia

# Install dependencies
make install

# Run frontend and backend together
make dev

# Or run separately:
cd backend && uv run uvicorn askfia_api.main:app --reload
cd frontend && npm run dev

Environment Variables

Backend (backend/.env):

ANTHROPIC_API_KEY=your-api-key
MOTHERDUCK_TOKEN=your-token
CORS_ORIGINS=http://localhost:3000

Frontend (frontend/.env.local):

NEXT_PUBLIC_API_URL=http://localhost:8000

Tech Stack

Layer Technology
Frontend Next.js 15, React 19, Tailwind CSS, shadcn/ui, Vercel AI SDK
Backend FastAPI, Pydantic v2, LangChain, Claude API
Data pyFIA, DuckDB, Polars, MotherDuck
Deployment Netlify (frontend), Render (backend), MotherDuck (data)

Coming Soon

  • Custom reports
  • Data downloads
  • Custom analysis templates

The FIAtools Ecosystem

askFIA is part of the FIAtools Python ecosystem - a unified suite of open-source tools for forest inventory applications:

Tool Purpose Key Features
pyFIA Survey & plot data DuckDB backend, 10-100x faster than EVALIDator
gridFIA Spatial raster analysis 327 species at 30m resolution, Zarr storage
pyFVS Growth simulation Chapman-Richards curves, yield projections
askFIA AI interface Natural language queries for forest data

Explore the full ecosystem at fiatools.org

Affiliation

Developed in collaboration with USDA Forest Service Research & Development. askFIA provides an AI-powered interface to Forest Inventory and Analysis (FIA) data but is not part of the official FIA Program.

Citation

@software{askfia2025,
  title = {askFIA: Conversational AI Interface for Forest Inventory Data},
  author = {Mihiar, Christopher},
  year = {2025},
  url = {https://fiatools.org}
}

fiatools.org · Python Ecosystem for Forest Inventory Applications
Built by Chris Mihiar · USDA Forest Service Southern Research Station

About

askFIA - AI-powered natural language interface for querying USDA Forest Service FIA data | Part of fiatools.org

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •