Best Stays Thailand
AI-powered accommodation platform with LLM integration
// Built with
01 Problem
An accommodation booking platform needed intelligent search and recommendation capabilities beyond traditional keyword matching. The platform required real-time AI-assisted interactions while maintaining strict budget controls and multi-provider flexibility.
02 Approach
Chose a Python/FastAPI backend over Go or Node.js because LangChain's Python ecosystem was the most mature for LLM orchestration at the time. SvelteKit was selected over Next.js for the frontend due to smaller bundle size and native SSR streaming support. Evaluated direct OpenAI API calls vs LangChain — chose LangChain for chain composition and provider abstraction, despite the added complexity. Used OpenRouter as an LLM proxy rather than direct provider APIs to enable budget controls and seamless model switching without code changes.
03 Solution
Rebuilt the platform from Next.js/Supabase (PRJ053) to a Go/SvelteKit stack with Claude Code CLI and SBX framework governance. Go API with Chi router, SvelteKit 2 frontend with Svelte 5, PostgreSQL 17 with pgvector for semantic search. AI-powered search and recommendation via LLM integration with budget controls and provider abstraction.
04 Outcomes
Qualitative
- AI-powered search and recommendations for accommodation listings
- Real-time streaming LLM responses via SSE
- Multi-provider flexibility with single integration point
- 3D property visualization in browser
05 Trade-offs
LangChain added significant abstraction overhead and made debugging harder — prompt traces were opaque compared to raw API calls. Accepted this for the flexibility of swapping between Claude, GPT-4, and Llama models without code changes. Clerk simplified auth but introduced a third-party dependency for a critical path. pgvector embedding search is powerful but requires careful index tuning — initial queries were slow until HNSW indexing was configured properly. Three.js for 3D property visualization was impressive but added ~200KB to the bundle for a feature most users may never interact with.
06 Constraints
- LLM response latency must be acceptable for interactive use
- Monthly AI budget capped at $200
- Must support multiple LLM providers via single interface
- Real-time streaming responses required
07 Innovation
Multi-provider LLM integration with budget controls, response caching, and semantic search via pgvector. Real-time streaming with SSE. Provider-agnostic architecture allows swapping between Claude, GPT-4, and other models without code changes.
Novelty: high08 Reflection
If starting today, I would skip LangChain entirely and use direct Anthropic/OpenAI SDK calls with a thin provider-abstraction layer. LangChain's value proposition has diminished as provider APIs matured. The OpenRouter proxy pattern, however, was a genuine win — it solved budget control and provider switching cleanly. The pgvector semantic search approach validated the idea that accommodation search benefits enormously from intent-based queries over keyword matching.

















