Skip to content

Add agent deployment layer for Workbench services#32

Open
stuart-gano wants to merge 6 commits intomainfrom
multi-agent-architecture-v2
Open

Add agent deployment layer for Workbench services#32
stuart-gano wants to merge 6 commits intomainfrom
multi-agent-architecture-v2

Conversation

@stuart-gano
Copy link
Copy Markdown
Collaborator

Summary

  • Adds an @app_agent deployment layer so each Workbench capability can be deployed as a standalone Databricks agent with A2A discovery, MCP server, and mlflow.genai.evaluate() support
  • Five agents (scorer, analyzer, optimizer, fixer, creator) wrap existing backend/services/ logic via obo_context() auth bridge — no changes to existing code
  • Shared modules handle OBO auth bridging, SP fallback, and Lakebase pool lifecycle
  • Includes architecture doc, GenieRX spec, and agents.yaml deployment config

All additive — existing monolith deployment is unchanged.

Agents

Agent Tools Wraps
scorer 5 scanner.py, lakebase.py
analyzer 5 genie_client.py, sql_executor.py, result_comparator.py
optimizer 3 optimizer.py, genie_creator.py
fixer 2 fix_agent.py
creator 16 create_agent_tools.handle_tool_call()

What this enables

  • Other workspace apps discover and call Workbench capabilities via A2A protocol
  • Each agent gets a free MCP server for tool integration
  • Automated eval pipelines via mlflow.genai.evaluate() against individual agents
  • Independent deployment of individual capabilities

Test plan

  • Verify existing monolith deployment still works (no changes to backend/)
  • Deploy scorer agent standalone, verify /invocations and /health
  • Verify /.well-known/agent.json returns correct agent card
  • Run mlflow.genai.evaluate() against deployed scorer via app_predict_fn()
  • Frontend smoke test through supervisor proxy

This pull request was AI-assisted by Isaac.

Includes project development guide and the GenieRX analysis/recommendation
framework specification.
- Updated line counts (10,178 total backend)
- Documented SP fallback pattern (get_service_principal_client +
  _is_scope_error) added in PR #7 as new integration challenge (#4)
- Documented genie_client.py scope-error retry pattern in pain points
- Updated scorer scaffold with notes on field name changes (space_id/title)
  and space_url addition from PR #6
- Noted SP fallback in get_space_detail from PR #7
…tecture

Add shared utilities and agent-specific modules that solve the 5 integration
challenges identified in the architecture proposal:

1. OBO Auth Bridge (agents/_shared/auth_bridge.py): Context manager that
   bridges @app_agent UserContext into both monolith ContextVar auth and
   databricks-tools-core ContextVars in a single `with` block.

2. Complex Tool Schemas (agents/creator/schemas.py): Pydantic models that
   auto-generate JSON Schema for @app_agent tool registration, replacing
   ~580 lines of hand-written schema in create_agent_tools.py.

3. Frontend Transparent Proxy (agents/supervisor/proxy.py): Ordered route
   table mapping all 28 frontend API paths to sub-agents with SSE stream
   detection and glob support for path parameters.

4. SP Fallback Decorator (agents/_shared/sp_fallback.py): Extracts the
   _is_scope_error + retry-with-SP pattern from genie_client.py into a
   reusable decorator and convenience function.

5. Shared Lakebase Client (agents/_shared/lakebase_client.py): Connection
   pool lifecycle with idempotent DDL per agent and in-memory fallback.

Also updates scorer/app.py and creator/app.py scaffolds to demonstrate
the integration patterns, and updates the proposal doc with concrete
solutions replacing the placeholder descriptions.
Rewrite architecture-proposal.md and CLAUDE.md to position the agent
layer as an enhancement that wraps existing domain logic, not a
migration that replaces it. Existing monolith stays unchanged.

Co-authored-by: Isaac
Replace NotImplementedError stubs with actual implementations:

- scorer: calls scanner.py, lakebase.py for scoring/history/stars
- analyzer: calls genie_client.py, sql_executor.py, result_comparator.py
- optimizer: calls optimizer.py for suggestions, merge, and space creation
- fixer: calls fix_agent.py for patch generation and application
- creator: delegates all 16 tools to create_agent_tools.handle_tool_call()

All agents use obo_context() to bridge auth. No changes to existing
backend services — agents are thin wrappers.

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant