Skip to content

Netlify LiquidMetal Integration

The LiquidMetal extension brings SmartBucket, SmartSQL, and SmartMemory to your Netlify projects. With these resources, you can build AI agents that remember conversations, search through documents semantically, and query databases with natural language. The extension provisions all resources and configures environment variables automatically, so you can start building immediately.

Prerequisites

  • Active Netlify account with at least one project
  • LiquidMetal account (create one at liquidmetal.run)

Step 1: Install the Extension

Install the LiquidMetal extension in your Netlify account:

  1. Log in to your Netlify dashboard
  2. Click Extensions in the left sidebar
  3. Search for “LiquidMetal” in the extension marketplace
  4. Click Install on the LiquidMetal extension

Step 2: Create a LiquidMetal API Key

Generate an API key to connect Netlify with your LiquidMetal account:

  1. Log in to liquidmetal.run
  2. Click Settings at the bottom of the left sidebar
  3. Navigate to the API Keys tab
  4. Click Create New Key
  5. Enter a descriptive name (e.g., “Netlify Integration”)
  6. Set audience to All SmartBuckets
  7. Copy the generated API key

Step 3: Configure the Extension

Connect your LiquidMetal account to your Netlify project:

  1. Select your project in Netlify
  2. Click Extensions in the left sidebar
  3. Find LiquidMetal under installed extensions
  4. Click Settings
  5. Paste your API key in the API Key field
  6. Click Save

Step 4: Provision Resources

Create your LiquidMetal resources:

  1. Leave the Application Name field empty to use default values
  2. Click Provision LiquidMetal Resources
  3. Wait for provisioning to complete (typically 30-60 seconds)

The extension creates three resources:

  • SmartBucket - AI-powered object storage with semantic search
  • SmartSQL - Intelligent relational database with natural language queries
  • SmartMemory - Stateful memory for AI agents and workflows

All environment variables are added to your Netlify project automatically.

Step 5: Use LiquidMetal in Your Project

Access your provisioned resources using the LiquidMetal SDK in your serverless functions.

Install the SDK

Add the SDK to your project:

Terminal window
npm install @liquidmetal-ai/lm-raindrop

Environment Variables

The extension configures these environment variables automatically:

  • RAINDROP_APPLICATION_NAME - Your application identifier
  • RAINDROP_APPLICATION_VERSION - Application version identifier
  • RAINDROP_SMARTBUCKET_NAME - Your SmartBucket name
  • RAINDROP_SMARTMEMORY_NAME - SmartMemory instance name
  • RAINDROP_SMARTSQL_NAME - SmartSQL instance name
  • RAINDROP_API_KEY - Your API key for authentication

Example: Search Documents in SmartBucket

Create a serverless function that searches documents in your SmartBucket:

netlify/functions/search-docs.ts
import Raindrop from '@liquidmetal-ai/lm-raindrop';
export async function handler(event) {
// Initialize the Raindrop client with your API key
const client = new Raindrop({
apiKey: process.env.RAINDROP_API_KEY,
});
// Extract search query from request body
const { query } = JSON.parse(event.body);
// Perform semantic search across your SmartBucket
const response = await client.query.chunkSearch({
bucketLocations: [
{ bucket: { name: process.env.RAINDROP_SMARTBUCKET_NAME } }
],
input: query,
requestId: `search-${Date.now()}`, // Unique ID for tracking this search
});
return {
statusCode: 200,
body: JSON.stringify(response.results),
};
}

Example: Store Conversation State

Store conversation context using SmartMemory:

netlify/functions/chat.ts
import Raindrop from '@liquidmetal-ai/lm-raindrop';
export async function handler(event) {
// Initialize the Raindrop client with your API key
const client = new Raindrop({
apiKey: process.env.RAINDROP_API_KEY,
});
// Extract message content and session ID from request
const { message, sessionId } = JSON.parse(event.body);
// Store the message in SmartMemory for this session
const putMemory = await client.putMemory.create({
content: message,
sessionId: sessionId,
smartMemoryLocation: {
smart_memory: {
name: process.env.RAINDROP_SMARTMEMORY_NAME,
application_name: process.env.RAINDROP_APPLICATION_NAME,
version: process.env.RAINDROP_APPLICATION_VERSION,
},
},
});
// Return the unique memory ID for this stored message
return {
statusCode: 200,
body: JSON.stringify({ memoryId: putMemory.memoryId }),
};
}

Next Steps

Explore the full capabilities of your LiquidMetal resources: