Query Tools

Template-based queries using self-learning system (20x faster)

Execute queries using learned templates from the Sprint 11 Self-Learning System. Reuses proven query patterns for 20x faster execution compared to cernion_ask. Falls back to LLM generation for new patterns.

Performance:

  • Template Match: 50-200ms (20x faster than LLM)
  • New Pattern: 2-8 seconds (same as cernion_ask, but learns for future use)
  • Confidence Threshold: 0.6 (60%) default - higher = stricter matching

Use Cases:

  • Recurring queries (regional capacity, installation counts)
  • Performance-critical applications
  • Batch processing (analyze multiple regions)
  • Real-time dashboards
  • API integrations requiring fast responses

When to Use:

  • ✅ Recurring query patterns ("PV capacity in {region}")
  • ✅ Performance-critical applications
  • ✅ Batch processing
  • ❌ First-time complex queries → use cernion_ask first
  • ❌ Unstructured exploration → use cernion_ask
post/api/query/ask-learned

Request

  • Base URL: https://api.cernion.de
  • URL: https://api.cernion.de/api/query/ask-learned
  • Auth: none declared

Query parameters

tokenstring

Optional Cernion MCP token as URL query parameter. If provided, it overrides CERNION_TOKEN for this request. Prefer Authorization Bearer header in production to reduce token exposure in URLs/logs.

Request body

querystring required

Natural language query (same format as cernion_ask)

confidencenumber

Minimum confidence threshold for template matching (0.0-1.0)

forceGenerateboolean

Force LLM generation even if template matches (for testing)

verboseboolean

Show detailed reasoning and statistics (template used, confidence score)

tokenstring

Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.

Example request

{
  "query": "PV-Leistung in Hessen",
  "confidence": 0.7
}

Response

Successful query execution with template information

successboolean
resultobject

Query result data

templateUsedboolean

Whether a template was used

confidencenumber

Template matching confidence (0.0-1.0)

executionTimeMsnumber

Execution time in milliseconds

metadataobject

Execution metadata

Example response

{
  "success": true,
  "templateUsed": true,
  "confidence": 0.85,
  "executionTimeMs": 45
}

Changes

No recorded changes to this operation across all 2 revisions of this API.