@adminide-stack/yantra-help-browser 12.0.16-alpha.26 → 12.0.16-alpha.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/lib/components/HelpCenterFooter.d.ts.map +1 -1
  2. package/lib/components/HelpCenterFooter.js +43 -88
  3. package/lib/components/HelpCenterFooter.js.map +1 -1
  4. package/lib/components/HelpCenterHeader.d.ts.map +1 -1
  5. package/lib/components/HelpCenterHeader.js +3 -8
  6. package/lib/components/HelpCenterHeader.js.map +1 -1
  7. package/lib/components/Icons.d.ts +55 -0
  8. package/lib/components/Icons.d.ts.map +1 -0
  9. package/lib/{pages/LandingPage/components → components}/Icons.js +39 -2
  10. package/lib/components/Icons.js.map +1 -0
  11. package/lib/components/Logo.d.ts +1 -2
  12. package/lib/components/Logo.d.ts.map +1 -1
  13. package/lib/components/Logo.js +6 -18
  14. package/lib/components/Logo.js.map +1 -1
  15. package/lib/components/PageHero.d.ts +9 -0
  16. package/lib/components/PageHero.d.ts.map +1 -0
  17. package/lib/components/PageHero.js +47 -0
  18. package/lib/components/PageHero.js.map +1 -0
  19. package/lib/components/SearchBar.d.ts.map +1 -1
  20. package/lib/components/SearchBar.js +9 -45
  21. package/lib/components/SearchBar.js.map +1 -1
  22. package/lib/components/SidebarSearch.js +2 -2
  23. package/lib/components/SidebarSearch.js.map +1 -1
  24. package/lib/components/navbar/index.d.ts.map +1 -1
  25. package/lib/components/navbar/index.js +10 -25
  26. package/lib/components/navbar/index.js.map +1 -1
  27. package/lib/compute.d.ts +15 -0
  28. package/lib/compute.d.ts.map +1 -1
  29. package/lib/compute.js +74 -2
  30. package/lib/compute.js.map +1 -1
  31. package/lib/pages/About/index.d.ts +3 -0
  32. package/lib/pages/About/index.d.ts.map +1 -0
  33. package/lib/pages/About/index.js +69 -0
  34. package/lib/pages/About/index.js.map +1 -0
  35. package/lib/pages/Careers/index.d.ts +3 -0
  36. package/lib/pages/Careers/index.d.ts.map +1 -0
  37. package/lib/pages/Careers/index.js +78 -0
  38. package/lib/pages/Careers/index.js.map +1 -0
  39. package/lib/pages/CategoryCollection/index.d.ts.map +1 -1
  40. package/lib/pages/CategoryCollection/index.js +15 -78
  41. package/lib/pages/CategoryCollection/index.js.map +1 -1
  42. package/lib/pages/Community/index.d.ts +3 -0
  43. package/lib/pages/Community/index.d.ts.map +1 -0
  44. package/lib/pages/Community/index.js +72 -0
  45. package/lib/pages/Community/index.js.map +1 -0
  46. package/lib/pages/Contact/index.d.ts +3 -0
  47. package/lib/pages/Contact/index.d.ts.map +1 -0
  48. package/lib/pages/Contact/index.js +128 -0
  49. package/lib/pages/Contact/index.js.map +1 -0
  50. package/lib/pages/GetStarted/components/ExampleCard.d.ts.map +1 -1
  51. package/lib/pages/GetStarted/index.d.ts.map +1 -1
  52. package/lib/pages/GetStarted/index.js +9 -45
  53. package/lib/pages/GetStarted/index.js.map +1 -1
  54. package/lib/pages/HelpCenter/components/HelpCategoryCard.d.ts.map +1 -1
  55. package/lib/pages/HelpCenter/components/HelpCategoryCard.js +7 -34
  56. package/lib/pages/HelpCenter/components/HelpCategoryCard.js.map +1 -1
  57. package/lib/pages/HelpCenter/components/PopularArticle.d.ts.map +1 -1
  58. package/lib/pages/HelpCenter/components/PopularArticle.js +3 -12
  59. package/lib/pages/HelpCenter/components/PopularArticle.js.map +1 -1
  60. package/lib/pages/HelpCenter/index.d.ts.map +1 -1
  61. package/lib/pages/HelpCenter/index.js +15 -74
  62. package/lib/pages/HelpCenter/index.js.map +1 -1
  63. package/lib/pages/LandingPage/components/ArticleCard.d.ts.map +1 -1
  64. package/lib/pages/LandingPage/components/ArticleCard.js +3 -12
  65. package/lib/pages/LandingPage/components/ArticleCard.js.map +1 -1
  66. package/lib/pages/LandingPage/components/CategoryCard.d.ts.map +1 -1
  67. package/lib/pages/LandingPage/components/CategoryCard.js +3 -12
  68. package/lib/pages/LandingPage/components/CategoryCard.js.map +1 -1
  69. package/lib/pages/LandingPage/components/HeroSection.d.ts.map +1 -1
  70. package/lib/pages/LandingPage/components/HeroSection.js +3 -8
  71. package/lib/pages/LandingPage/components/HeroSection.js.map +1 -1
  72. package/lib/pages/LandingPage/components/ResourceCard.d.ts.map +1 -1
  73. package/lib/pages/LandingPage/components/ResourceCard.js +3 -12
  74. package/lib/pages/LandingPage/components/ResourceCard.js.map +1 -1
  75. package/lib/pages/LandingPage/index.d.ts.map +1 -1
  76. package/lib/pages/LandingPage/index.js +62 -33
  77. package/lib/pages/LandingPage/index.js.map +1 -1
  78. package/lib/pages/Markdown/MarkdownPageLayout.d.ts.map +1 -1
  79. package/lib/pages/Markdown/MarkdownPageLayout.js +11 -56
  80. package/lib/pages/Markdown/MarkdownPageLayout.js.map +1 -1
  81. package/lib/pages/Privacy/index.d.ts +3 -0
  82. package/lib/pages/Privacy/index.d.ts.map +1 -0
  83. package/lib/pages/Privacy/index.js +60 -0
  84. package/lib/pages/Privacy/index.js.map +1 -0
  85. package/lib/pages/ReleaseNotes/index.d.ts +3 -0
  86. package/lib/pages/ReleaseNotes/index.d.ts.map +1 -0
  87. package/lib/pages/ReleaseNotes/index.js +61 -0
  88. package/lib/pages/ReleaseNotes/index.js.map +1 -0
  89. package/lib/pages/StatusPage/index.d.ts +3 -0
  90. package/lib/pages/StatusPage/index.d.ts.map +1 -0
  91. package/lib/pages/StatusPage/index.js +85 -0
  92. package/lib/pages/StatusPage/index.js.map +1 -0
  93. package/lib/pages/Terms/index.d.ts +3 -0
  94. package/lib/pages/Terms/index.d.ts.map +1 -0
  95. package/lib/pages/Terms/index.js +60 -0
  96. package/lib/pages/Terms/index.js.map +1 -0
  97. package/lib/routes.json +88 -0
  98. package/lib/templates/content/account-management/account-setup.md +56 -57
  99. package/lib/templates/content/account-management/delete-account.md +55 -58
  100. package/lib/templates/content/account-management/preferences.md +70 -55
  101. package/lib/templates/content/account-management/privacy-settings.md +67 -56
  102. package/lib/templates/content/account-management/profile-settings.md +56 -45
  103. package/lib/templates/content/data-privacy/data-collection.md +55 -51
  104. package/lib/templates/content/data-privacy/privacy-policy.md +74 -57
  105. package/lib/templates/content/data-subject-privacy/data-access.md +59 -69
  106. package/lib/templates/content/data-subject-privacy/data-portability.md +67 -93
  107. package/lib/templates/content/data-subject-privacy/privacy-requests.md +66 -62
  108. package/lib/templates/content/file-uploads/file-upload-overview.md +69 -50
  109. package/lib/templates/content/getting-started/getting-started-guide.md +65 -51
  110. package/lib/templates/content/product-features/ai-models.md +62 -57
  111. package/lib/templates/content/product-features/collaboration-tools.md +66 -45
  112. package/lib/templates/content/product-features/conversation-features.md +59 -34
  113. package/lib/templates/content/product-features/export-features.md +65 -45
  114. package/lib/templates/content/product-features/follow-up-questions.md +61 -46
  115. package/lib/templates/content/product-features/real-time-search.md +63 -46
  116. package/lib/templates/content/product-features/saved-searches.md +53 -45
  117. package/lib/templates/content/product-features/search-features.md +61 -43
  118. package/lib/templates/content/product-features/search-history.md +64 -45
  119. package/lib/templates/content/product-features/source-citations.md +77 -44
  120. package/lib/templates/content/scope-api/api-overview.md +83 -46
  121. package/lib/templates/content/search-modes/deep-research.md +87 -46
  122. package/lib/templates/content/search-modes/labs-features.md +54 -56
  123. package/lib/templates/content/search-modes/pro-search.md +53 -45
  124. package/lib/templates/content/search-modes/regular-search.md +64 -46
  125. package/lib/templates/content/spaces-library/spaces-overview.md +68 -47
  126. package/lib/templates/content/student-hub/academic-research.md +85 -48
  127. package/lib/templates/content/student-hub/student-discounts.md +51 -57
  128. package/lib/templates/content/student-hub/student-overview.md +64 -45
  129. package/lib/templates/content/student-hub/study-tools.md +99 -45
  130. package/lib/templates/content/subscription-billing/billing-cycle.md +50 -48
  131. package/lib/templates/content/subscription-billing/billing-overview.md +55 -34
  132. package/lib/templates/content/subscription-billing/billing-support.md +52 -45
  133. package/lib/templates/content/subscription-billing/currency-support.md +36 -62
  134. package/lib/templates/content/subscription-billing/enterprise-pricing.md +52 -46
  135. package/lib/templates/content/subscription-billing/invoice-management.md +64 -45
  136. package/lib/templates/content/subscription-billing/payment-methods.md +53 -52
  137. package/lib/templates/content/subscription-billing/promotional-offers.md +58 -46
  138. package/lib/templates/content/subscription-billing/refund-policy.md +53 -58
  139. package/lib/templates/content/subscription-billing/student-discounts.md +61 -57
  140. package/lib/templates/content/subscription-billing/tax-information.md +64 -45
  141. package/lib/templates/content/technical-questions/ai-models-technical.md +60 -56
  142. package/lib/templates/content/technical-questions/api-technical.md +131 -56
  143. package/lib/templates/content/technical-questions/data-processing.md +74 -55
  144. package/lib/templates/content/technical-questions/database-architecture.md +91 -54
  145. package/lib/templates/content/technical-questions/infrastructure.md +104 -55
  146. package/lib/templates/content/technical-questions/performance-optimization.md +77 -55
  147. package/lib/templates/content/technical-questions/search-algorithms.md +78 -56
  148. package/lib/templates/content/technical-questions/technical-overview.md +76 -52
  149. package/lib/templates/content/threads/conversation-management.md +81 -45
  150. package/lib/templates/content/threads/threads-overview.md +69 -45
  151. package/lib/templates/content/troubleshooting/common-issues.md +91 -43
  152. package/lib/templates/content/what-is-yantra/getting-started-yantra.md +58 -57
  153. package/package.json +2 -2
  154. package/lib/pages/LandingPage/components/Icons.d.ts +0 -13
  155. package/lib/pages/LandingPage/components/Icons.d.ts.map +0 -1
  156. package/lib/pages/LandingPage/components/Icons.js.map +0 -1
@@ -1,83 +1,132 @@
1
- # Infrastructure
1
+ # Infrastructure & Reliability
2
2
 
3
- Yantra's technical infrastructure and scalability.
3
+ Yantra's cloud infrastructure is designed for high availability, global performance, and security at every layer.
4
4
 
5
- ## Cloud Infrastructure
5
+ ---
6
6
 
7
- ### Cloud Architecture
7
+ ## Cloud Architecture
8
8
 
9
- - **Multi-cloud**: Multi-cloud deployment strategy
10
- - **Microservices**: Microservices architecture
11
- - **Containerization**: Docker containerization
12
- - **Orchestration**: Kubernetes orchestration
9
+ ### Multi-region deployment
13
10
 
14
- ### Infrastructure Components
11
+ Yantra runs across **3 AWS regions** (US East, EU West, AP Southeast) with active-active configuration. User traffic is routed to the nearest region via latency-based DNS routing.
15
12
 
16
- - **Compute**: Scalable compute resources
17
- - **Storage**: Distributed storage systems
18
- - **Networking**: High-performance networking
19
- - **Security**: Infrastructure security
13
+ ### Container orchestration
20
14
 
21
- ## Scalability Design
15
+ All services run as Docker containers orchestrated by **Kubernetes (EKS)**:
22
16
 
23
- ### Horizontal Scaling
17
+ - **Namespaces** isolate production, staging, and development environments.
18
+ - **Resource quotas** prevent any single service from consuming excessive cluster resources.
19
+ - **Rolling deployments** ensure zero-downtime updates with automatic rollback on health check failures.
20
+ - **Horizontal Pod Autoscaler** adjusts replica counts based on CPU, memory, and custom metrics.
24
21
 
25
- - **Auto-scaling**: Automatic scaling based on demand
26
- - **Load Balancing**: Advanced load balancing
27
- - **Distributed Systems**: Distributed architecture
28
- - **Resource Pooling**: Resource pooling strategies
22
+ ### Service mesh
29
23
 
30
- ### Performance Optimization
24
+ An Istio-based service mesh provides:
31
25
 
32
- - **Caching**: Multi-layer caching
33
- - **CDN**: Content delivery network
34
- - **Database Optimization**: Database performance tuning
35
- - **Network Optimization**: Network performance optimization
26
+ - **Mutual TLS** between all services (zero-trust networking).
27
+ - **Traffic management** Canary deployments, circuit breaking, retry policies.
28
+ - **Observability** Distributed tracing with Jaeger, metrics with Prometheus.
29
+
30
+ ---
36
31
 
37
32
  ## High Availability
38
33
 
39
- ### Availability Design
34
+ ### Availability targets
35
+
36
+ | Component | Target SLA | Actual (trailing 12 months) |
37
+ | -------------- | ---------- | --------------------------- |
38
+ | API Gateway | 99.99% | 99.995% |
39
+ | Search Service | 99.95% | 99.98% |
40
+ | AI Service | 99.9% | 99.94% |
41
+ | Data Pipeline | 99.9% | 99.92% |
42
+
43
+ ### Redundancy design
44
+
45
+ - **No single point of failure** — Every component has at least 2 replicas across different availability zones.
46
+ - **Database failover** — Automated failover with < 10-second recovery for PostgreSQL and Redis.
47
+ - **Cross-region replication** — Critical data is replicated across regions for disaster recovery.
48
+ - **Graceful degradation** — If the AI service is unavailable, search still returns results without AI-generated summaries.
49
+
50
+ ### Disaster recovery
51
+
52
+ | Metric | Target | Actual |
53
+ | ------------------------------ | --------- | ---------- |
54
+ | Recovery Time Objective (RTO) | < 4 hours | 2.1 hours |
55
+ | Recovery Point Objective (RPO) | < 1 hour | 15 minutes |
56
+ | DR test frequency | Quarterly | Monthly |
57
+
58
+ ---
59
+
60
+ ## Monitoring & Observability
61
+
62
+ ### The three pillars
40
63
 
41
- - **Redundancy**: System redundancy
42
- - **Failover**: Automatic failover
43
- - **Disaster Recovery**: Disaster recovery procedures
44
- - **Backup Systems**: Comprehensive backup systems
64
+ | Pillar | Tools | Details |
65
+ | ------- | -------------------------------- | ------------------------------------------------ |
66
+ | Metrics | Prometheus + Grafana | 2,000+ custom metrics, 15-second scrape interval |
67
+ | Logs | Fluentd + Elasticsearch + Kibana | Structured JSON logs, 30-day retention |
68
+ | Traces | Jaeger + OpenTelemetry | End-to-end request tracing across all services |
45
69
 
46
- ### Monitoring
70
+ ### Alerting
47
71
 
48
- - **Health Monitoring**: System health monitoring
49
- - **Performance Monitoring**: Performance metrics
50
- - **Alerting**: Automated alerting systems
51
- - **Logging**: Comprehensive logging
72
+ - **PagerDuty integration** for critical alerts (P1/P2) with automatic escalation.
73
+ - **Slack notifications** for warnings and informational alerts.
74
+ - **Anomaly detection** — ML-based alerting detects unusual patterns before they become incidents.
75
+ - **Runbooks** Every alert links to a runbook with diagnosis steps and remediation procedures.
76
+
77
+ ---
52
78
 
53
79
  ## Security Infrastructure
54
80
 
55
- ### Security Measures
81
+ ### Network security
82
+
83
+ - **VPC isolation** — All services run in private subnets with no direct internet access.
84
+ - **WAF (Web Application Firewall)** — Protects against OWASP Top 10 threats.
85
+ - **DDoS protection** — AWS Shield Advanced with automatic traffic scrubbing.
86
+ - **Egress filtering** — Outbound traffic is restricted to known-good destinations.
87
+
88
+ ### Secrets management
89
+
90
+ - **HashiCorp Vault** for all secrets, API keys, and database credentials.
91
+ - **Automatic rotation** — Secrets are rotated on configurable schedules (default: 30 days).
92
+ - **Just-in-time access** — Engineers request temporary elevated access via an approval workflow.
93
+
94
+ ---
95
+
96
+ ## CI/CD Pipeline
97
+
98
+ ### Deployment flow
99
+
100
+ 1. **Code push** — Developer pushes to a feature branch on GitHub.
101
+ 2. **CI checks** — Automated linting, type checking, unit tests, and integration tests run in GitHub Actions.
102
+ 3. **Build** — Docker images are built, scanned for vulnerabilities, and pushed to ECR.
103
+ 4. **Staging deploy** — ArgoCD deploys to the staging environment automatically.
104
+ 5. **QA validation** — Automated end-to-end tests + manual spot checks.
105
+ 6. **Production deploy** — Canary deployment to 5% of traffic, then gradual rollout to 100%.
106
+ 7. **Post-deploy monitoring** — Automated health checks verify error rates and latency for 30 minutes.
56
107
 
57
- - **Network Security**: Network-level security
58
- - **Application Security**: Application security
59
- - **Data Security**: Data protection measures
60
- - **Access Control**: Access control systems
108
+ ### Deployment frequency
61
109
 
62
- ### Compliance
110
+ - **Production deploys** — 8-12 per day across all services.
111
+ - **Rollback time** — Under 60 seconds to previous version.
112
+ - **Feature flags** — LaunchDarkly for gradual feature rollouts and instant kill switches.
63
113
 
64
- - **Security Standards**: Industry security standards
65
- - **Compliance Monitoring**: Compliance monitoring
66
- - **Audit Logging**: Comprehensive audit logs
67
- - **Security Testing**: Regular security testing
114
+ ---
68
115
 
69
- ## Global Infrastructure
116
+ ## Global Performance
70
117
 
71
- ### Geographic Distribution
118
+ ### Content delivery
72
119
 
73
- - **Multi-region**: Multi-region deployment
74
- - **Edge Computing**: Edge computing capabilities
75
- - **Latency Optimization**: Low-latency optimization
76
- - **Data Residency**: Data residency compliance
120
+ - **200+ edge locations** via CloudFront CDN.
121
+ - **Edge caching** for static assets with 85%+ cache hit rate.
122
+ - **Dynamic content acceleration** — Optimized TCP connections and HTTP/3 support.
77
123
 
78
- ### Network Architecture
124
+ ### Latency optimization
79
125
 
80
- - **Global Network**: Global network infrastructure
81
- - **Peering**: Network peering agreements
82
- - **Traffic Management**: Intelligent traffic management
83
- - **Bandwidth**: High-bandwidth connectivity
126
+ | Region | Average API latency |
127
+ | -------------- | ------------------- |
128
+ | US East | 35 ms |
129
+ | US West | 52 ms |
130
+ | EU West | 41 ms |
131
+ | AP Southeast | 68 ms |
132
+ | Global average | 48 ms |
@@ -1,83 +1,105 @@
1
1
  # Performance Optimization
2
2
 
3
- Technical optimizations for speed and efficiency.
3
+ How Yantra achieves sub-second response times at scale — and how you can get the most out of the platform.
4
4
 
5
- ## System Performance
5
+ ---
6
6
 
7
- ### Response Time Optimization
7
+ ## System Performance Targets
8
8
 
9
- - **Query Optimization**: Database query optimization
10
- - **Caching Strategies**: Intelligent caching
11
- - **CDN Integration**: Content delivery network
12
- - **Load Balancing**: Advanced load balancing
9
+ | Metric | Target | Current |
10
+ | ------------------------- | -------------- | -------------- |
11
+ | Search latency (P50) | < 200 ms | 145 ms |
12
+ | Search latency (P99) | < 1 s | 780 ms |
13
+ | AI response latency (P50) | < 800 ms | 620 ms |
14
+ | API uptime | 99.95% | 99.98% |
15
+ | Throughput | 10,000 req/min | 14,200 req/min |
13
16
 
14
- ### Throughput Optimization
17
+ ---
15
18
 
16
- - **Parallel Processing**: Multi-threaded processing
17
- - **Async Operations**: Asynchronous operations
18
- - **Connection Pooling**: Database connection pooling
19
- - **Resource Management**: Efficient resource management
19
+ ## Caching Strategy
20
+
21
+ Yantra uses a **multi-layer caching architecture** to minimize redundant computation:
22
+
23
+ ### Layer 1 — Edge cache (CDN)
24
+
25
+ Static assets and frequently requested API responses are cached at 200+ edge locations worldwide. Cache hit rates typically exceed 85%.
26
+
27
+ ### Layer 2 — Application cache (Redis)
28
+
29
+ - **Query result cache** — Identical queries return cached results within 5 ms.
30
+ - **Session cache** — User sessions and preferences are stored in Redis for instant access.
31
+ - **Embedding cache** — Pre-computed embeddings for popular documents avoid redundant inference.
32
+
33
+ ### Layer 3 — Database cache
34
+
35
+ - **Connection pooling** — PgBouncer maintains a pool of warm database connections, eliminating connection overhead.
36
+ - **Materialized views** — Complex aggregation queries use pre-computed materialized views refreshed every 5 minutes.
37
+ - **Query plan caching** — PostgreSQL's prepared statements reuse optimized query plans.
38
+
39
+ ---
20
40
 
21
41
  ## Database Optimization
22
42
 
23
- ### Query Performance
43
+ ### Indexing strategy
24
44
 
25
- - **Index Optimization**: Database index optimization
26
- - **Query Analysis**: Query performance analysis
27
- - **Execution Plans**: Query execution optimization
28
- - **Connection Optimization**: Database connection optimization
45
+ - **B-tree indexes** on primary keys and frequently filtered columns.
46
+ - **GIN indexes** on JSONB fields for flexible metadata queries.
47
+ - **Partial indexes** on hot data subsets (e.g., active users, recent content).
48
+ - **Covering indexes** that include all queried columns to avoid table lookups.
29
49
 
30
- ### Storage Optimization
50
+ ### Query optimization
31
51
 
32
- - **Data Partitioning**: Database partitioning
33
- - **Compression**: Data compression techniques
34
- - **Archiving**: Data archiving strategies
35
- - **Cleanup**: Automated data cleanup
52
+ Every query is analyzed for:
36
53
 
37
- ## Application Optimization
54
+ 1. **Execution plan review** — EXPLAIN ANALYZE is run on all new queries during code review.
55
+ 2. **N+1 detection** — Automated detection of N+1 query patterns in development.
56
+ 3. **Slow query logging** — Queries exceeding 100 ms are logged and reviewed weekly.
57
+ 4. **Connection management** — Read replicas handle analytics queries to keep the primary database responsive.
38
58
 
39
- ### Code Optimization
59
+ ---
40
60
 
41
- - **Algorithm Optimization**: Algorithm efficiency
42
- - **Memory Management**: Memory optimization
43
- - **CPU Optimization**: CPU usage optimization
44
- - **I/O Optimization**: Input/output optimization
61
+ ## Application-Level Optimization
45
62
 
46
- ### Framework Optimization
63
+ ### Frontend performance
47
64
 
48
- - **Framework Tuning**: Framework configuration
49
- - **Middleware Optimization**: Middleware performance
50
- - **Library Optimization**: Third-party library optimization
51
- - **Dependency Management**: Dependency optimization
65
+ - **Code splitting** Routes are lazy-loaded so users only download the JavaScript they need.
66
+ - **Image optimization** All images are served in WebP/AVIF format with responsive srcsets.
67
+ - **Prefetching** The most likely next navigation target is prefetched in the background.
68
+ - **Bundle analysis** We maintain strict bundle size budgets (< 200 KB initial JS, < 50 KB CSS).
52
69
 
53
- ## Infrastructure Optimization
70
+ ### Backend performance
54
71
 
55
- ### Server Optimization
72
+ - **Async I/O** — All I/O-bound operations (database queries, API calls, file reads) are non-blocking.
73
+ - **Worker pools** — CPU-intensive tasks (embedding generation, document parsing) run in dedicated worker processes.
74
+ - **Streaming responses** — AI-generated responses stream token-by-token for perceived instant feedback.
75
+ - **Graceful degradation** — If a dependency is slow, the system returns partial results rather than timing out entirely.
56
76
 
57
- - **Hardware Optimization**: Hardware configuration
58
- - **OS Tuning**: Operating system tuning
59
- - **Network Optimization**: Network performance
60
- - **Storage Optimization**: Storage performance
77
+ ---
78
+
79
+ ## Infrastructure Optimization
61
80
 
62
- ### Cloud Optimization
81
+ ### Auto-scaling
63
82
 
64
- - **Resource Allocation**: Optimal resource allocation
65
- - **Auto-scaling**: Intelligent auto-scaling
66
- - **Cost Optimization**: Cloud cost optimization
67
- - **Performance Monitoring**: Performance monitoring
83
+ | Component | Scaling metric | Scale range |
84
+ | ---------------------- | ----------------------------- | ------------------ |
85
+ | API servers | Request rate + latency | 4 to 64 pods |
86
+ | AI workers | GPU utilization + queue depth | 2 to 16 nodes |
87
+ | Kafka consumers | Consumer lag | 3 to 24 partitions |
88
+ | Database read replicas | Connection count | 1 to 4 replicas |
68
89
 
69
- ## Monitoring and Profiling
90
+ ### Cost optimization
70
91
 
71
- ### Performance Monitoring
92
+ - **Spot instances** for batch processing workloads (60% cost savings).
93
+ - **Reserved instances** for always-on services (40% cost savings).
94
+ - **Right-sizing** — Monthly reviews of resource utilization with automated recommendations.
95
+ - **Tiered storage** — Infrequently accessed data is automatically moved to cheaper storage tiers.
72
96
 
73
- - **Real-time Monitoring**: Real-time performance monitoring
74
- - **Metrics Collection**: Performance metrics collection
75
- - **Alerting**: Performance alerting
76
- - **Dashboards**: Performance dashboards
97
+ ---
77
98
 
78
- ### Profiling Tools
99
+ ## Tips for Optimizing Your Experience
79
100
 
80
- - **Application Profiling**: Application performance profiling
81
- - **Database Profiling**: Database performance profiling
82
- - **Network Profiling**: Network performance profiling
83
- - **System Profiling**: System performance profiling
101
+ 1. **Use specific queries** More precise queries return faster, more relevant results.
102
+ 2. **Apply filters** Narrowing by date, source, or content type reduces the search space.
103
+ 3. **Enable caching** For API integrations, respect cache headers to avoid unnecessary requests.
104
+ 4. **Use batch endpoints** Bundle multiple operations into a single batch request.
105
+ 5. **Monitor your usage** — The Dashboard shows your API usage patterns and suggests optimizations.
@@ -1,83 +1,105 @@
1
- # Search Algorithms
1
+ # Search Algorithms & Ranking
2
2
 
3
- Technical details about Yantra's search algorithms.
3
+ How Yantra finds the most relevant results in milliseconds — the algorithms, ranking signals, and optimizations behind the search experience.
4
+
5
+ ---
4
6
 
5
7
  ## Search Architecture
6
8
 
7
- ### Core Algorithms
9
+ Yantra's search system combines **three complementary approaches** to deliver highly relevant results:
8
10
 
9
- - **Vector Search**: Semantic vector search
10
- - **Keyword Search**: Traditional keyword matching
11
- - **Hybrid Search**: Combined vector and keyword search
12
- - **Ranking Algorithms**: Advanced ranking algorithms
11
+ ### 1. Keyword search (BM25)
13
12
 
14
- ### Search Pipeline
13
+ Traditional lexical matching using the BM25 algorithm. This excels at exact-match queries where the user knows specific terms.
15
14
 
16
- - **Query Processing**: Query analysis and processing
17
- - **Index Lookup**: Search index lookup
18
- - **Result Ranking**: Result ranking and scoring
19
- - **Result Filtering**: Result filtering and refinement
15
+ - **How it works** Documents are scored based on term frequency (TF), inverse document frequency (IDF), and document length normalization.
16
+ - **Best for** Error codes, product names, exact phrases, technical identifiers.
20
17
 
21
- ## Ranking Algorithms
18
+ ### 2. Semantic search (vector similarity)
22
19
 
23
- ### Relevance Scoring
20
+ Neural embedding-based search that understands meaning beyond exact words.
24
21
 
25
- - **TF-IDF**: Term frequency-inverse document frequency
26
- - **BM25**: Best Matching 25 algorithm
27
- - **Semantic Similarity**: Semantic similarity scoring
28
- - **User Behavior**: User behavior-based ranking
22
+ - **How it works** — Both the query and documents are converted to high-dimensional vectors. Results are ranked by cosine similarity.
23
+ - **Best for** Natural language questions, conceptual queries, "how do I..." questions.
29
24
 
30
- ### Ranking Factors
25
+ ### 3. Hybrid search (default)
31
26
 
32
- - **Content Quality**: Content quality assessment
33
- - **Source Authority**: Source authority scoring
34
- - **Recency**: Content recency scoring
35
- - **User Preferences**: Personalized ranking
27
+ Combines keyword and semantic results using **Reciprocal Rank Fusion (RRF)**, producing results that are both lexically precise and semantically relevant.
36
28
 
37
- ## Indexing System
29
+ ```
30
+ RRF_score = sum(1 / (k + rank_i)) for each ranking system i
31
+ ```
38
32
 
39
- ### Search Index
33
+ This is Yantra's default search mode and performs best for most queries.
40
34
 
41
- - **Inverted Index**: Traditional inverted index
42
- - **Vector Index**: Semantic vector index
43
- - **Metadata Index**: Metadata indexing
44
- - **Full-text Index**: Full-text search index
35
+ ---
45
36
 
46
- ### Index Management
37
+ ## Ranking Signals
47
38
 
48
- - **Index Updates**: Real-time index updates
49
- - **Index Optimization**: Index optimization
50
- - **Index Partitioning**: Index partitioning
51
- - **Index Backup**: Index backup and recovery
39
+ After initial retrieval, results are re-ranked using a learned ranking model that weighs multiple signals:
52
40
 
53
- ## Query Processing
41
+ | Signal | Weight | Description |
42
+ | ----------------- | ------ | ---------------------------------------------------- |
43
+ | Text relevance | 35% | BM25 + semantic similarity combined score |
44
+ | Source authority | 20% | Domain reputation, citation count, editorial quality |
45
+ | Content freshness | 15% | Recency of creation or last update |
46
+ | User engagement | 15% | Click-through rate, time-on-page, bookmarks |
47
+ | Personalization | 10% | User's search history, preferred sources, role |
48
+ | Content quality | 5% | Readability score, completeness, structure |
49
+
50
+ ### Boosting and suppression
54
51
 
55
- ### Query Analysis
52
+ - **Recency boost** — Content published in the last 30 days receives a configurable relevance boost.
53
+ - **Source pinning** — Admins can pin trusted sources to always appear in the top results.
54
+ - **Duplicate suppression** — Near-duplicate documents (> 85% similarity) are collapsed, showing only the highest-quality version.
55
+
56
+ ---
57
+
58
+ ## Indexing System
56
59
 
57
- - **Query Parsing**: Natural language query parsing
58
- - **Query Expansion**: Query expansion techniques
59
- - **Query Optimization**: Query optimization
60
- - **Query Caching**: Query result caching
60
+ ### How content gets indexed
61
+
62
+ 1. **Document intake** New or updated content enters the indexing queue via the data pipeline.
63
+ 2. **Analysis** The document is processed through language-specific analyzers (tokenization, stemming, synonym expansion).
64
+ 3. **Embedding** — A vector representation is generated using the configured embedding model.
65
+ 4. **Storage** — The analyzed text, metadata, and vector are written to Elasticsearch shards.
66
+ 5. **Availability** — The document becomes searchable within 1-2 seconds (near real-time).
67
+
68
+ ### Index management
69
+
70
+ - **Shard allocation** — Each index is distributed across multiple shards for parallel query execution.
71
+ - **Replica configuration** — Each shard has at least one replica for fault tolerance and read throughput.
72
+ - **Index lifecycle** — Older indexes are automatically merged, force-merged, or moved to warm storage based on access patterns.
73
+
74
+ ---
75
+
76
+ ## Query Processing
61
77
 
62
- ### Intent Recognition
78
+ ### What happens when you search
63
79
 
64
- - **Intent Classification**: User intent classification
65
- - **Entity Recognition**: Named entity recognition
66
- - **Context Understanding**: Context analysis
67
- - **Query Disambiguation**: Query disambiguation
80
+ 1. **Query parsing** The raw input is tokenized and analyzed using the same pipeline as indexed documents.
81
+ 2. **Query expansion** Synonyms and related terms are added automatically (e.g., "k8s" expands to "kubernetes").
82
+ 3. **Spell correction** Common typos are detected and corrected using edit-distance algorithms.
83
+ 4. **Intent detection** The system classifies whether the user wants a factual answer, a list, a comparison, or a how-to guide.
84
+ 5. **Execution** — The query runs against both keyword and vector indexes in parallel.
85
+ 6. **Fusion + re-ranking** — Results are merged via RRF, then re-ranked by the learned ranking model.
86
+ 7. **Response assembly** — Top results are formatted with highlighted snippets and source metadata.
68
87
 
69
- ## Performance Optimization
88
+ ---
70
89
 
71
- ### Search Performance
90
+ ## Performance
72
91
 
73
- - **Response Time**: Sub-second response times
74
- - **Throughput**: High query throughput
75
- - **Scalability**: Horizontal scaling
76
- - **Caching**: Multi-layer caching
92
+ | Metric | Value |
93
+ | -------------------------- | ----------------------------- |
94
+ | Average search latency | 145 ms |
95
+ | P99 search latency | < 780 ms |
96
+ | Index refresh interval | 1 second |
97
+ | Maximum concurrent queries | 12,000/sec |
98
+ | Index size | 500M+ documents across 8.7 TB |
77
99
 
78
- ### Optimization Techniques
100
+ ### Optimization techniques
79
101
 
80
- - **Index Optimization**: Search index optimization
81
- - **Query Optimization**: Query performance optimization
82
- - **Caching Strategies**: Intelligent caching
83
- - **Load Balancing**: Search load balancing
102
+ - **Query caching** Identical queries are served from Redis cache (5-minute TTL).
103
+ - **Shard routing** Queries are routed to the shard most likely to contain relevant results.
104
+ - **Early termination** If the top results are already confident, remaining shards stop processing.
105
+ - **Parallel execution** Keyword and vector searches run concurrently, not sequentially.