ByteChef LogoByteChef
Embedded

Component Kit

A Java SDK that turns a connected user's component actions into AI tools your own LLM application can call.

AI ComponentKit is a backend Java SDK for AI-native products: it fetches the component actions a connected user has access to and exposes them as tools your own LLM application can call — so your agent acts through the user's ByteChef connections without you writing per-integration glue.

The tools it returns are the connected user's component actions — not their workflows. To let an agent run a whole workflow instead, expose the workflow through an MCP server or trigger it with an App Event.

ToolClient

The core client wraps the embedded execution API:

ToolClient toolClient = new ToolClient(apiKey, "https://your-bytechef-host.example.com", Environment.DEVELOPMENT);

// The connected user's available actions, as tool definitions (name, description, JSON-schema parameters),
// grouped by the component they belong to.
Map<String, List<ToolModel>> toolsByComponent = toolClient.getTools(externalUserId);

// Execute one tool with the connected user's own credentials.
Object result = toolClient.executeTool(externalUserId, toolName, Map.of(/* parameters */));
  • Authentication is an embedded API key (Authorization: Bearer), created under Embedded → Settings → API Keys.
  • Environment selects the target environment (DEVELOPMENT, STAGING, PRODUCTION), sent as the X-Environment header.
  • getTools fetches from GET /api/embedded/v1/{externalUserId}/tools and returns the tools keyed by component name; executeTool POSTs { "name": ..., "parameters": ... } to the matching /tools endpoint — each call runs the component action with the connected user's own credentials.

Spring AI integration

The ai-componentkit-spring module adapts the client to Spring AI, so the user's actions plug straight into a ChatClient as tools:

ToolCallbackProvider toolCallbackProvider = toolCallbackProviderFactory.create(externalUserId, Environment.PRODUCTION);

chatClient.prompt(userMessage)
    .toolCallbacks(toolCallbackProvider)
    .call();

The LLM now sees every action the user has connected — send a Slack message, create a CRM contact — and invocations execute server-side in ByteChef under that user's connections.

ComponentKit in the Sample App

The Sample App includes a "ComponentKit Playground" and a tool-based AI chat page that demonstrate this exact flow end to end.

Sample projects

How is this guide?

Last updated on

On this page