Documentation Index
Fetch the complete documentation index at: https://docs.privetag.com/llms.txt
Use this file to discover all available pages before exploring further.
Architecture
Understanding the technical architecture of PriveTag B2A Platform.
System Overview
Component Details
API Gateway
The entry point for all AI agent requests:
| Feature | Technology | Description |
|---|
| Load Balancing | AWS ALB | Distributes traffic across instances |
| SSL Termination | CloudFront | Handles HTTPS |
| Rate Limiting | Redis | Per-key rate limiting |
| Authentication | Custom | API key validation |
Recommendation Engine
Processes recommendation requests:
Key Technologies:
- Language: TypeScript (Node.js)
- ML Model: Custom scoring algorithm
- Cache: Redis for hot data
Booking Service
Handles booking creation and voucher delivery:
| Step | Description | SLA |
|---|
| Validation | Check availability | < 100ms |
| Reservation | Lock inventory | < 200ms |
| Payment | Process if required | < 2s |
| Voucher | Generate QR + PDF | < 500ms |
| Email | Send to user | < 30s |
Inventory Hub
Aggregates availability from multiple sources:
Inventory Priority:
- Direct venue partnerships (highest margin)
- Klook (good coverage, fast API)
- Viator (extensive catalog)
- GetYourGuide / KKday (backup)
Ground Truth Engine
Processes and stores verified visit data:
-- Ground Truth Schema
CREATE TABLE ground_truth (
id UUID PRIMARY KEY,
booking_id UUID REFERENCES bookings(id),
context_log_id UUID REFERENCES context_logs(id),
activity_id UUID REFERENCES activities(id),
verified_at TIMESTAMP NOT NULL,
verification_method VARCHAR(20),
user_profile JSONB,
created_at TIMESTAMP DEFAULT NOW()
);
-- Index for efficient lookups
CREATE INDEX idx_gt_profile ON ground_truth
USING GIN (user_profile);
Data Flow
Recommendation Flow
Booking Flow
Database Schema
Core Tables
Caching Strategy
Cache Layers
| Layer | TTL | Data |
|---|
| L1: Request | 1 min | API responses |
| L2: Context | 15 min | Weather, enrichment |
| L3: GT Aggregates | 1 hour | Ground truth scores |
| L4: Static | 24 hours | Activity metadata |
Cache Keys
# Context cache
context:{city}:{weather_hash} → enriched context
# Ground Truth aggregates
gt:{travel_type}:{city}:{category} → activity scores
# Inventory
inventory:{activity_id}:{date} → availability
Scalability
Horizontal Scaling
| Metric | Target | Current |
|---|
| API Latency (p50) | < 100ms | 85ms |
| API Latency (p99) | < 500ms | 350ms |
| Booking Success Rate | > 99% | 99.2% |
| Uptime | 99.9% | 99.95% |
| Ground Truth Rate | > 80% | 85% |
Security
API Security
- Authentication: API key in
x-api-key header
- Rate Limiting: Per-key limits
- IP Allowlisting: Optional for enterprise
- Encryption: TLS 1.3 for all connections
Data Security
- At Rest: AES-256 encryption
- In Transit: TLS 1.3
- PII Handling: Anonymization for ML
- Retention: Configurable per client
Monitoring
Key Metrics
Alerting
| Alert | Threshold | Action |
|---|
| Error Rate | > 1% | Page on-call |
| Latency p99 | > 1s | Investigate |
| Booking Failures | > 5/min | Escalate |
| Database CPU | > 80% | Scale up |
Next Steps
Quickstart
Get started with the API
API Reference
Explore endpoints