FusionLayer SDK

Add cross-vendor memory, privacy modes, and multi-model evaluation to any AI app. SDK in development — REST API available for early access.

status SDK in development — REST API available for early access

Memory injection in a few lines

Initialize FusionLayer with your API key and user identifier. Call inject() to get a memory-enriched version of the user's message. Pass it to any vendor. FusionLayer handles retrieval, ranking, and compression.

  • Works with any vendor — Anthropic, OpenAI, Google, and more
  • Privacy mode is a single parameter: 'smart' | 'private' | 'incognito'
  • No schema changes to your existing prompts
  • TypeScript types included
Full SDK reference →

Note: SDK is in development. Code below shows the planned API surface.

// TypeScript — capture and recall context
import { FusionLayerClient, captureEvent, getMode } from '@fusionlayer/sdk'

const client = new FusionLayerClient({
  apiKey: process.env.FL_API_KEY,
})

// Recall relevant context before sending to a vendor
const results = await client.recallContext({
  query: req.body.message,
  limit: 5,
})

// Use enriched context with any vendor
const response = await anthropic.messages.create({
  model: 'claude-sonnet-4-6-20251101',
  system: results.contextBlock,
  messages: [{ role: 'user', content: req.body.message }],
})

// Capture the exchange for future recall
await captureEvent({
  vendor: 'anthropic', client: 'my-app',
  payload_kind: 'response', payload: response.content[0].text,
  mode: getMode(),
}, { apiKey: process.env.FL_API_KEY })

Everything you need, nothing you don't

Method Name Description
async captureEvent() Capture a prompt, response, or tool use to FusionLayer memory. Respects smart / private / incognito mode.
async client.recallContext() Search saved context entries by semantic query. Returns ranked chunks for prompt injection.
async client.saveContext() Explicitly save a decision, note, or entity to memory for future recall.
sync getMode() / setMode() Read or set the capture mode for this session: smart, private, or incognito.
class Auth Login, refresh tokens, and store credentials. Pluggable token store for any runtime.

Pick what you need

@fusionlayer/sdk
Public SDK — auth, capture, context recall, and multi-model eval. Works in any Node.js or edge runtime. SDK in development — REST API available for early access.
Early access via REST API
@fusionlayer/cli
CLI for auth, history import, chat, and local dev. The fl command.
npm install -g @fusionlayer/cli
REST API
Language-agnostic access via api.fusionlayer.app. Full reference in the docs.
api.fusionlayer.app/v1