In-app AI Agent

Give your product's AI agent the ability to interact with your customers' connected apps. Membrane provides the tools — your agent uses them to read data, create records, send messages, and more across any connected app.

Getting Started

  1. Complete the Product Integrations Quickstart.
  2. Ask your coding agent to build the agent tooling:

"Give our AI assistant tools from our customers' connected apps using Membrane. Use static tools loaded at session start."

If you want to learn how it works under the hood — read on.

Approaches

Static Tools

Load a fixed set of tools from the customer's connections at the start of the session. Best when you know what the agent needs upfront.

When to use:

  • The toolset is small and predictable
  • You want to leverage LLM context caching
  • Tools don't change during the session

How it works:

  1. List the customer's connections.
  2. Get available actions for the relevant connections.
  3. Pass the actions as tools to your LLM.
// Get tools from a customer's HubSpot connection
const actions = await membrane.connection(connectionId).actions.find()

// Convert to LLM tool format
const tools = actions.items.map(action => ({
  name: action.key,
  description: action.name,
  parameters: action.inputSchema
}))

Dynamic Tools

Let the agent discover and load tools on-demand during a conversation. Best for large tool catalogs or when tools depend on context.

When to use:

  • Hundreds or thousands of possible tools
  • Tools depend on user intent or conversation context
  • Users may connect new apps mid-session

How it works:

Give your agent two meta-tools:

  1. Search actions — find relevant tools by intent
  2. Run action — execute a discovered tool
// Agent searches for relevant tools
const results = await membrane.actions.search({
  query: 'create a contact in CRM',
  connectionId: connectionId
})

// Agent runs the selected action
const result = await membrane.action(results[0].id).run({
  email: '[email protected]',
  firstName: 'Jane'
})

The agent dynamically discovers what it can do instead of loading everything upfront.