Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

React SDK

Embed Amodal agents in your product with two React packages:

  • @amodal/react — High-level components: AmodalProvider, AmodalChat, AmodalAction, and hooks for common agent interactions.
  • @amodal/chat-widget — Standalone chat widget with SSE streaming, theming, and callbacks.

Quick Start

npm install @amodal/react
import { AmodalProvider, AmodalChat } from '@amodal/react'
 
function App() {
  return (
    <AmodalProvider apiUrl="http://localhost:3847">
      <AmodalChat />
    </AmodalProvider>
  )
}

Core SDK

For server-side or non-React usage, the @amodal/core package provides the full runtime:

import { AgentSDK } from '@amodal/core'
 
const sdk = new AgentSDK({
  platformApiUrl: process.env.PLATFORM_API_URL,
  platformApiKey: process.env.PLATFORM_API_KEY,
  orgId: 'org_123',
})
 
await sdk.initialize()
const config = sdk.getConfig()

Runtime Capabilities

The SDK provides out of the box:

  • ReAct loop with configurable max turns and timeout
  • Smart compaction — structured state snapshots across context compression
  • Loop detection — pattern matching + LLM-based detection
  • Tool output masking — backward-scan FIFO that prunes bulky outputs
  • Task dispatch — parallel sub-agent execution with depth limiting
  • Knowledge loading — on-demand KB documents
  • Role-based filtering — tools and skills scoped by role
  • Audit logging — every tool call and session logged
  • SSE streaming — real-time events for web clients
  • MCP support — Model Context Protocol client