> Markdown version of [/videos/1989-tomb-raider-ai-search-with-kotlin](https://www.wearedevelopers.com/videos/1989-tomb-raider-ai-search-with-kotlin). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Tomb rAIder: AI Search with Kotlin Pure vector search fails at hard constraints like strict price limits. Master a hybrid AI search pipeline in Kotlin to deliver highly accurate query results. - **Speakers:** [Dmytro Kurets](https://www.wearedevelopers.com/@dmytro-kurets) - **Event:** World Congress 2026 Europe - Virtual Stage - **Published:** July 2, 2026 - **Duration:** 36:59 - **URL:** https://www.wearedevelopers.com/videos/1989-tomb-raider-ai-search-with-kotlin ## Summary Relying purely on vector search for complex user queries often leads to inaccurate results, as single-embedding architectures struggle to enforce hard constraints like strict price ceilings or specific required metadata. To build a reliable search experience, developers must adopt a hybrid "filter before you vector" methodology. This approach decomposes natural language queries, separating strict requirements from fuzzy intent so they can be processed by the appropriate retrieval mechanisms. Implementing this strategy in Kotlin utilizing Spring Boot and PostgreSQL with the pgvector extension requires a modular extraction pipeline. Instead of defaulting to a single large language model for all tasks, developers should route different query components to specialized tools. The Meta-backed Duckling library effortlessly handles precise numerical constraints like price extraction, while the Deep Java Library (DJL) can run an in-process all-MiniLM model for localized n-gram amenity matching. The remaining ambiguous text, defined as the residual intent, is then parsed by an LLM like Qwen-2.5 and matched against BGE-small database embeddings for semantic similarity scoring. Designing the architecture with one focused extractor per field ensures system modularity and simplifies testing environments. Because these extractors handle distinct data points independently, running them concurrently leverages Kotlin's asynchronous capabilities, effectively granting the system latency for free. Ultimately, combining strict SQL filtering for extracted parameters with targeted vector retrieval for fuzzy intent yields a highly accurate, easily testable search pipeline that respects both real-world constraints and complex user goals. **Keywords:** hybrid vector search architecture, postgresql pgvector extension, query decomposition strategies, hard constraint sql filtering, residual intent extraction, llm-based result evaluation, duckling library entity extraction, deep java library in-process models, spring ai framework integration, kotlin asynchronous extractors, semantic similarity retrieval, local llm serving lm studio, n-gram sliding window matching ## Chapters 1. **Introduction to practical AI search constraints** (00:02) — Local embeddings and Kotlin enable building computationally grounded and realistic constrained searches. 1. **Selecting tools for a local AI search system** (01:00) — Spring Boot, pgvector, and local LLMs provide a robust foundation for building data retrieval applications. 1. **Calculating and storing embeddings in PostgreSQL** (02:02) — Textual metadata converts into high-dimensional vectors stored in a database for fast proximity scanning. 1. **Evaluating the limitations of pure semantic search** (04:43) — Single-vector semantic matching fails to reliably honor strict numeric and boolean boundaries. 1. **Applying hard constraints with SQL filters** (10:54) — Combining relational filters for exact bounds alongside vector distance queries limits errors and improves overall relevance. 1. **Decomposing search intents with LLM prompts** (13:52) — Generative models can decompose complex raw queries into explicit filter parameters and vague text intents. 1. **Replacing LLMs with specialized data extractors** (17:48) — Domain-specific parsing utilities extract values like precise pricing and amenity inclusions more efficiently than large general language models. 1. **Running asynchronous query extraction and intent processing** (24:31) — Concurrent execution of independent domain extractors securely isolates the remaining unstructured fuzzy intentions without creating performance bottlenecks. 1. **Implementing custom search logic with Spring AI** (29:47) — Spring AI libraries seamlessly compile embedding API requests dynamically into backend relational database retrieval commands. 1. **Demonstrating the completed multi-step search engine** (32:25) — A layered search architecture balances explicitly strict requirements with fuzzy phrase semantics to provide highly accurate user responses. 1. **Core principles for robust AI search systems** (35:44) — Applying traditional relational datasets filters prior to probabilistic comparisons is essential for high-fidelity scalable operations. ## Related Moments - [Designing highly scalable hybrid AI search engines](https://www.wearedevelopers.com/videos/436-hybrid-ai-next-generation-natural-language-processing) (from "Hybrid AI: Next Generation Natural Language Processing") - [Demonstrating semantic latency reductions using Spring AI configurations](https://www.wearedevelopers.com/videos/1714-reducing-llm-calls-with-vector-search-patterns-raphael-de-lio-redis) (from "Reducing LLM Calls with Vector Search Patterns - Raphael De Lio (Redis)") - [Revolutionizing database search queries with language models](https://www.wearedevelopers.com/videos/2088-plan-to-link-your-llm-to-your-production-database-what-could-possibly-go-wrong) (from "Plan to link your LLM to your production database? What could possibly go wrong?") - [Substituting traditional classification models with search-based AI architecture](https://www.wearedevelopers.com/videos/830-what-comes-after-chatgpt-vector-databases-the-simple-and-powerful-future-of-ml) (from "What comes after ChatGPT? Vector Databases - the Simple and powerful future of ML?") - [Postgres migration performance results and future semantic search](https://www.wearedevelopers.com/videos/1647-optimizing-discovery-postgresql-s-role-in-transforming-getyourguide-s-search) (from "Optimizing Discovery: PostgreSQL's Role in Transforming GetYourGuide's Search") - [Differentiating AI search layers from standard LLMs](https://www.wearedevelopers.com/videos/100133-ai-search-insights-from-otterlyai-what-we-tested-what-failed-and-what-actually-works) (from "AI Search Insights from OtterlyAI: What We Tested, What Failed, and What Actually Works") ## Related Articles - [SEO in an AI world - Google vs. ChatGPT and survival tips for content creators](https://www.wearedevelopers.com/magazine/534-seo-in-an-ai-world-google-vs-chatgpt-and-survival-tips-for-content-creators) - [MLOps And AI Driven Development](https://www.wearedevelopers.com/magazine/82-mlops-and-ai-driven-development) - [Graph and AI Trends 2026: Why Is AI Running but Not Yet Delivering?](https://www.wearedevelopers.com/magazine/680-graph-and-ai-trends-2026-why-is-ai-running-but-not-yet-delivering) - [Dev Digest 132 - Binging WADFlix?](https://www.wearedevelopers.com/magazine/473-dev-digest-132-binging-wadflix) ## Related Jobs - [Principal Engineer - AI Search & Vector Infrastructure](https://www.wearedevelopers.com/jobs/ext/319507-principal-engineer-ai-search-vector-infrastructure) at **Redis** - [Principal Engineer - AI Search & Vector Infrastructure](https://www.wearedevelopers.com/jobs/ext/353953-principal-engineer-ai-search-vector-infrastructure) at **Redis** - [Principal Engineer - AI Search & Vector Infrastructure](https://www.wearedevelopers.com/jobs/ext/381484-principal-engineer-ai-search-vector-infrastructure) at **Redis** - [AI Software Engineer (Germany)](https://www.wearedevelopers.com/jobs/48317-ai-software-engineer-germany) at **Sunhat** - [Senior AI Agent Software Engineer (Go, Python) (m/f/x)](https://www.wearedevelopers.com/jobs/48277-senior-ai-agent-software-engineer-go-python-m-f-x) at **Dynatrace** - [AI Operations Manager (all genders)](https://www.wearedevelopers.com/jobs/48263-ai-operations-manager-all-genders) at **envelio**