Autonomous Errand and Urban Navigation Dispatcher Powered by Google Gemini and Google Maps Platform.
RoutePilot is an autonomous operations agent engineered to resolve complex, multi-constraint urban itineraries. While conventional navigation platforms operate strictly point-to-point, RoutePilot addresses real-world logistical planning: multi-stop errands characterized by strict time windows, financial budgets, business opening hours, prioritized stops, and mid-mission disruptions.
By combining the reasoning and structured tool-calling capabilities of the Google Gemini model family with real-time geospatial grounding from the Google Maps Platform (Places API, Routes API, Geocoding API), RoutePilot translates unstructured natural language objectives into verified, topologically sequenced 3D spatial missions.
- Translates ambiguous, high-level natural language prompts (e.g., "I have 3 hours and a 5,000 LKR budget, need to visit a bank in Nugegoda, pick up electronics, and grab lunch") into deterministic execution plans.
- Identifies explicit and implicit constraints: total mission duration, opening hours, dwell time per stop, financial budget ceilings, and return-to-origin requirements.
- Real-time verification of physical business existence, precise latitude/longitude coordinates, formatted addresses, and operational hours using Google Maps Platform Places and Geocoding APIs.
- Calculation of transit durations, distances, and traffic considerations across multi-waypoint topologies.
- Formulates and solves the underlying Traveling Salesperson Problem with Time Windows (TSPTW).
- Prioritizes high-urgency stops (e.g., banking deadlines) and balances dwell times against transit buffers to guarantee arrival within designated schedules.
- Real-time telemetry monitoring supporting mid-mission adaptation.
- Dynamically replans remaining legs when users encounter closed facilities, unexpected delays, or altered preferences without restarting the workflow.
- 3D perspective camera angles with interactive tilt, bearing adjustment, and automated route fly-through animations.
- Synchronized HUD telemetry displaying total transit distance, elapsed time, cumulative budget utilization, and stop-by-stop validation cards.
- High-density tactical cartography engine with native fallback capabilities.
The application is architected as a decoupled full-stack system with strict separation between client presentation, agent orchestration, and external API gateways.
+-----------------------------------------------------------------------+
| Client Interface |
| (React 18 + TypeScript + Tailwind CSS + Vite) |
| |
| [ Natural Language HUD ] [ 3D Tactical Map ] [ Telemetry Rails ] |
+-----------------------------------+-----------------------------------+
|
HTTP / REST APIs
|
+-----------------------------------v-----------------------------------+
| Serverless / Express API |
| (Node.js Runtime) |
| |
| +-----------------------------------------------------------------+ |
| | RoutePilot Agent Loop | |
| | Perceive -> Decompose -> Tool Call -> Optimize -> Formulate | |
| +-----------------------------------------------------------------+ |
| | |
| +--------------------------+--------------------------+ |
| | | |
| +-----v----------------+ +------v-----+ |
| | Google Gemini API | | Google Maps| |
| | Structured Outputs | | Platform | |
| +----------------------+ +------------+ |
+-----------------------------------------------------------------------+
- AI & Language Models: Google Gemini 2.5 Flash / Gemini Pro via
@google/genaiTypeScript SDK - Geospatial & Mapping: Google Maps Platform (JavaScript API, Places API New, Routes API, Geocoding)
- Frontend Framework: React 18, TypeScript, Tailwind CSS, Motion
- Backend Runtime: Node.js, Express, tsx, esbuild
- Deployment Targets: Google Cloud Run, Vercel Serverless Functions, Docker
- Node.js version 18.0.0 or higher
- npm version 9.0.0 or higher
- Google Gemini API Key
- (Optional) Google Maps Platform API Key
-
Clone the repository:
git clone https://github.com/dinitheth/RoutePilot.git cd RoutePilot -
Install dependencies:
npm install
-
Configure environment variables: Create a
.envfile in the root directory based on.env.example:GEMINI_API_KEY=your_gemini_api_key_here VITE_GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
-
Start the local development server:
npm run dev
-
Open your browser and navigate to:
http://localhost:3000
Compile the static assets and bundle the server:
npm run build
npm startThis project includes native Vercel configuration (vercel.json and /api/index.ts):
- Push your repository to GitHub.
- Import the project into Vercel.
- Configure the
GEMINI_API_KEYandVITE_GOOGLE_MAPS_API_KEYin Project Settings. - Deploy using standard Vite preset settings.
POST /api/plan-mission
- Payload:
{ "userPrompt": string, "origin": { "lat": number, "lng": number, "name": string }, "constraints": object } - Response: Full mission specification with validated waypoints, polyline routes, cost estimates, and risk telemetry.
POST /api/replan-mission
- Payload:
{ "missionId": string, "currentStopIndex": number, "reason": string } - Response: Updated itinerary reflecting bypassed or adjusted nodes.
GET /api/health
- Response: Status of the server runtime, Gemini integration, and storage services.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
