RFC: Agent protocol support for apx apps#142
Open
stuart-gano wants to merge 1 commit intodatabricks-solutions:mainfrom
Open
RFC: Agent protocol support for apx apps#142stuart-gano wants to merge 1 commit intodatabricks-solutions:mainfrom
stuart-gano wants to merge 1 commit intodatabricks-solutions:mainfrom
Conversation
1f32a08 to
e9729f3
Compare
Add first-class agent support to APX — MCP endpoints, A2A discovery, /invocations loop, tool routing, and dev UI (chat, edit, setup wizard). The core agent runtime (tool introspection, LLM loop, MCP server, agent composition patterns) lives in the standalone `apx-agent` package (https://github.com/stuartgano/apx-agent). The APX template addon imports from the package and adds the dev-mode UI layer on top. What this changes: - `apx add agent` scaffolds agent_router.py + dev UI - Tools are plain Python functions with type hints - /invocations, /.well-known/agent.json, /mcp endpoints - Dev UI: /_apx/agent (chat), /_apx/edit (code editor), /_apx/setup (wizard) - create_tool meta-tool for building tools via chat - Example: explain-my-bill-agent with UC Statement Execution API
e9729f3 to
23eb165
Compare
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.
What this is
Agents are the right abstraction for custom domain knowledge in Genie Code. Genie alone can't do everything — it doesn't know your ERP schema, your billing rules, or your internal data model. But an agent can. And if you build that agent as a Databricks App, it shows up automatically in Genie Code as a custom MCP server.
This PR adds the template integration to make that first-class in APX.
Architecture
The agent runtime is a standalone pip package:
apx-agent. It provides:/mcp(stateless HTTP for Genie Code) and/mcp/sse(SSE for Claude Desktop/Cursor)/.well-known/agent.jsonwith tool schemas/invocations— MLflow ResponsesAgent chat endpoint with tool-calling loop/api/tools/<name>routesThis PR adds the thin APX template layer that wires
apx-agentinto theapx add agentscaffold.What this PR changes (~1,400 lines)
Template (
src/apx/templates/addons/agent/)addon.toml— declaresapx-agent>=0.1.0dependency + Python AST edits forDependenciesaliasespyproject.toml.jinja2— project template with[tool.apx.agent]config sectionagent_router.py— scaffolded tool example (what users edit)agent.py— barrel re-export fromapx-agentpackage_dependency.py— ~100-lineLifespanDependencyshim that callsapx_agent.setup_agent()Rust CLI
deploy.rs—apx deploycommand for Databricks Apps deploymentinit.rs— agent addon discovery duringapx initbuild.rs/proxy.rs— agent-aware build and dev proxyRFC doc
docs/rfcs/agent-protocol.md— design rationale and architectureIntegration test
tests/init_integration.rs— verifiesapx init --addons=agentgenerates the right scaffoldThe pattern in 5 lines
APX +
apx-agenthandle the rest: MCP server,/invocationsloop, tool routing, MLflow traces.Where APX fits in the agent stack
uvicorn --reload(instant)MAS is "how you wire agents together." APX is "how you build them."
Test plan
apx add agentgenerates template that imports fromapx-agentmcp-*→ appears in Genie Code MCP server list/mcpstateless HTTP/mcp/sseworks (Claude Desktop, Cursor)/invocationsworks (direct API / MLflow eval)