Operational patterns including SLM→LLM decision flows, ownership maps, and implementation guidance.
Production handoff logic for routing between SLM and LLM tiers.
flowchart TD
A[Incoming task / event / request] --> B[SLM preprocess]
B --> C[Intent classification]
C --> D[Policy / risk scan]
D --> E[Tool-needed check]
E --> F[Complexity estimate]
F --> G[Confidence score]
G --> H{Blocked by policy?}
H -->|Yes| X[Refuse / redact / quarantine]
H -->|No| I{Simple and high confidence?}
I -->|Yes| Y[Return SLM path result]
I -->|No| J{Tool first?}
J -->|Yes| K[Run tool / workflow]
K --> L[SLM compress + validate tool output]
L --> M{Enough to answer?}
M -->|Yes| Y
M -->|No| N[Escalate]
J -->|No| N[Escalate]
N --> O[Prepare compact escalation context]
O --> P[LLM reasoning / synthesis]
P --> Q[Post-LLM policy / quality check]
Q --> R[Return final response]
Use configurable thresholds, not hardcoded logic.
| Stay in SLM Path | Escalate to LLM |
|---|---|
| High confidence | Confidence below threshold |
| Classification/extraction/screening | Policy ambiguity exists |
| Short, bounded output | Tool outputs conflict |
| Unambiguous tool result | Multi-agent disagreement |
| Low risk | User-facing, high impact |
{
"intent": "ci_failure_triage",
"risk_level": "medium",
"needs_tool": true,
"complexity": "medium",
"confidence": 0.81,
"policy_status": "allow",
"recommended_path": "tool_first",
"escalate": false
}Maps conceptual stack into likely repo/service boundaries.
flowchart LR
R1[pvc-ai-gateway repo] --> S1[AI Gateway Service]
R2[cognitive-mesh repo] --> S2[Cognitive Mesh Service]
R3[codeflow-engine repo] --> S3[CodeFlow Engine Service]
R4[agentkit-forge repo] --> S4[AgentKit Forge Service]
R5[phoenixrooivalk-* repos] --> S5[PhoenixRooivalk Edge + Command Services]
R6[shared-platform / contracts / schemas repo] --> S6[Shared Contracts / Telemetry / Policy / SDKs]
R7[infra repo] --> S7[Azure Infra / Monitoring / Deployment Pipelines]
| Repo | Owns |
|---|---|
| pvc-ai-gateway | Ingress API, routing contracts, escalation policy, provider abstraction, semantic cache, audit envelope |
| cognitive-mesh | Specialist routing, task decomposition, agent state model, synthesis orchestration, disagreement logic |
| codeflow-engine | PR event models, diff classification, CI log triage, contract break workflows, comment generation |
| agentkit-forge | Tool registry, tool selection schemas, arg extraction, execution-loop state, retry/fallback logic |
| phoenixrooivalk-* | Edge event schema, local alerting, escalation packet format, command-layer integration |
| shared-platform | Telemetry envelope, routing decision schema, model usage schema, audit/trace IDs, reusable schemas |
| infra | Azure deployment, Grafana/ADX dashboards, Key Vault wiring, service identities, networking |
Define shared contracts:
- Routing decision schema
- Model usage event
- Tool execution event
- Audit envelope
- Edge escalation packet
Implement telemetry in the gateway:
- Trace ID propagation
- Decision logs
- Provider usage events
- Cost estimation fields
Bring CodeFlow and AgentKit onto same telemetry envelope.
Add Cognitive Mesh orchestration and disagreement telemetry.
Add Rooivalk edge packet telemetry and sync audit.
For your environment, the strongest production stance is:
- AI Gateway is the only public AI ingress
- All routing decisions emit one shared RoutingDecision contract
- All model calls emit one shared ModelUsageEvent
- All tool invocations flow through a broker or shared event schema
- All edge escalations use compact evidence packets
- ADX/Kusto + Grafana becomes the operational truth layer
This gives you:
- Cost visibility
- Quality visibility
- Compliance evidence
- Easier A/B testing of SLM routing
- Cleaner failure diagnosis