Project Info
This project did not submit a demo video on Devpost.
Inspiration
As a team of outdoor enthusiasts, we’ve all had those moments where the unexpected happens—getting lost, an injury, or sudden weather changes. We realized how vulnerable we felt without instant access to the right information or emergency help. That shared experience drove us to create Campanion, an AI tool designed to provide real-time guidance and safety tips, so explorers like us can stay prepared and enjoy nature with peace of mind. Our goal is to turn those uncertain moments into empowering ones, giving every adventurer the confidence to explore safely.
What it does
Campanion takes as input the hike you're planning on going on and what items you plan on carrying in your bag during the hike, and then provides personalized safety recommendations, potential hazard alerts, and essential tips based on the terrain, weather conditions, and your equipment. In case of danger, you can trigger an emergency alert to notify your contacts with your location. Plus, you can chat with the bot to learn how to safely navigate the outdoors, getting real-time guidance and advice tailored to your specific situation.
How we built it
Our back-end is powered by Python, integrated with Chroma DB to efficiently manage and retrieve data. For AI capabilities, we utilized Gemini 1.5 alongside Langchain, ensuring fluid and dynamic interactions between users and the AI. The front-end was built using Swift 5 and Swift UI to create a smooth, native iOS experience. To enhance the app’s accuracy and data richness, we incorporated the Weather API and the National Parks Service API. Finally, all design prototypes and user flows were created in Figma to ensure a user-friendly interface.
Challenges we ran into
One of the key challenges we faced while building Campanion was our goal to store the AI model locally on a user’s device. This would allow hikers to still interact with the AI and receive guidance even when they’re in areas without reception, which is critical for outdoor explorers. However, we encountered issues with the Gemini model we were using to power the AI, particularly around optimizing it for offline use while maintaining its responsiveness and accuracy. Balancing the model's size and efficiency without compromising its capabilities remains a technical hurdle we are working through.
Accomplishments we're proud of
One of the accomplishments we're particularly proud of is how we adapted to the challenges we faced, especially with the Gemini model and offline functionality. Initially, we struggled with how to properly scope the project, leading to a lot of back-and-forth adjustments. It was a complex process figuring out the right balance between the model’s performance and ensuring a seamless experience for users even without reception. But through persistence and iteration, we found creative solutions that allowed us to overcome those hurdles and get the app working effectively. We're also proud in how we all rallied to learn skills that we weren't totally familiar with before the hackathon to accomplish that ultimate goal a working version out in the world!
What we learned
One of the key lessons we learned during the development process was how to effectively integrate an LLM into an app and leverage APIs to create a seamless, responsive user experience. This required understanding how to connect the AI model and optimize interactions between the front-end and back-end systems, ensuring that the app functioned smoothly while providing helpful information to users. This technical experience has greatly enhanced our ability to build more integrated and intelligent applications in the future!
What's next
Next for Campanion, we plan to focus on making the app fully functional offline, ensuring users can rely on it even in the most remote areas. We’re also exploring the possibility of integrating satellite technology to provide more accurate, real-time data on weather, terrain, and location, further enhancing the safety and reliability of the app for outdoor adventurers. These developments will make Campanion an even more robust tool for navigating the wilderness.
Campanion - Your AI-Powered Hiking Assistant

Welcome to Campanion, the ultimate AI-driven hiking assistant developed for Calhacks 11.0. Our mission is to redefine outdoor safety and enjoyment by offering real-time, intelligent support tailored for hikers. Whether you need help navigating trails, sharing your location in emergencies, or getting critical safety information, Campanion is here to guide and protect you throughout your journey.
Features
- AI-Powered Chat: Ask for tips, directions, or safety advice using natural language. Our custom LLM integration ensures you get relevant, context-aware responses.
- Emergency SOS Mode: Activate emergency mode to notify contacts, share your location, and interact with an AI for immediate assistance.
- Real-Time Alerts: Receive location-based safety alerts and trail conditions to stay informed about your surroundings.
- Custom Hike Details: View specific information about the park you're hiking in, including essential safety tips, weather, and emergency contact functionality.
- Packed Item Context: Use the packed item list to inform the AI assistant about the gear you’re carrying, enabling more personalized guidance.
Tech Stack
Frontend
- SwiftUI: The user interface of Campanion is built with SwiftUI for seamless and elegant designs across iOS devices.
- MapKit: For location services and providing real-time GPS-based data, we integrate Apple's MapKit.
- CoreLocation: Used for geolocation services to track hiker movements and provide relevant park information.
Backend
- Google Gemini & ChromaDB: We utilize Google Gemini as our primary LLM in conjunction with ChromaDB for vector storage and retrieval in our RAG (Retrieval-Augmented Generation) pipeline.
- Retrieval-Augmented Generation (RAG): To deliver factually accurate and context-rich responses, we implemented RAG, ensuring that users receive answers based on both the LLM’s knowledge and relevant external sources.
- Azure Services: We leverage Azure cloud services to deploy and manage our backend API, ensuring scalability and reliability.
- Custom LLM Backend: When the Huggingface Gemma model proved unfeasible for iPhone deployment, we built a custom backend to communicate with our RAG-based LLM, providing context-aware responses and safety tips for hikers.
API
- Node.js + Express: Our backend API is built using Node.js with Express, designed to handle requests and communicate with the AI models and databases.
- PostgreSQL: A PostgreSQL database is used for storing user data, hike details, and park-specific safety information.
- LLM Communication: The API handles requests from the frontend, querying our AI engine with user questions and contextual information such as the park location and packed items.
Challenges We Overcame
- Deploying RAG-based LLM: Initially, we encountered issues with running the Huggingface Gemma model locally on iPhone due to hardware limitations. To solve this, we deployed our own LLM backend, leveraging Google Gemini and ChromaDB to provide accurate and contextually relevant responses.
- Real-Time Emergency Services: Implementing a robust emergency notification system that seamlessly integrates with satellite connectivity and contacts required careful architecture and testing.
- Dynamic Context Handling: Passing real-time user context (like location and packed items) to the LLM API was essential for providing hikers with accurate guidance.
How to Use
- Download the App: Install Campanion on your iPhone and set up your emergency contacts.
- Start Your Hike: Select your hiking location and begin your adventure. Campanion will track your progress and offer real-time guidance.
- Stay Safe: Access essential safety information, real-time alerts, and AI-guided tips based on your hike location and packed items.
- SOS Mode: In case of emergencies, activate SOS mode to notify services and contacts, with satellite support to ensure you’re always connected.
Conclusion
Campanion is more than just a hiking app — it's your AI-powered safety partner on the trail. With a focus on real-time emergency response, personalized guidance, and context-aware interactions, we’ve built a solution that prioritizes hiker safety and enjoyment. Developed for Calhacks 11.0, Campanion harnesses the power of cutting-edge AI and real-time technology to redefine outdoor exploration.
License
This project is licensed under the MIT License.
Analysis
View
Metric
- 7
- 2
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- FlaskIn code
- LangChainIn code
- PythonIn code
- SwiftIn code
4 of 4 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
89 KB
Source files
31
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
ankurgarg-code/calhackscampanion
46 files · 2.3 MB · @ ea69d89
Structure
Application logic
33 files · 72%Domain rules, services and shared utilities.
+6 moreData & schema
5 files · 11%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Swift87%
- Markdown10%
- Python3%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
rag_model/depend/requirements.txt
pypi · 5- Flask
- langchain
- langchain-chroma
- langchain-community
- langchain-google-vertexai
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
AI-powered chat for hiking guidanceVerified
Chat with the bot to learn how to safely navigate the outdoors, getting real-time guidance tailored to your situation
Claimed on readmehigh confidenceHikerAI/ViewModel/ChatViewModel.swift:20— sendMessage posts the user question plus park/packed-items context to a backend /api/ask endpoint and appends the response to the chatHikerAI/View/ChatView.swift— Chat UI view exists and is wired to ChatViewModelrag_model/app.py:15— Flask /ask endpoint calls get_answer(question) and returns the LLM answer as JSON
ChromaDB vector storage / RAG pipelineVerified
ChromaDB used for vector storage and retrieval in a RAG pipeline
Claimed on readmehigh confidencerag_model/model_setup.py:27— vectorstore = Chroma.from_documents(...) with retriever built from it, used inside the ConversationalRetrievalChain
MapKit and CoreLocation for geolocation servicesVerified
MapKit and CoreLocation used for location services, GPS-based data, and tracking hiker movements
Claimed on readmehigh confidenceHikerAI/ViewModel/HikeViewModel.swift:14— MKLocalSearchCompleter (MapKit) is used for city/location search suggestionsHikerAI/Utilities/LocationManager.swift:4— CLLocationManager (CoreLocation) is used to request authorization and publish userLocation
National Parks Service API integration for park details and alertsVerified
Incorporated the National Parks Service API for park info and real-time location-based alerts
Claimed on Devposthigh confidenceHikerAI/Utilities/ParkService.swift:11— fetchParks calls developer.nps.gov/api/v1/parks with an API key and decodes ParkResponseHikerAI/Utilities/AlertService.swift:4— fetchAlerts calls developer.nps.gov/api/v1/alerts and decodes into Alert models, surfaced via AlertsView
Packed item context informs AI guidanceVerified
Use the packed item list to inform the AI assistant about the gear you're carrying for personalized guidance
Claimed on readmehigh confidenceHikerAI/View/ItemInputScreen.swift:30— Users add packed items to viewModel.hikerDetails.itemsHikerAI/View/HikeSummaryView.swift:324— packedItems string built from viewModel.hikerDetails.items and passed into ChatViewHikerAI/ViewModel/ChatViewModel.swift:40— packedItems is included in the user_context field sent to the backend with each chat question
RAG backend with Gemini 1.5 and LangChainVerified
Backend powered by Python, Chroma DB, Gemini 1.5 and Langchain for AI-driven responses
Claimed on Devposthigh confidencerag_model/model_setup.py:19— ChatVertexAI(model="gemini-1.5-flash") instantiates the Gemini 1.5 LLMrag_model/model_setup.py:53— ConversationalRetrievalChain.from_llm wires LangChain retrieval chain with the LLM and retrieverrag_model/model_setup.py:27— Chroma.from_documents builds the vector store used as the retriever
Custom hike details / park selectionCode-supported
View specific information about the park you're hiking in, including safety tips, weather, and emergency contact functionality
Claimed on readmemedium confidenceHikerAI/View/ParkSelection.swift— Park selection view exists and uses HikeViewModel.fetchNearbyParks/selectParkHikerAI/View/HikeSummaryView.swift:152— Current Conditions card shows temperature/wind/precipitation, but these are hardcoded static strings (e.g. "68°F"), not fetched from a weather source
Emergency contacts managementCode-supported
Set up your emergency contacts before hiking; contacts are notified in emergencies
Claimed on readmemedium confidenceHikerAI/View/AddContactsView.swift:54— AddContactsView lets users append EmergencyContact entries to a local in-memory contacts arrayHikerAI/Model/EmergencyContact.swift— EmergencyContact model exists to store name/phone/relationHikerAI/View/HikeSummaryView.swift:218— Contacts are stored only in local @State and displayed as text; no code sends notifications to these contacts
Emergency SOS mode / notify contacts with locationCode-supported
Activate emergency mode to notify contacts, share your location, and interact with an AI for immediate assistance; trigger an emergency alert with your location
Claimed on readmemedium confidenceHikerAI/View/EmergencyView.swift:23— EmergencyModeView and SOSBotView present an SOS flow with status text like 'Emergency contacts notified' and 'Location sharing active', but these are static labels, not backed by any code that actually sends a notification or shares GPS coordinatesHikerAI/View/HikeSummaryView.swift:271— SOS button in HikeSummaryView triggers presentation of SOSBotView via a sheet, but no network/SMS/call code is invokedHikerAI/Utilities/LocationManager.swift:4— LocationManager can fetch userLocation via CoreLocation, but it is not called from the SOS/Emergency views to actually transmit location anywhere
Personalized safety recommendations based on terrain, weather and equipmentCode-supported
Provides personalized safety recommendations, hazard alerts, and tips based on terrain, weather conditions, and equipment
Claimed on Devpostlow confidenceHikerAI/ViewModel/ChatViewModel.swift:40— Only park name and packed items are sent as context to the AI backend; no weather or terrain data is included in the requestrag_model/model_setup.py:23— RAG retrieval is based on a static corpus_combined.txt file, not live terrain/weather/equipment-specific data
Node.js + Express backend APIClaimed only
Backend API built using Node.js with Express to handle requests and communicate with AI models and databases
Claimed on readmehigh confidencePostgreSQL database for user/hike/park dataClaimed only
PostgreSQL database used for storing user data, hike details, and park-specific safety information
Claimed on readmehigh confidenceWeather API integrationClaimed only
Incorporated the Weather API to enhance app accuracy and data richness
Claimed on Devposthigh confidenceAzure cloud deploymentBlocked
Azure cloud services used to deploy and manage the backend API for scalability and reliability
Claimed on readmemedium confidenceFigma design prototypesBlocked
All design prototypes and user flows were created in Figma
Claimed on Devpostmedium confidence
An AI agent derived these features from the project’s Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.