Skip to content

[Hackathon] feat(agent-service): global AI agent with natural language navigation…#5087

Open
claire687 wants to merge 3 commits into
apache:mainfrom
claire687:feat/general-chatbot
Open

[Hackathon] feat(agent-service): global AI agent with natural language navigation…#5087
claire687 wants to merge 3 commits into
apache:mainfrom
claire687:feat/general-chatbot

Conversation

@claire687
Copy link
Copy Markdown

@claire687 claire687 commented May 16, 2026

Demo

▶ Full Demo Video


Overview

This PR expands the Texera AI agent into a global AI assistant that lets users perform any action — in any page — using natural language. Users no longer need to manually navigate the UI, configure computing units, or manage workflows. The agent handles everything from a persistent sidebar accessible throughout the entire application.

Key Features

Global Agent Panel

  • The AI agent sidebar is now available on every page of the application (not just the workflow editor)
  • Upload and analyze files from anywhere using natural language in the AI agent
  • Auto-opens on first login with a welcome screen explaining capabilities
  • Collapsed tab visible at the right edge when closed — click to expand

Natural Language Navigation

  • Navigate to any page by asking: "go to my datasets", "take me to the compute page", "show me my workflows"
  • Supported destinations: home, datasets, workflows, compute, quota, projects, hub
  • File listing: asking "what files did I upload?" lists files with formatted names and navigates to the datasets page

Smart File Management

  • Duplicate detection: uploading a file that already exists prompts the user to use the existing version or re-upload — no silent overwrites
  • File switching: loading a different file automatically resets the workflow so operators from the previous file are never mixed in
  • File context is resolved from both explicit properties and the fileContext auto-injection path so reset fires reliably

Zero-Config Workflow Execution

  • Lazy workflow creation: workflows are created on demand when the agent first adds an operator, named after the file being analyzed
  • Auto-provision computing units: if no running unit exists when execution is needed, the agent creates one automatically and polls until ready
  • navigateToWorkflow is always available once the user is logged in — reads workflowId lazily so a workflow created mid-turn is immediately navigable

Clean Response Formatting

  • Results displayed as markdown tables with rounded numbers
  • Each completed analysis includes a "What you can do next" section with 3 specific, actionable suggestions
  • Fuzzy operator matching: unknown operator types return "Did you mean: ScatterMatrixChart?" instead of dumping all 163 type names

Changed Files

Area Files
Agent core agent-service/src/agent/texera-agent.ts
Tools agent-service/src/agent/tools/workflow-crud-tools.ts, workflow-execution-tools.ts
Prompts agent-service/src/agent/prompts.ts
Server agent-service/src/server.ts
Frontend panel agent-panel.component.ts/html/scss
Login redirect local-login.component.ts

Test Plan

  • Upload a file → agent detects duplicates and prompts user choice
  • Ask "analyze this file" → new workflow created, computing unit auto-provisioned, results shown with next-step suggestions
  • Ask "what files did I upload?" → formatted file list shown + navigates to datasets page
  • Switch files mid-session → reset workflow fires, new workflow created for the new file
  • Ask "create a computing unit" → agent asks for name, creates unit, navigates to compute page
  • Navigate to any page via natural language
  • Resize agent panel — stays open throughout drag
  • First login — welcome screen shown, redirects to home page

… and file management

Expands the Texera AI agent into a global chatbot available on every page,
enabling end-to-end natural language interaction without manual navigation.

Agent service changes:
- Global agent with navigate, listWorkflows, listDatasets, listDatasets tools
- Auto-discover and provision computing units for workflow execution
- Lazy workflow creation on first operator add (no upfront workflow required)
- navigateToWorkflow with auto-naming from uploaded filename
- Loop detection for addOperator/modifyOperator repetition (max 3/5 per turn)
- File context persistence across conversation turns (lastSeenFileContext)
- Auto-inject fileName for file-scan operators from file context
- Structured response formatting with markdown, clean next-step suggestions
- Fix inputPorts/outputPorts stripping in execution requests (was causing 400)
- Auto-discover running computing unit; provision new local unit if none exists
- Dataset-specific navigation with dvid query param for version auto-selection
- navigateToWorkflow abort on first call to prevent looping

Frontend changes:
- Global agent panel (AppComponent) visible on every page, Cursor-style sidebar
- Agent panel pushes page content (paddingRight) instead of overlapping
- Sidebar collapses dashboard nav when agent panel opens
- File upload via chat with duplicate detection (Use Existing / Upload New)
- Dataset version auto-selection on navigation via ?dvid= query param
- Onboarding welcome screen for first-time users (agents.length === 0)
- Agent auto-opens on login if no agents exist
- Workflow auto-naming based on uploaded filename
- Navigate to specific dataset page after file upload
- Agent registration no longer forces workflow creation upfront
@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI agent-service labels May 16, 2026
claire687 and others added 2 commits May 15, 2026 18:24
…ering

- Fix checkExistingFile slow-path: tautological condition and over-broad
  includes() caused every agent_upload_* dataset to match any filename.
  Now uses only endsWith(_safeDatasetSuffix) + startsWith(agent_upload_).
- Fix chat table rendering: add display:block + overflow-x:auto on tables
  so wide result tables scroll horizontally instead of squishing columns.
  Add white-space:nowrap to keep numbers on one line, right-align numeric
  cells, and style with light borders for readability.
…improvements

- Agent panel: resizable sidebar (nz-resizable), split isPanelOpen/width to
  prevent panel hiding during resize; fixed _width private access error
- Navigation: agent can navigate any page (datasets, workflows, compute, quota,
  home) via natural language; navigate("datasets") for file listing requests
- File switching: reset workflow when a different file is loaded into an existing
  workflow; resolve fileName from fileContext before reset check fires
- Workflow creation: lazy workflow creation via ensureWorkflow(); navigateToWorkflow
  always available (not gated on workflowId) — reads wid lazily at execution time
- Duplicate detection: fixed false positives; only endsWith(_safeDatasetSuffix)
- Fuzzy match: unknown operator types return "Did you mean: X?" instead of all 163
- Step logging: per-step tool call success/failure logged for easier debugging
- Duplicate broadcast fix: track broadcastedStepIds to prevent double messages
- Post-login redirect: home page instead of workflow page
- Prompts: content discovery rules distinguish "show files" vs "load file"

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-service feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant