Skip to main content

Installation

npm install @reminix/google @google/genai
Requires @google/genai as a peer dependency.

Chat Agent

Use GoogleChatAgent for conversational agents with streaming support.
import { GoogleGenAI } from "@google/genai"
import { GoogleChatAgent } from "@reminix/google"
import { serve } from "@reminix/runtime"

const google = new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY })

const chatbot = new GoogleChatAgent(google, {
  name: "chatbot",
  instructions: "You are a helpful assistant.",
})

serve({ agents: [chatbot] })
The default model is gemini-2.5-flash. Override it with the model option:
const chatbot = new GoogleChatAgent(google, {
  name: "chatbot",
  model: "gemini-2.5-pro",
  instructions: "You are a helpful assistant.",
})

Streaming

Chat agents support streaming out of the box:
import Reminix from "@reminix/sdk"

const client = new Reminix()

const stream = await client.agents.chat("chatbot", {
  messages: [{ role: "user", content: "Hello!" }],
  stream: true,
})

for await (const event of stream) {
  if (event.type === "text_delta") {
    process.stdout.write(event.delta)
  }
}

Task Agent

Use GoogleTaskAgent for structured output with a defined schema.
import { GoogleGenAI } from "@google/genai"
import { GoogleTaskAgent } from "@reminix/google"
import { serve } from "@reminix/runtime"

const google = new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY })

const analyzer = new GoogleTaskAgent(google, {
  name: "analyzer",
  instructions: "Analyze the sentiment of the given text.",
  outputSchema: {
    type: "object",
    properties: {
      sentiment: { type: "string", enum: ["positive", "negative", "neutral"] },
      confidence: { type: "number" },
    },
    required: ["sentiment", "confidence"],
  },
})

serve({ agents: [analyzer] })

Options

The first argument to all Google AI agent constructors is a GoogleGenAI client instance.
name
string
required
Agent name. Used as the endpoint identifier.
model
string
Google AI model to use. Defaults to gemini-2.5-flash.
maxTokens
number
Maximum number of tokens to generate.
instructions
string
System prompt for the model.
description
string
Agent description for discovery and documentation.
outputSchema
JSONSchema
Output schema for task agents. Defines the structured output format.
tags
string[]
Tags for filtering and organizing agents.
metadata
Record<string, unknown>
Additional metadata attached to the agent.

Next steps

Deploying

Ship your Google AI agent to production.

Configuration & Secrets

Where to put your GOOGLE_API_KEY.

OpenAI

Same flow with the OpenAI SDK.

Python: Google AI

The same integration in Python.