USDA Rural Opportunity Navigator is an AI-powered chatbot and analytics platform designed to connect rural Americans with crucial USDA Rural Development resources. Built in 24 hours for the HackMidwest-USDAChallenge, our solution leverages advanced web scraping, MongoDB vector search, and a Retrieval-Augmented Generation (RAG) model to deliver accurate, context-aware answers about USDA programs.
In addition to the chatbot, we provide a customizable, USDA-facing data analytics dashboard. This tool offers actionable insights from user interaction data, helping the agency better understand community needs and resource engagement.
- Conversational AI Chatbot: Answers questions about USDA Rural Development programs using RAG and OpenAI models.
- Web Scraping Pipeline: Extracts and updates USDA.gov program data for the knowledge base.
- MongoDB Vector Search: Enables semantic retrieval of relevant program info.
- Data Analytics Dashboard: Visualizes user engagement, satisfaction, and trending topics for USDA analysts.
- Location-Aware Matching: Suggests state-specific resources based on user location.
┌────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Frontend │ <-> │ FastAPI API │ <-> │ MongoDB Atlas│ <-> │ Web Scraper │
│ (React) │ │ (Python) │ │ (Vector DB) │ │ (Python) │
└────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
│
▼
┌────────────────────────────┐
│ Data Analytics Dashboard │
│ (React + Plotly) │
└────────────────────────────┘
git clone https://github.com/Ape108/USDAChatBot.git
cd USDAChatBot./scripts/setup_venv.sh
source .venv/bin/activatepip install -r backend/requirements.txtCreate a .env file in backend/ with:
OPENAI_API_KEY=your-openai-key
MONGO_URI=your-mongodb-uri
cd backend
uvicorn main_backend:app --reloadcd frontend
npm install
npm run devThe app will be available at http://localhost:5173 by default.
- Backend:
backend/main_backend.py,backend/usda_chat_api.py,backend/AItester/usda_vector_search.py - Frontend:
frontend/src/components/Chatbot/Chatbot.jsx - Vector Search: Uses OpenAI embeddings + MongoDB Atlas for semantic retrieval.
- Backend:
backend/data-analytics/- Loads and processes
chatbot_interaction_data.csv - Generates interactive Plotly visualizations (KPIs, trends, maps, satisfaction, etc.)
- Loads and processes
- Frontend:
frontend/src/components/Dashboard/Dashboard.jsx
- Scripts:
backend/webscraper/- Scrapes USDA.gov sitemaps and program pages
- Populates MongoDB with up-to-date program info and embeddings
- Data Dictionary:
backend/data-analytics/docs/data_dictionary.md - Data Sources:
backend/data-analytics/docs/data_sources.md - Data Contract:
backend/data-analytics/docs/data_contract.md
See backend/data-analytics/chatbot_interaction_data.csv for sample fields:
| session_id | user_id | timestamp | user_location_state | user_query | bot_response_summary | user_feedback | topic_category |
|---|---|---|---|---|---|---|---|
| SESS001 | USER112 | 2025-10-01T08:05:30Z | TX | I need a loan... | Provided an overview... | 1 | Economic Development |
Pull requests and feedback are welcome! For major changes, please open an issue first to discuss what you would like to change.
This project is for demonstration purposes at CrackMidwest 2025. See individual files for third-party licenses.