Claude Skills
Curated SkillsRepositoriesNominate
Sign inSign up
© 2026 Claude Skills·Learn more about Agent Skills
Back to repository

ai-query-service

stale

Centralized LLM query service with intelligent routing and optimization

View on GitHub

Repository

redmage123/artemis

src/ai_query_service_SKILL.md

Last Verified

February 3, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/redmage123/artemis/blob/68e1230b3d8fa751ba9c98106e5987573733ce61/src/ai_query_service_SKILL.md -a claude-code --skill ai-query-service

Installation paths:

Claude
.claude/skills/ai-query-service/
Powered by add-skill CLI

Instructions

# Ai Query Service

## Purpose

Routes LLM queries to optimal providers with caching and resilience

## When to Use This Skill

1. **All LLM Queries** - Centralized access point
2. **Cost Optimization** - Route to cheapest capable model
3. **Resilience** - Automatic fallback on failures
4. **Observability** - Track LLM usage metrics

## Responsibilities

1. **Intelligent routing** - (task type → best LLM)
2. **Response caching** - for identical queries
3. **Rate limit** - and retry handling
4. **Token usage** - optimization
5. **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

```bash
python3 ai_query_service.py --help
```

### Programmatic Usage

```python
from ai_query_service import AiQueryService

agent = AiQueryService()
result = agent.execute()
```

## Configuration

### Environment Variables

```bash
# Agent-specific configuration
ARTEMIS_AI_QUERY_SERVICE_ENABLED=true
ARTEMIS_LLM_PROVIDER=openai
ARTEMIS_LLM_MODEL=gpt-4o
```

### Hydra Configuration (if applicable)

```yaml
ai_query_service:
  enabled: true
  llm:
    provider: openai
    model: gpt-4o
```

## Best Practices

1. Follow agent-specific guidelines
2. Monitor performance metrics
3. Handle errors gracefully
4. Log important events
5. 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

- [Artemis Documentation](../README.md)
- [Agent Pattern](https://en.wikipedia.org/wiki/Software_agent)

---

**Version:** 1.0.0

**Maintained By:** Artemis Pipeline Team

**Last Updated:** October 24, 2025

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
1795 chars

Issues Found:

  • non_standard_path