Prompt Enhancement & Self-Learning Routing
Two intelligence features that make every request better — automatically.
Prompt Enhancement (Phase 4.1)
- Automatic prompt rewriting — RoutePlex detects your query type and rewrites your prompt before it reaches the model. No extra API calls, no stored data, no configuration required.
- 17 query sub-types — Specialized rewriting for code, debugging, analysis, writing, math, creative, planning, comparison, and more. Each type gets targeted improvements (language context, step-by-step framing, structure hints, etc.).
- Complexity gating — Detailed prompts (30+ words with multiple specificity signals) are sent unchanged. Enhancement only fires when it would meaningfully help.
- 3 ways to enable — Per request via
enhance_prompt: true, via the OpenAI SDK with the X-RoutePlex-Enhance: true header, or via the standalone /api/v1/chat/enhance endpoint (no API key required, free).
- Stateless & private — Your prompt is processed in memory and immediately discarded. Nothing is stored. See the Prompt Enhancement docs.
Self-Learning Routing (Phase 4.4)
- Per-account performance profiles — After each successful request, RoutePlex records lightweight metadata (model used, query type, response quality signals, latency, cost). Over time this builds a personalized routing profile for your account.
- Learned routing bias — The router applies a per-model bias (±15 points) based on historical performance for each query type. Models that consistently produce better results for your workload get priority. No configuration needed.
- Confidence gating — Learning bias only influences routing when there's enough data to trust it: 20% weight at 10–50 requests, 50% at 50–100, 80% beyond 100 requests per model. Below the threshold, global aggregated patterns apply.
- Explicit feedback — Rate individual responses (1–5 stars) via the Insights dashboard or the
POST /api/v1/insights/feedback API. Ratings are blended 60/40 with automatic quality signals.
- Insights dashboard — New Insights tab in the dashboard shows per-model performance by query type, prompt enhancement effectiveness, routing influence stats, and cost optimization recommendations.
- Full data control — All learning data belongs to you. Delete it at any time from dashboard settings or via
DELETE /api/v1/insights/data. Routing immediately reverts to global defaults. See the Self-Learning docs.
Privacy
Both features are built with privacy as a constraint, not an afterthought:
- Prompts and responses are never stored
- Quality is inferred from response metadata (length, structure, token ratio) — not content
- Message pattern detection uses one-way SHA-256 hashing
- Learning data deletion is immediate and permanent