Spring AI RAG system which answers user’s questions referring to the Kyrgyz traffic regulations.
Technologies used: ReactJs, Spring, GeminiAPI, PGSQL, PGVectorDB
For this project, I engineered a Retrieval-Augmented Generation (RAG) system using Spring AI to provide intelligent, context-aware answers regarding Kyrgyzstan’s traffic regulations.
The AI architecture consists of two main pillars:
Vector Embeddings & Semantic Search: I used the text-embedding-004 model to transform the official PDD regulatory PDF into high-dimensional vectors. These are stored in a PGSQL database with the pgvector extension, allowing the system to perform “semantic” lookups rather than simple keyword matches.
Generative Intelligence: When a user asks a question—the system retrieves the most relevant legal text chunks from the vector store. These chunks are fed into Google Gemini (2.0 Flash), which synthesizes a NL response grounded strictly in the provided legal context.