Ask Your Docs Technical Specification
Technical implementation details and system integration guide
Version 1.0 | Engineering Team | June 2025
Component Overview
Ask Your Docs integrates with multiple system components to deliver AI-powered content validation:- Frontend Interface: React-based UI component in ClickHelp author dashboard
- API Gateway: Routes requests and handles authentication
- Content Indexer: Processes and indexes accessible documentation
- AI Service Integration: External AI provider for natural language processing
- Usage Tracker: Monitors and enforces daily limits
- Analytics Engine: Collects usage metrics and performance data
Security Note: All communications between components use encrypted channels (HTTPS/TLS 1.3). User content is processed but not permanently stored by external AI services.
| Table | Purpose | Key Fields | Indexes |
|---|---|---|---|
ayd_requests |
Log all user questions and responses | user_id, question_hash, response_json, created_at | user_id, created_at, question_hash |
ayd_usage_limits |
Track daily usage per user | user_id, date, question_count, limit_value | user_id + date (unique) |
ayd_settings |
Portal-level configuration | portal_id, is_enabled, ai_terms_accepted, settings_json | portal_id (unique) |
ayd_content_index |
Searchable content metadata | content_id, project_id, content_hash, indexed_at | content_id, project_id, content_hash |
Indexing Pipeline
- Trigger: Content save, publish, or manual reindex
- Processing: Extract text, metadata, and structure
- Storage: Vector embeddings for semantic search
- Update Frequency: Real-time for drafts, batch for published content
| Content Type | Processing Method | Accessibility | Update Trigger |
|---|---|---|---|
| Draft Topics | Full text extraction + metadata | Author only | On save |
| Published Topics | Full text + structured content | All authorized users | On publish |
| Private Projects | Permission-aware indexing | Project members only | Permission change + content update |
| Restricted Content | Metadata only | Restricted users | Access level change |
External Dependency: Ask Your Docs relies on third-party AI services. Monitor service health and implement fallback mechanisms for degraded performance.
| Metric | Threshold | Alert Level | Response |
|---|---|---|---|
| Average Response Time | > 5 seconds | Warning | Check AI service performance |
| Error Rate | > 5% | Critical | Investigate API gateway and AI service |
| Content Index Lag | > 10 minutes | Warning | Check indexing service health |
| Daily Usage Spike | > 150% normal | Info | Monitor for abuse patterns |
Privacy Controls
- Data Minimization: Only relevant content excerpts sent to AI service
- No Persistent Storage: AI provider does not retain user data
- Access Controls: Respect existing content permissions
- Audit Logging: All requests logged for compliance
| Variable | Description | Default | Required |
|---|---|---|---|
AYD_ENABLED |
Global feature toggle | false | Yes |
AYD_DAILY_LIMIT |
Default questions per user per day | 10 | No |
AYD_AI_PROVIDER |
AI service provider | openai | Yes |
AYD_AI_API_KEY |
AI service authentication | - | Yes |
AYD_MAX_CONTEXT_LENGTH |
Maximum content context size | 4000 | No |
AYD_TIMEOUT_SECONDS |
AI service request timeout | 30 | No |
| Level | Event Type | Data Included | Retention |
|---|---|---|---|
| INFO | Successful requests | User ID, response time, confidence | 30 days |
| WARN | Slow responses, high usage | Performance metrics, user patterns | 90 days |
| ERROR | Failed requests, system errors | Error details, stack traces, context | 1 year |
| DEBUG | Development debugging | Full request/response payload | 7 days |
High Response Times
Symptoms: AI responses taking > 10 seconds
Investigation:
- Check AI service status and latency
- Monitor content index query performance
- Review concurrent request volume
Resolution: Scale AI service capacity or implement request queuing
Content Not Found
Symptoms: AI reports no relevant content for valid questions
Investigation:
- Verify content indexing is current
- Check user permissions for content access
- Review content quality and structure
Resolution: Trigger manual reindex or review content organization
Usage Limit Exceeded
Symptoms: Users hitting daily limits unexpectedly
Investigation:
- Review usage patterns for unusual spikes
- Check for automated/scripted usage
- Verify limit configuration is appropriate
Resolution: Adjust limits or implement rate limiting
Pre-Deployment
- ✅ AI service credentials configured
- ✅ Database migrations completed
- ✅ Feature flags set appropriately
- ✅ Monitoring and alerting configured
- ✅ Content indexing service deployed
Deployment
- ✅ Deploy backend services
- ✅ Deploy frontend components
- ✅ Verify health check endpoints
- ✅ Test with staging data
- ✅ Enable feature for test users
Post-Deployment
- ✅ Monitor error rates and performance
- ✅ Verify user access and permissions
- ✅ Test full user workflow
- ✅ Confirm analytics data collection
- ✅ Document any configuration changes
| Task | Frequency | Responsible Team | Dependencies |
|---|---|---|---|
| Content Index Optimization | Weekly | DevOps | Low-traffic windows |
| Usage Analytics Review | Monthly | Product Team | Analytics dashboard |
| AI Model Version Updates | As available | Engineering | AI provider releases |
| Security Audit | Quarterly | Security Team | External audit tools |