Build a RAG-Based AI Assistant in Kotlin with a Vector Database A developer demonstrates how to build a Retrieval-Augmented Generation (RAG) based AI assistant in Kotlin, using a vector database to enhance LLM responses with private or frequently changing documents. The tutorial outlines the architecture, including document chunking, embeddings, vector search, and a clean Android UI with ViewModel and Repository patterns. It emphasizes keeping the vector database and LLM on the backend and returning sources for verification. A normal LLM answers questions from information contained in its model. A Retrieval-Augmented Generation RAG system adds an external knowledge layer so an application can answer questions using private or frequently changing documents. In this tutorial, we will build the architecture for a Kotlin client that communicates with a backend RAG service. Suppose an application contains company documentation. Instead of sending the entire documentation to an LLM for every question, the system can: Documents ↓ Chunking ↓ Embeddings ↓ Vector Database At query time: User Question ↓ Embedding ↓ Vector Search ↓ Relevant Chunks ↓ LLM ↓ Answer A clean Android architecture can look like: Compose UI | ViewModel | RagRepository | API Client | RAG Backend The vector database and LLM should normally remain on the backend rather than being exposed directly to the mobile application. Define a request: data class AskRequest val question: String, val conversationId: String? And a response: data class AskResponse val answer: String, val sources: List