Skip to content

[DNM] feat(appkit): add AgentPlugin and ChatUIPlugin for LangChain/LangGraph agents (POC)#138

Open
smurching wants to merge 1 commit intodatabricks:mainfrom
smurching:smurching/agent-plugin-poc
Open

[DNM] feat(appkit): add AgentPlugin and ChatUIPlugin for LangChain/LangGraph agents (POC)#138
smurching wants to merge 1 commit intodatabricks:mainfrom
smurching:smurching/agent-plugin-poc

Conversation

@smurching
Copy link

@smurching smurching commented Feb 26, 2026

Summary

POC implementing the agent plugin plan. Promotes the LangChain/LangGraph agent pattern from app-templates/agent-langchain-ts into first-class AppKit SDK plugins.

  • AgentPlugin (packages/appkit/src/plugins/agent/) — sets up a LangGraph ReAct agent (ChatDatabricks + optional MCP tools), streams responses in Responses API SSE format at POST /api/agent and registers POST /invocations at the app root (Databricks serving convention)
  • ChatUIPlugin (packages/appkit/src/plugins/chat-ui/) — dynamically mounts a pre-built chat UI Express app as a sub-application
  • Framework: added optional injectAppRoutes?(app) hook to Plugin base class; ServerPlugin calls it after mounting all /api/* routers
  • New deps: @databricks/langchainjs, @langchain/core, @langchain/langgraph, @langchain/mcp-adapters

Usage

import { createApp, server, agent, chatUI } from '@databricks/appkit';

createApp({
  plugins: [
    server(),
    agent({
      model: 'databricks-claude-sonnet-4-5',
      systemPrompt: 'You are a helpful Databricks data assistant.',
      mcpServers: [/* optional MCP servers */],
    }),
    chatUI({ enablePersistence: false }),
  ],
});
// POST /api/agent — standard appkit endpoint
// POST /invocations — always registered (Databricks bundle compatibility)

Test plan

  • TypeScript typecheck passes (pnpm typecheck)
  • All 957 existing tests pass (pnpm test)
  • Manual end-to-end: run dev playground with ENABLE_AGENT_EXAMPLE=true and test chat UI in browser

🤖 Generated with Claude Code

…h agents

Promotes the agent pattern from app-templates/agent-langchain-ts into
first-class appkit SDK plugins so any Databricks app developer can build
AI agent apps using the same declarative, plugin-first pattern.

New plugins (packages/appkit/src/plugins/agent/, chat-ui/):
- AgentPlugin: sets up a LangGraph ReAct agent (ChatDatabricks + MCP tools),
  streams responses in Responses API SSE format at POST /api/agent (standard
  appkit route) and POST /invocations (Databricks serving convention)
- ChatUIPlugin: dynamically mounts a pre-built chat UI Express app as a
  sub-application under /api/chatUI

Framework changes:
- Plugin base class: add optional injectAppRoutes?(app) for root-level routes
- ServerPlugin: call injectAppRoutes on each plugin after /api/* mounts
- New deps: @databricks/langchainjs, @langchain/core, @langchain/langgraph,
  @langchain/mcp-adapters

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sid Murching <sid.murching@databricks.com>
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