TypeScriptADK-TS
Deploy

Deploying Your Agent

Deploy your ADK TypeScript agents to production with various cloud platforms

Once you've built and tested your agent using ADK TypeScript, the next step is to deploy it so it can be accessed, queried, and used in production or integrated with other applications.

Deployment Features Coming Soon

Deployment features are currently being ported from the Python version. The deployment tools and CLI commands mentioned below are not yet available in @iqai/adk v0.1.1.

Planned Deployment Options

Your ADK TypeScript agent will be able to be deployed to different environments based on your needs for production readiness or custom flexibility:

Current Status

While deployment features are in development, you can currently:

Manual Deployment

You can manually deploy your agents using standard Node.js deployment patterns:

  1. Agent code: Ensure your agent is in a file called index.ts within your agent directory
  2. Agent export: Your agent variable should be named rootAgent and properly exported
  3. Dependencies: All dependencies are listed in your package.json

Environment Setup

Set your environment variables for Google Cloud integration:

export GOOGLE_CLOUD_PROJECT=your-project-id
export GOOGLE_CLOUD_LOCATION=us-central1

Authenticate with Google Cloud:

gcloud auth login
gcloud config set project your-project-id

Node.js Deployment

For now, you can deploy your agents using standard Node.js hosting platforms:

// example-server.ts
import { LlmAgent, Runner, InMemorySessionService } from "@iqai/adk";
import express from "express";

const app = express();
app.use(express.json());

// Create your agent
const agent = new LlmAgent({
  name: "my-agent",
  description: "A helpful assistant",
  model: "gemini-2.5-flash",
  instruction: "Be helpful and provide clear responses"
});

// Set up session service and runner
const sessionService = new InMemorySessionService();
const runner = new Runner({
  appName: "example-app",
  agent,
  sessionService
});

app.post("/chat", async (req, res) => {
  try {
    const { message, userId = 'default-user' } = req.body;

    // Create or get session
    const sessions = await sessionService.listSessions("example-app", userId);
    let session;
    if (sessions.sessions.length > 0) {
      session = await sessionService.getSession("example-app", userId, sessions.sessions[0].id);
    } else {
      session = await sessionService.createSession("example-app", userId);
    }

    // Run agent
    const events = [];
    for await (const event of runner.runAsync({
      userId,
      sessionId: session.id,
      newMessage: { parts: [{ text: message }] }
    })) {
      if (event.isFinalResponse()) {
        events.push(event);
        break;
      }
    }

    res.json({
      response: events[0]?.content?.parts?.[0]?.text || 'No response',
      sessionId: session.id
    });
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Agent server running on port ${PORT}`);
});

What's Coming

The deployment features will include:

  • ADK CLI: Command-line tools for easy deployment (npx @iqai/adk deploy)
  • Agent Engine Integration: Direct deployment to Google's Agent Engine
  • Container Support: Automated Docker containerization
  • Cloud Run Deployment: One-command deployment to Cloud Run
  • GKE Support: Advanced Kubernetes deployment options

Stay tuned for updates as these features are being actively developed!