Self-Service CI/CD for AWS

Self-service AWS CodePipeline platform — developers ship compliant CI/CD pipelines in minutes via dashboard, CLI, CDK, or AI prompt, while platform teams enforce policy-as-code guardrails, governance, and per-team isolation.

Plan: “Ask” Agent — in-app chat for platform how-to + creation

Goal

An in-app chat panel (“Ask”) that does two things in one surface:

  1. Explain — answer platform functionality / how-to questions, grounded in the existing in-app help corpus, with deep-links to the right dashboard page.
  2. Do — create pipelines, templates, and plugins from natural language, by calling the platform’s existing generation + CRUD APIs as tools.

Driven by a tool-model (a tool-calling-capable LLM) that can be sourced from a Docker model image (self-hosted) or a cloud provider.


The tool-model (central design decision)

The agent is only as good as the model’s tool-calling (function-calling) ability — that’s what turns “create a pipeline that lints and deploys on push” into an actual create_pipeline call. Two sourcing paths, both already reachable through the existing multi-provider registry (packages/ai-core):

Path How Best for
Docker model image (self-hosted) Docker Model Runner (docker model run ai/…) or Ollama / vLLM, serving a tool-capable model (e.g. Qwen 2.5 Coder 32B, Llama 3.3 70B). Exposes an OpenAI-compatible endpoint. Data stays on-prem; no per-token cloud cost
Cloud Claude 5 / GPT-5.6 via the existing anthropic/openai providers Strongest tool-calling reliability

Prerequisite gap (Phase 0): the @ai-sdk/openai-compatible adapter is already a dependency but is not registered in provider-registry.ts. Wiring it (with a configurable base URL) is what lets the platform point at a Docker model image.

Routing: small local models answer how-to well but are unreliable at multi-step tool-calling. So the agent routes by task:


Architecture

┌──────────────┐   chat/SSE   ┌───────────────────┐   OpenAI-compat   ┌────────────────────┐
│  Dashboard   │◀────────────▶│   ask (service)   │◀─────────────────▶│  Docker model image │
│  Ask panel   │              │  tool-calling loop │                   │ (Model Runner/Ollama)│
└──────────────┘              └─────────┬─────────┘                   └────────────────────┘
                                        │ internal APIs (service token, org-scoped)
                          ┌─────────────┼──────────────┬──────────────┐
                          ▼             ▼              ▼              ▼
                    api/pipeline   api/plugin   pipeline-templates   help corpus
                    (generate/CRUD)(generate)   (CRUD)               (grounding)

Topbar entry point

The DashboardLayout topbar today has three icon actions: Search/⌘K (command palette), Bell (notifications), and Help (HelpCircle/dashboard/help).

Replace the Help icon with an Ask action (MessageCircleQuestion / Sparkles) that opens the Ask slide-over — Ask is grounded in the same help corpus, so it’s a superset of “browse help.” Do not delete the reference: keep the /dashboard/help page and surface a “Browse all help →” link inside the Ask panel, so users who’d rather read than chat still reach the browsable docs. This is the single topbar change; Search and Bell are untouched.

Styling: the Ask action is blue — the icon glyph uses the brand-blue token --pb-brand (#0f6fff light / #63a6ff dark), set inside a blue circular badge (a rounded-full background tinted from --pb-brand, e.g. color-mix/low-opacity brand fill). Unlike the neutral Search/Bell/Help icons, Ask reads as a colored call-to-action — the one blue accent in the topbar — while staying token-driven and dark-mode-correct.


Phases

Phase 0 — Enable local / tool models (small, foundational)

Phase 1 — Read-only “Ask” chat (Explain)

Phase 2 — Tools (Do)

Phase 3 — The Docker model image in deploy

Phase 4 — Hardening


Tool schemas (what the tool-model can call)

Tool Kind Wraps Notes
answer_how_to(query) read help corpus retrieval returns answer + deep-links
list_resources(kind, filter) read pipeline/plugin/template list lets the model ground on real state
inspect(kind, id) read detail endpoints  
create_pipeline(promptOrSpec) write api/pipeline generate + CRUD preview → confirm → commit
create_template(spec) write pipeline-templates preview → confirm
create_plugin(promptOrSpec) write api/plugin generate preview → confirm

All writes are two-step: the tool returns a draft/preview; commit happens only after explicit user confirmation in the chat.


What’s ready vs. to build

Ready (reuse):

To build:


Risks / open questions


Ship Phase 0 + Phase 1 first (openai-compatible wiring + read-only Ask chat). It’s genuinely useful, can’t mutate anything, proves the whole plumbing (chat UI, streaming, grounding, tool-model wiring — including a Docker model image), and de- risks the model-quality question before any write tools exist. Then layer Phase 2.