BACK TO PORTFOLIO REGISTRY
Private Architecture
May 20251 week

Venue Discovery Chatbot with AWS Bedrock

Cloud/AI EngineerEngineering Dossier

Achievement Log

2025-04 Week 1: Built 50-query test set. Evaluated Claude v2 vs Instant vs Titan — v2 at 90% selected. Resolved markdown fence injection (30% of responses) with dual-layer defense. 2025-04 Week 2: Built two-Lambda architecture, 100+ tag taxonomy, jsonschema validation, geographic module (678 entries). Fixed Turkish casefold issue in difflib. Cold start problem (1.8s) — provisioned concurrency dropped latency to 380ms. 2025-04 Week 3: Selective schema injection (35% token reduction), Redis caching, CloudWatch drift alarm, DLQ retry Lambda. Integrated with venue SQL backend — zero text manipulation needed. 2025-05 Week 1: 5-day production pilot, 200 queries, 90% accuracy confirmed. Fixed geographic district false-rejects (81 → 678 entries). Fixed API Gateway timeout masking. A/B test: 30% higher engagement vs filter form. Delivered to client.

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

Amazon Bedrock & Claude v2AWS Lambda & API GatewayPython & JSON SchemaCloudWatch & Lambda DLQTurkish Language Normalization Module

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.