add self service agent to workbench - #4381
chrisakinrinade wants to merge 4 commits into
Conversation
Soffi AI SummaryThis PR introduces a self-service subagent to the AI workbench, enabling it to fulfill infrastructure requests through existing Plural catalogs and PR automations rather than always delegating to a coding agent. When a user's task maps to a known "golden path" (e.g., provisioning a database or deploying a service via a catalog template), the new subagent discovers the right PR automation, inspects its configuration, and opens the PR directly — without requiring custom code generation. Why this was done: Many common infrastructure requests are already covered by pre-defined PR automations and catalog items. Routing all such requests through the coding agent is slower and more expensive (in LLM tokens/cost) than invoking the established self-service workflow directly. This subagent adds a structured shortcut for those cases. Key changes:
ChangesSelf-service subagent for workbench
Updated: 2026-09-21 18:55 UTC |
| end | ||
|
|
||
| def implement(%__MODULE__{query: query}) do | ||
| case Tool.actor() do |
There was a problem hiding this comment.
ai will screw this up a lot, but this should ideally be a with comprehension
There was a problem hiding this comment.
Just changed it to a with using tagged failure cases
| end | ||
|
|
||
| defp fallback_search(query, user) do | ||
| catalogs = |
There was a problem hiding this comment.
This should be have two things:
- Be a stream so the list is set up lazily
- Have it factored in a single pipeline, can use Enum.concat into Jason.encode
There was a problem hiding this comment.
just made the fallback search more functional. for the streams, do you mean lazy load from the db or just when combining lists?
…e-agent Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # js/console/src/generated/graphql.ts # js/console/src/generated/persisted-queries/client.json # lib/console/ai/workbench/engine.ex # test/console/ai/workbench/environment_test.exs
|
| Catalog.search(query) | ||
| |> Catalog.for_user(user) | ||
| |> Repo.all() | ||
| |> Enum.map(&%{catalog: Map.take(&1, [:id, :name, :description, :category])}) |
There was a problem hiding this comment.
ultimately not a huge deal here, but Enum.map materializes a new list (alongside really all enum mod functions). For something that could be large enumerations, Stream equivalents is lazy and more memory efficient
| alias Console.Deployments.{Git, Policies} | ||
| alias Console.Schema.{Catalog, PrAutomation} | ||
|
|
||
| embedded_schema do |
There was a problem hiding this comment.
all queries in this function should have a limit (maybe 100)
Workbench jobs can now provision infrastructure through existing Plural catalogs and PR automations instead of routing every request to the coding agent. When a task maps cleanly to a golden path, the self-service subagent finds the right automation, inspects it, and opens the PR directly.
Test Plan
Test environment: https://console.your-env.onplural.sh/
Checklist
Plural Flow: console