Skip to main content
Pastures AI is context-aware — when you open the AI drawer, it reads the current route and surfaces relevant suggested questions for the page you’re on.

How it works

When the drawer opens, Pastures captures the current Rancher URL pathname and resolves it to a route name. A mapping in aiContext.ts associates each route with a set of suggested questions tailored to that page’s domain. The suggested questions appear as clickable pills in the empty state of the drawer. Clicking one immediately sends it as a query.
export interface AIContext {
  pageName: string;
  suggestedQuestions: string[];
}

Page-specific suggestions

Each Pastures page maps to a unique set of questions:
  • “Is my cluster ready to upgrade to the latest K3s?”
  • “What failed in the last CIS benchmark scan?”
  • “Which GPU nodes are over 80% utilization?”
  • “How do I fix Longhorn replica degradation?”
  • “What are the critical advisories for this cluster?”
  • “How do I fix the etcd single-member warning?”
  • “What is the health score of this cluster?”
  • “Are there any open issues across my fleet?”
  • “Why is my VM stuck in Starting state?”
  • “How do I restore a VM from snapshot?”
  • “Why is my pod in CrashLoopBackOff?”
  • “How do I debug OOMKilled containers?”
  • “How do I configure a NemoClaw gateway?”
  • “What sandbox policies are available?”
  • “How do I set GPU quotas for a project?”
  • “What are recommended resource limits for staging?”
  • “Who has cluster-admin access?”
  • “How do I create a read-only role for auditors?”

Route resolution

The route name is derived from the Rancher URL pathname. Pastures uses the Vue Router route name (e.g., c-cluster-pastures-operations) as the key into the context map.
export function getAIContext(routeName: string): AIContext | null {
  return CONTEXT_MAP[routeName] ?? null;
}
If the current route doesn’t match any entry in the context map, the drawer falls back to a generic empty state with no suggested questions.
Context awareness works in all modes — Oracle, BYO model, and demo. The suggested questions are determined by the page, not the AI backend.