RAIN
← All projects
NNS KADA AI POWERED NAVAL ASSISTANT
AIML · AIML COHORT 18

NNS KADA AI POWERED NAVAL ASSISTANT

Published 20 May 2026 · 116 views

FastAPIChromaDBOllama (nomic-embed-text)Llama 3.2 via Ollama (primary) + Groq API (fallback)MySQLJinja2 templates with vanilla JS
Ikechukwu Christian OlehRAIN trainee

About the project

```python @app.get("/dashboard", response_class=HTMLResponse) async def dashboard(request: Request): user = get_current_user(request) if not user: return RedirectResponse(url="/login", status_code=302) # Extract display name (last name from full_name) full_name = get_user_full_name(user) if full_name: parts = full_name.strip().split() display_name = parts[-1] if parts else user else: display_name = user return render(request, "dashboard.html", { "username": user, "display_name": display_name, }) # ===================================================================== # KNOWLEDGE BROWSER # ===================================================================== @app.get("/knowledge", response_class=HTMLResponse) async def knowledge_browser(request: Request): user = get_current_user(request) if not user: return RedirectResponse(url="/login", status_code=302) tree = get_knowledge_tree() return render(request, "knowledge.html", { "username": user, "tree": tree, }) @app.get("/knowledge/system/{system_id}", response_class=HTMLResponse) async def system_detail(request: Request, system_id: int): user = get_current_user(request) if not user: return RedirectResponse(url="/login", status_code=302) system = get_system(system_id) if not system: raise HTTPException(status_code=404, detail="System not found") subsystems = get_subsystems(system_id) for sub in subsystems: sub['components'] = get_components(sub['id']) procedures = get_procedures(system_id=system_id) faults_list = get_faults() # All faults for now return render(request, "knowledge.html", { "username": user, "tree": get_knowledge_tree(), "selected_system": system, "subsystems": subsystems, "procedures": procedures, "faults": faults_list, }) @app.post("/api/search-knowledge") async def api_search_knowledge(request: Request): user = get_current_user(request) if not user: return JSONResponse({"error": "Not authenticated"}, status_code=401) data = await request.json() query = sanitize_input(data.get("query", "")) if not query: return JSONResponse({"error": "No query provided"}, status_code=400) results = search_knowledge(query) return JSONResponse(results) ``` A few weeks ago, I set out to solve a problem that has quietly plagued naval operations for years — and I built something I'm genuinely proud of. *Introducing NNS KADA: An AI-Powered Naval Technical Assistant for the Nigerian Navy.* --- Here's the honest backstory. Naval officers on board a ship don't have the luxury of time. When something goes wrong — an engine fault, an electrical failure, a safety-critical procedure that needs to be executed immediately — the last thing anyone should be doing is flipping through hundreds of pages of technical manuals, cross-referencing documents scattered across different formats and locations, or waiting for someone with institutional knowledge to become available. That was the reality I wanted to change. --- *THE PROBLEM* Ship manuals are the lifeblood of naval operations. But in practice, they're: - Fragmented across multiple formats — PDFs, Word documents, spreadsheets - Too voluminous to comprehensively review within operational timeframes - Dependent on individual officers who carry critical knowledge in their heads — knowledge that walks off the ship during crew rotations The cost of this inefficiency isn't just inconvenience. Delays in accessing critical technical information can escalate equipment failures into safety incidents, compromise compliance readiness, and increase cognitive load during high-pressure situations. --- *THE SOLUTION I BUILT* I designed and developed a full-stack AI chatbot system that transforms ship manuals into a living, queryable knowledge base — one that any officer can ask a question in plain language and get a precise, accurate answer in seconds. Under the hood, the system uses a *Retrieval-Augmented Generation (RAG)* architecture: 🔹 Ship manuals (PDFs, DOCX, XLSX) are uploaded through an admin portal and automatically parsed, chunked, and embedded into a *ChromaDB vector store* using *Ollama's nomic-embed-text* embedding model — all running locally on the ship's hardware, with no data ever leaving the vessel. 🔹 When an officer asks a question, the system performs *semantic search* — not keyword matching — to retrieve the most relevant passages from across all uploaded manuals, ranked by cosine similarity. 🔹 The retrieved context is passed to a *large language model* — *Llama 3.2 via Ollama* as the primary engine (fully offline capable), with *Groq's LLM API* as an intelligent cloud fallback — which generates a natural, conversational response grounded entirely in the ship's own documentation. 🔹 The interface streams responses in real time with *markdown rendering*, so answers that include procedures, tables, or technical specifications display cleanly and readably — not as a wall of text. --- *WHAT MAKES THIS DIFFERENT FROM JUST SEARCHING A DOCUMENT?* A keyword search tells you which document to look in. This system reads the documents, understands the context of your question, and tells you the answer — with sources cited automatically. An officer asking "What is the starting procedure for the LST100?" doesn't get a list of documents to go read. They get the steps, in order, drawn from the exact manual that covers it. WHAT'S NEXT? This is Phase 1. The roadmap includes: → *Predictive Compliance* — proactively flagging expiring certificates and upcoming regulatory requirements before they become problems → *Real-Time Sensor Integration* — connecting the chatbot to onboard sensors for context-aware diagnostics ("the engine temperature is reading X, here's what the manual says to do") → *Autonomous Maintenance Scheduling* — agentic workflows that don't just answer questions but take action --- This project reminded me that the most impactful technology isn't always the most complex — sometimes it's just putting the right information in front of the right person at the right moment. *#RAIN#ArtificialIntelligence #NavalTechnology #RAG #LLM #Python #FastAPI #NigerianNavy #MaritimeTech #GenerativeAI #MachineLearning #SoftwareEngineering #Innovation #DefenceTech*

More from RAIN trainees

Build something like this at RAIN.

12-month AIML and RDA programmes, 70% product development.