Skip to content

[Hackathon] feat: Custom Agent Library + Workflow Time Machine#5096

Open
EmilySun621 wants to merge 1 commit into
apache:mainfrom
EmilySun621:hackathon/agent-library-time-machine
Open

[Hackathon] feat: Custom Agent Library + Workflow Time Machine#5096
EmilySun621 wants to merge 1 commit into
apache:mainfrom
EmilySun621:hackathon/agent-library-time-machine

Conversation

@EmilySun621
Copy link
Copy Markdown

[This is still be under testing]

The Story
Meet Dr. Sarah, a biomedical researcher at UCI. She studies diabetes. She's brilliant at biology but doesn't write code.
She opens Texera and sees one generic AI agent. She asks it to build a workflow. The agent generates something — but it uses the wrong methodology, skips evaluation metrics, and doesn't follow the CRISP-DM framework her lab requires. She spends an hour fixing things the AI should have known. Next week, her student asks the same agent the same question and gets different, equally wrong results.
This is the problem we solved.
What If Researchers Could Build Their Own AI Agents?
We built a Custom Agent Library — think of it as a "GPTs Store" for data science workflows.
Dr. Sarah creates a "🧬 Diabetes Research Agent" in 2 minutes:

Domain: Biomedical
Methodology: CRISP-DM (her lab's standard)
Guardrails: always split train/test, always evaluate models, never leak data
Custom rules: "Always compare at least 2 models. Use logistic regression as baseline."
Knowledge base: uploads her lab's data dictionary and methodology guide
Model: Claude Opus for complex workflow generation

Now when she asks "predict diabetes onset from my patient data," the agent already knows her standards. It generates a proper CRISP-DM workflow with train/test split, two competing models, and evaluation metrics — every time.
She shares the agent with her students. They all get workflows that meet the lab's standards. No more fixing AI mistakes. No more inconsistency.
But What Happens When Things Go Wrong?
Her student accidentally deletes half the workflow. Or the AI agent modifies something it shouldn't have. In the old Texera, there's just a version number and a timestamp. No way to know what changed, who changed it, or how to get back.
We built a Workflow Time Machine — version control for workflows, like Git but visual.
Every meaningful change is captured: when the AI generates operators (🤖), when a user edits manually (👤), when someone clicks Run. Not every keystroke — smart snapshots every 5 minutes, on execution, and on manual save.
The student sees the timeline: "Oh, the AI added Random Forest at 5:30, then I accidentally deleted the evaluation at 5:35." One click on Revert, and the workflow snaps back. Crisis averted.
The AI agent can even use the Time Machine — "undo my last 3 changes" just works.
What We Built
Custom Agent Library

"Agents" page in the sidebar — create, configure, browse, share specialized agents
Full customization — domain, methodology, guardrails, knowledge base, example workflows, model selection, output preferences
Agent-aware chat — each agent has its own conversation history per workflow
163 built-in operators injected into the agent's prompt — agents use Texera's native operators, not Python UDFs
Model selection — choose Claude Opus for complex tasks, Haiku for simple ones

Workflow Time Machine

Smart snapshots — auto-save every 5 minutes, on Run, on manual save. No noise.
Rich timeline — who changed what, when, and whether it was human or AI
One-click revert — go back to any version instantly
Version diff — compare two versions to see what was added, removed, or modified
Agent integration — the AI can browse history and revert changes via natural language

Why This Matters
Everyone else at this hackathon built one agent that does one thing. We built a platform where users create their own agents that do anything — and a safety net (Time Machine) so they never lose their work.
For biomedical researchers who aren't programmers, this is the difference between "AI that sometimes helps" and "AI that works the way my lab works, every time."
Demo

Create a "🧬 Diabetes Research Agent" with CRISP-DM, guardrails, custom rules
Ask it to build a classification workflow → proper DAG appears on canvas with built-in operators
Open Time Machine → see 🤖 agent snapshot
Make a mistake → revert with one click
Compare two versions → see exactly what changed

Technical Details
Frontend: Angular components for Agent Library page, Create/Edit Agent dialog, agent selector in chat panel, Time Machine panel with timeline UI
Backend:

Custom system prompt builder with operator catalog injection (agent-service, TypeScript)
workflow_snapshot table + REST endpoints for Time Machine (amber, Scala)
Agent tool for version control (workflow-history-tool)

No modifications to Texera's core engine (Amber). Everything is additive — new modules, new endpoints, new components.

This bundles the feature work that built up on this branch:

- Custom agents: dashboard CRUD page and editor dialog (48px icon tile,
  chip-style guardrails, model selector). Each custom agent now carries a
  LiteLLM model_name (Opus 4.7 / Haiku 4.5) that is passed through to the
  agent-service so different agents can use different models.

- Conversation history is scoped per (workflowId, agentId): switching
  agent or workflow yields a different conversation list. localStorage
  key: texera.workflowConversations.v1.{workflowId}.{agentId}.

- Time machine: workflow snapshot list, revert, and agent-tagged
  checkpoints. New workflow-history-tool in agent-service backs the
  "undo my last change" flow; amber gains a WorkflowSnapshotResource;
  sql/updates/23.sql adds the snapshot table.

- Operator-aware custom-agent prompts: the system prompt now injects the
  full operator catalog with a "prefer built-in operators over Python
  UDFs" rule, sourced from WorkflowSystemMetadata at request time.

- LiteLLM: added the claude-opus-4.7 entry alongside claude-haiku-4.5
  and gpt-5-mini in bin/litellm-config.yaml.

- Agent panel rewritten around the (conversation list / chat) two-view
  model with subscription-managed list reloads and per-step persistence.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added engine ddl-change Changes to the TexeraDB DDL frontend Changes related to the frontend GUI dev common agent-service labels May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-service common ddl-change Changes to the TexeraDB DDL dev engine frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant