Venue Discovery Chatbot with AWS Bedrock
Achievement Log
Overview
Turkish natural language chatbot for a venue booking platform that extracts structured search parameters (location, amenity tags, guest capacity) from free-text queries using Claude v2 via Amazon Bedrock. Achieved 90% parameter extraction accuracy and reduced downstream parsing errors from 20% to under 1% through schema-strict JSON output. Users showed 30% higher venue discovery engagement vs the traditional filter form in A/B testing.
Core Technologies
Implementation & Architecture
Serverless AI Extraction Pipeline
ConstraintPromptBuilder assembles three sections: task instruction ('respond ONLY with valid JSON'), schema definition block, and 5 Turkish few-shot examples. Bedrock client initialized outside the Lambda handler for warm-invocation reuse (saves 120ms). JSON post-processor validates against jsonschema, applies enum normalization, and performs geographic lookup — all under 15ms. Provisioned concurrency eliminates cold starts for the first 3 concurrent users.
Amenity Tag Taxonomy & Data Validation Layer
100+ venue amenity tags across 8 categories (capacity, outdoor, indoor, catering, parking, accessibility, accommodation, event_type). Tags validated via exact match then difflib fuzzy match (cutoff 0.75). Contradictory tag combinations (e.g., 'bahce' AND 'kapali_mekan') set a clarification flag. Guest capacity range support (e.g., '200-300 kisi') parsed into min/max fields for SQL range queries.
Technical Skills
- Amazon Bedrock
- LLM Integration
- Prompt Engineering
- AWS API Gateway
- Python
- JSON Schema
Engineering Challenges
- →Claude v2 Markdown Fence Injection — 30% of responses wrapped JSON in markdown fences, crashing json.loads. Fixed with strengthened 'no markdown' prompt instruction + regex stripping safety net.
- →Turkish Locale Case Sensitivity in Tag Matching — difflib SequenceMatcher penalized case differences more heavily with multi-byte Turkish characters (ratio 0.71, below 0.75 threshold). Fixed by using str.casefold() before comparison.
- →Lambda Cold Start Unacceptable for Chat UX — Python + Boto3 initialization added 1.8s cold start. Fixed with provisioned concurrency of 3 warm instances — median latency dropped to 380ms.
- →Hallucinated Amenity Tags Outside Taxonomy — Claude generated plausible but non-existent tags. Fixed by injecting the full canonical tag list in the prompt and adding post-extraction difflib normalization.
- →API Gateway Timeout Masking Lambda Errors — Two-Lambda chain occasionally exceeded 28 seconds under Bedrock load, causing Gateway 504s before Lambda could respond. Fixed by adding partial-result early-exit at 20 seconds with partial_result=true flag.
- →Geographic Validation False Rejects on Districts — Database only covered 81 cities, rejecting valid district names like 'Beşiktaş' or 'Kadıköy'. Fixed by expanding to 678 entries covering all cities and major districts.
Project Outcomes
- ✓90% parameter extraction accuracy on 200 production Turkish queries — direct SQL backend integration with zero text cleanup.
- ✓Downstream parsing errors reduced from 20% (regex narrative parsing) to under 1% via Constraint Prompt engineering.
- ✓30% higher venue discovery engagement via chatbot vs traditional filter form in A/B testing.
- ✓Provisioned concurrency of 3 instances costs ~$4/month vs $35/month for equivalent always-on EC2.
- ✓380ms median end-to-end latency (API Gateway → Bedrock → response) — within the <500ms chat UX requirement.
- ✓35% per-query Bedrock cost reduction through selective schema injection and long-query summarization.