feat: reusable AI agent steps with hybrid linking and evals#9825
Draft
rubenfiszel wants to merge 1 commit into
Draft
feat: reusable AI agent steps with hybrid linking and evals#9825rubenfiszel wants to merge 1 commit into
rubenfiszel wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying windmill with
|
| Latest commit: |
fb25ea8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://45beb17d.windmill.pages.dev |
| Branch Preview URL: | https://feat-reusable-ai-agents.windmill.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes an AI agent a savable, shareable, evaluable artifact instead of inline-only config. An agent is stored as a resource of a new built-in
ai_agentresource type bundling its brain (provider/model, system prompt, temperature, output schema, memory…), its tools, and an eval suite. A flow step can link to a saved agent — the brain + tools resolve at runtime from the resource (so edits propagate), while the flow keeps only the localuser_message/user_attachmentswiring.Changes
Backend
FlowModuleValue::AIAgentgains an optionalagentfield (resource path) for hybrid linking; threaded through the custom deserializer + lockfile resolver. Existing flows are byte-compatible (skip_serializing_if).windmill-worker/src/ai_executor.rs: a linked step loads brain config + tools from the resource viaget_resource_value_interpolated(nested provider$res:resolves for free) and overlays the flow-local inputs.20260627124035_ai_agent_resource_typeseeds theai_agentresource type into theadminsworkspace (visible everywhere via thelist_resource_typesadmins-union).windmill-api/src/ai_agents.rs:POST /ai_agents/runand/ai_agents/eval_case. Runs an agent by pushing a single-step AIAgent flow-preview job (reusespush+run_wait_result_internal, permissioned as the caller — no new job payload, no privilege escalation). Grading = deterministic assertions (contains/regex/json_path_equals/…) + an LLM judge that itself runs as an inline AIAgent step with a structured{score,pass,summary}schema. Unit-tested.windmill-ai/src/types.rs; OpenAPI updated.Frontend
flows/agentResourceUtils.ts— config↔input_transforms conversion + flow-local schema filter.flows/content/AgentResourceBar.svelte— Save as agent / pick a saved agent / Unlink, in the Step Input tab; brain config collapses to the flow inputs when linked. Warns if a non-static brain transform would be dropped on save.flows/content/AgentEvalsPanel.svelte— Evals tab: case CRUD (input message, judge checklist, assertions) + Run via the typedAiAgentService.FlowModuleComponent.svelte;docs/reusable-ai-agents.md.Screenshots
AgentResourceBar (resource picker + "Save as agent") and the new Evals tab in the AI agent step.
Linked state: banner + Unlink, brain config hidden, only flow-local inputs remain.
Evals tab: a case with input message, judge checklist, and assertions editor.
Test plan
cargo check(full backend) green;windmill-apiunit tests for the grading logic pass (6 tests)check:fastcleanai_agentresource (verified shape in Postgres) → linked banner + Unlink, brain hidden → Evals tab case editor renders$res:under the caller's permissions🤖 Generated with Claude Code
Summary by cubic
Make AI agents reusable. Flow steps can link to a saved
ai_agentso updates propagate, and you can run evals with assertions and an LLM judge.New Features
ai_agentresource type (brain config, tools, eval suite). AI Agent steps accept anagentlink.user_messageanduser_attachments./w/{workspace}/ai_agents/runand/w/{workspace}/ai_agents/eval_caseto run an agent or grade a case (assertions + LLM judge returning{score, pass, summary}), executed as the caller.Migration
ai_agentresource type inadmins(visible to all workspaces).Written for commit fb25ea8. Summary will update on new commits.