Primary bounded context
Discovery
The search core
- Query classifier picks the lane.
- Intent parser (Claude) for NL queries.
- Search index in Postgres + hybrid ranker.
Case study: systems architecture
Conversational discovery with explicit routing, predictable AI unit economics, and latency targets suitable for high-volume production traffic.

Executive summary
We delivered a multi-tenant restaurant discovery microservice that resolves natural-language queries (for example, “cozy Italian place for date night”) while keeping the majority of requests on a sub-100ms pathshipped. The architecture caps model spend at roughly $0.001 per AI-assisted query on averagetarget, combines Redis caching with deterministic lane selection, and ships with the metrics, logging, and guardrails operators expect in production.
Service commitments
<100msshipped
Search SLA
~80% of queriestarget hit the fast lane
~$0.001target
Avg. cost / AI search
Budgeted hybrid retrieval
Multi-tenant
Postgres RLS
Isolated rows per tenant
Observable
Production-ready
Metrics, logs, safe limits
Each query is classified before any paid inference: deterministic paths carry the bulk of volume; models run only when phrasing requires interpretation; a short-TTL cache reduces repeat load on the database and providers.
Simple intents, zero AI spend.
$0 marginal cost per queryshipped
Complex intent → structured retrieval.
~$0.001 per search (budgeted)target
Repeat demand disappears at the edge.
Technical stack
Backend
Data
Cache & realtime
AI services
Bounded contexts
Five bounded contexts share a small kernel so search behavior can evolve without coupling unrelated concerns or destabilizing shared infrastructure.
Primary bounded context
The search core
Engineering patterns
Configuration per brand
Fresh vectors & listings
Smart filter chips
Live venue status
Shared kernel
If you are evaluating search, ranking, or multi-tenant isolation under cost and latency constraints, we can walk through a comparable architecture and delivery approach on a short call.