| name | ai-query-service |
| description | Centralized LLM query service with intelligent routing and optimization |
Ai Query Service
Purpose
Routes LLM queries to optimal providers with caching and resilience
When to Use This Skill
- All LLM Queries - Centralized access point
- Cost Optimization - Route to cheapest capable model
- Resilience - Automatic fallback on failures
- Observability - Track LLM usage metrics
Responsibilities
- Intelligent routing - (task type → best LLM)
- Response caching - for identical queries
- Rate limit - and retry handling
- Token usage - optimization
- Cost and - latency tracking
Integration with Pipeline
Communication
Receives:
- Input data specific to agent's purpose
Sends:
- Processed output and analysis results
Usage Examples
Standalone Usage
python3 ai_query_service.py --help
Programmatic Usage
from ai_query_service import AiQueryService
agent = AiQueryService()
result = agent.execute()
Configuration
Environment Variables
# Agent-specific configuration
ARTEMIS_AI_QUERY_SERVICE_ENABLED=true
ARTEMIS_LLM_PROVIDER=openai
ARTEMIS_LLM_MODEL=gpt-4o
Hydra Configuration (if applicable)
ai_query_service:
enabled: true
llm:
provider: openai
model: gpt-4o
Best Practices
- Follow agent-specific guidelines
- Monitor performance metrics
- Handle errors gracefully
- Log important events
- Integrate with observability
Cost Considerations
Typical cost: $0.05-0.20 per operation depending on complexity
Limitations
- Depends on LLM quality
- Context window limits
- May require multiple iterations
References
Version: 1.0.0
Maintained By: Artemis Pipeline Team
Last Updated: October 24, 2025