RAG Implementation Analysis: RoutaGo Chatbot
Group Name: CogentX
Members: Kaysean Miel, Vince Clark Lanticse, Mark Christian Garing,
Dwight Angelo Sabandal, Miguel Ray Veloso, Tovi Joshua Hermosisima
1. Chatbot Description
RoutaGo is an AI-powered route assistant chatbot developed by CogentX — a web-based
application built entirely with Streamlit, designed to help commuters in Cebu City navigate
the Public Utility Jeepney (PUJ) network.
Target Audience: Daily commuters in Cebu City, students, tourists, and anyone unfamiliar
with the local PUJ route system who need reliable navigation assistance via a web browser.
Core Functionality / Purpose: RoutaGo allows users to ask natural language questions such
as "Which jeepney goes from Talamban to Colon?" or "How much is the fare from Ayala to
Fuente Osmeña?" and receive accurate, grounded route guidance. The chatbot bridges the
gap between the complexity of the PUJ network and the everyday commuter who lacks access
to an organized, digital route reference.
Current Tech Stack:
• Frontend / UI: Streamlit (Python-based web framework)
• AI Model: Ollama — a locally-run open-source LLM runtime that serves models (e.g.,
LLaMA 3, Mistral) entirely on-device without external API calls
• Route Data: PUJ route information is hardcoded directly into the Python application as
structured data (dictionaries/lists), serving as the static knowledge base for the chatbot
• Integration Layer: Python logic within the Streamlit app that matches user queries
against the hardcoded route data and passes relevant context to the Ollama LLM
2. Verdict: RAG
After group discussion, CogentX has decided to implement RAG (Retrieval-Augmented
Generation) for the RoutaGo chatbot.
The team evaluated the chatbot's core function — answering specific, factual questions about
Cebu City's PUJ route network — and unanimously concluded that a bare LLM alone is
fundamentally unsuitable for this purpose. Ollama runs powerful open-source models locally,
but these models have no knowledge of Cebu's specific PUJ routes, stop names, or fare
structures in their training data. Implementing RAG allows RoutaGo to retrieve the correct
route entries from its hardcoded route dataset and inject them as context into the Ollama
prompt before generating a response, ensuring every answer is grounded in real, project-
defined data rather than model guesswork.
3. Justification
3.1 Hallucination Risk in the Transportation Domain
Hallucination — the tendency of LLMs to generate plausible-sounding but factually incorrect
information — is especially dangerous in a public transportation assistant. If RoutaGo were
to hallucinate a route number, stop name, or fare amount, a commuter could board the wrong
jeepney, miss a connection, or be stranded in an unfamiliar area. Ollama models like LLaMA 3
or Mistral are trained on general internet data and have no specific knowledge of Cebu's PUJ
network, making route-specific hallucinations near-certain without grounding. RAG
eliminates this by forcing the model to answer only from the injected route context.
3.2 Hardcoded Route Data as a Proprietary Knowledge Base
RoutaGo's route data — including route codes, stop sequences, and fare information — is
hardcoded directly into the application as Python data structures. This data is entirely
proprietary to the project and does not exist in any LLM's training corpus. RAG treats this
hardcoded dataset as the retrieval source: when a user asks a route question, the app
searches the hardcoded routes for relevant entries and passes them as context to Ollama.
This transforms static hardcoded data into a functional, query-driven knowledge base
without requiring a database or external API.
3.3 No External API or Database Costs
One of RoutaGo's key architectural decisions is running entirely locally — Ollama serves the
LLM on-device with no API fees, and route data is hardcoded with no database hosting costs.
RAG fits naturally into this zero-cost architecture: retrieval is done in pure Python by filtering
the hardcoded route structures, requiring no vector database, no cloud service, and no
additional infrastructure. This makes RAG not only technically appropriate but also
economically ideal for a student-developed project with no budget for external services.
3.4 Updatability and Maintainability
While the route data is currently hardcoded, RAG creates a clean separation between the
knowledge base and the LLM reasoning layer. When routes change or new ones are added,
only the hardcoded Python data structures need to be updated — the retrieval and prompt
injection logic remains unchanged. Without RAG, the model would need to be fine-tuned or
the prompt would need to contain the entire route dataset every time, which is inefficient and
costly in terms of context window usage. RAG keeps the system maintainable and token-
efficient.
4. Scenarios Where RAG Outperforms a Bare LLM
The following scenarios illustrate concrete cases where RAG significantly improves RoutaGo's
responses when using Ollama compared to querying the model without retrieval.
Scenario 1: Route Lookup by Origin and Destination
User Query: "What jeep do I take from Talamban to SM City Cebu?"
Bare Ollama LLM: Generates a plausible-sounding but hallucinated route number with no
basis in Cebu's actual PUJ network. The user has no way to verify this before boarding.
RAG with Ollama: The app searches the hardcoded route list for entries containing both
"Talamban" and "SM City" as stops, injects the matching route data into the Ollama prompt,
and the model responds with the correct route — grounded entirely in the application's own
data.
Scenario 2: Exact Fare Inquiry
User Query: "How much is the fare from Ayala Center to Colon Street?"
Bare Ollama LLM: Estimates based on general Philippine fare norms (e.g., "around ₱13–
₱15") without access to the actual fare for that specific route segment.
RAG with Ollama: Retrieves the hardcoded fare value for that origin-destination pair and
presents a precise figure, eliminating guesswork entirely.
Scenario 3: Multi-Route Transfer Planning
User Query: "I'm at USC Main. How do I get to Pier 1?"
Bare Ollama LLM: May hallucinate a direct route that does not exist or give generic advice
such as "take any jeepney going downtown."
RAG with Ollama: Retrieves all routes passing through USC Main and all routes reaching Pier
1 from the hardcoded dataset, identifies the transfer point (e.g., Carbon Market), and presents
a complete, accurate step-by-step transfer guide with estimated fares.
Scenario 4: Listing All Routes Through a Landmark
User Query: "What jeepney routes pass through Fuente Osmeña?"
Bare Ollama LLM: Unable to enumerate actual routes; may produce a fabricated list of route
numbers that do not correspond to real Cebu PUJ routes.
RAG with Ollama: Filters the hardcoded route data for all entries where "Fuente Osmeña"
appears as a stop and returns the complete, accurate list — something only possible because
the retrieval layer has access to the actual project data.
Document prepared by Group CogentX — RoutaGo AI Chatbot Midterm Activity