Antigravity Agent

Antigravity एजेंट, Gemini API पर मैनेज किया गया एक सामान्य एजेंट है. एपीआई के लिए एक कॉल करने पर, आपको एक ऐसा एजेंट मिलता है जो Google के होस्ट किए गए, सुरक्षित Linux सैंडबॉक्स में काम करता है. यह एजेंट, कोड को समझता है, उसे चलाता है, फ़ाइलें मैनेज करता है, और वेब ब्राउज़ करता है.

यह Gemini 3.5 Flash पर काम करता है और Antigravity IDE की तरह ही काम करता है. इसका इस्तेमाल, Interactions API और Google AI Studio के ज़रिए किया जा सकता है.

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Read Hacker News, summarize the top 10 stories, and save the results as a PDF.",
    environment="remote",
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Read Hacker News, summarize the top 10 stories, and save the results as a PDF.",
    environment: "remote",
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
    "agent": "antigravity-preview-05-2026",
    "input": "Read Hacker News, summarize the top 10 stories, and save the results as a PDF.",
    "environment": "remote"
}'

क्षमताएं

हर कॉल से एक Linux सैंडबॉक्स उपलब्ध कराया जा सकता है. साथ ही, टूल के इस्तेमाल का लूप शुरू किया जा सकता है. एजेंट, प्लान बनाता है, काम करता है, नतीजों को देखता है, और टास्क पूरा होने तक इस प्रोसेस को दोहराता है.

  • कोड चलाना: Bash, Python, और Node.js कमांड चलाएं. पैकेज इंस्टॉल करें, टेस्ट चलाएं, ऐप्लिकेशन बनाएं.
  • फ़ाइल मैनेजमेंट: सैंडबॉक्स में फ़ाइलें पढ़ें, लिखें, उनमें बदलाव करें, खोजें, और उनकी सूची बनाएं. इंटरैक्शन के दौरान, फ़ाइलें बनी रहती हैं.
  • वेब ऐक्सेस: डेटा के लिए Google Search और यूआरएल फ़ेच करना.
  • कॉन्टेक्स्ट कंपैक्शन: लंबे समय तक चलने वाले, मल्टी-टर्न सेशन के लिए, कॉन्टेक्स्ट को बनाए रखने या टोकन की सीमा तक पहुंचने से बचने के लिए, कॉन्टेक्स्ट कंपैक्शन की सुविधा अपने-आप काम करती है. यह सुविधा, ~1,35,000 टोकन पर ट्रिगर होती है.

मल्टी-टर्न इस्तेमाल और स्ट्रीमिंग के बारे में जानने के लिए, क्विकस्टार्ट देखें.

इन टूल का इस्तेमाल किया जा सकता है

डिफ़ॉल्ट रूप से, एजेंट के पास code_execution, google_search, और url_context का ऐक्सेस होता है. environment पैरामीटर तय करने पर, फ़ाइल सिस्टम के टूल अपने-आप चालू हो जाते हैं. डिफ़ॉल्ट सेट को पसंद के मुताबिक बनाने या उस पर पाबंदी लगाने के लिए, आपको सिर्फ़ tools पैरामीटर तय करना होगा:

टूल वैल्यू का टाइप ब्यौरा
कोड चलाना code_execution stdout/stderr कैप्चर के साथ, शेल कमांड (bash, Python, Node) चलाएं.
Google Search google_search सार्वजनिक वेब पर खोजें.
यूआरएल का कॉन्टेक्स्ट url_context वेब पेज फ़ेच करें और उन्हें पढ़ें.
फ़ाइल सिस्टम (यह सुविधा, environment पैरामीटर तय करने पर चालू होती है) सैंडबॉक्स में फ़ाइलें पढ़ें, लिखें, उनमें बदलाव करें, खोजें, और उनकी सूची बनाएं. इसके लिए कोई अलग टूल टाइप नहीं है. environment पैरामीटर सेट करने पर, यह सुविधा अपने-आप चालू हो जाती है.

एजेंट को सिर्फ़ कुछ टूल तक सीमित करने के लिए, सिर्फ़ वे टूल पास करें जिनकी आपको ज़रूरत है:

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Search for the latest AI research papers on reasoning and summarize them.",
    environment="remote",
    tools=[
        {"type": "google_search"},
        {"type": "url_context"},
    ],
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Search for the latest AI research papers on reasoning and summarize them.",
    environment: "remote",
    tools: [
        { type: "google_search" },
        { type: "url_context" },
    ],
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
    "agent": "antigravity-preview-05-2026",
    "input": "Search for the latest AI research papers on reasoning and summarize them.",
    "environment": "remote",
    "tools": [
        {"type": "google_search"},
        {"type": "url_context"}
    ]
}'

मल्टीमोडल इनपुट

Antigravity एजेंट, मल्टीमोडल इनपुट के साथ काम करता है. फ़िलहाल, सिर्फ़ text और image इनपुट के साथ काम करता है. इमेज को, इनलाइन base64-encoded स्ट्रिंग (data) के तौर पर उपलब्ध कराया जाना चाहिए.

Python

import base64
from google import genai

client = genai.Client()

with open("path/to/chart.png", "rb") as f:
    image_bytes = f.read()

interaction_inline = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input=[
        {"type": "text", "text": "Analyze this chart and summarize the trends."},
        {
            "type": "image",
            "data": base64.b64encode(image_bytes).decode("utf-8"),
            "mime_type": "image/png",
        },
    ],
    environment="remote",
)

JavaScript


import { GoogleGenAI } from "@google/genai";

import * as fs from "node:fs";

const client = new GoogleGenAI({});
const base64Image = fs.readFileSync("path/to/chart.png", { encoding: "base64" });

const interactionInline = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: [
        { type: "text", text: "Analyze this chart and summarize the trends." },
        {
            type: "image",
            data: base64Image,
            mime_type: "image/png",
        },
    ],
    environment: "remote",
}, { timeout: 300000 });

REST

BASE64_IMAGE=$(base64 -w0 /path/to/chart.png)

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d "{
    \"agent\": \"antigravity-preview-05-2026\",
    \"input\": [
        {\"type\": \"text\", \"text\": \"Analyze this chart and summarize the trends.\"},
        {
            \"type\": \"image\",
            \"mime_type\": \"image/png\",
            \"data\": \"$BASE64_IMAGE\"
        }
    ],
    \"environment\": \"remote\"
}"

सिस्टम के निर्देश

इनलाइन प्रॉम्प्ट के लिए, system_instruction का इस्तेमाल करके एजेंट के व्यवहार को पसंद के मुताबिक बनाएं. इसके अलावा, एनवायरमेंट में निर्देश वाली फ़ाइलें माउंट करके भी एजेंट के व्यवहार को पसंद के मुताबिक बनाया जा सकता है:

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Analyze the uploaded CSV and create a report.",
    environment="remote",
    system_instruction="You are a data analyst. Always include visualizations and export results as PDF.",
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Analyze the uploaded CSV and create a report.",
    environment: "remote",
    system_instruction: "You are a data analyst. Always include visualizations and export results as PDF.",
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
    "agent": "antigravity-preview-05-2026",
    "input": "Analyze the uploaded CSV and create a report.",
    "environment": "remote",
    "system_instruction": "You are a data analyst. Always include visualizations and export results as PDF."
}'

एजेंट, एनवायरमेंट से निर्देश वाली फ़ाइलें अपने-आप लोड करता है:

  • AGENTS.md: इसे .agents/ या वर्कस्पेस के रूट में मिलने पर, सिस्टम के निर्देशों के तौर पर जोड़ा जाता है.
  • SKILL.md: इसे .agents/skills/ से लोड किया जाता है और एजेंट की उन क्षमताओं के तौर पर रजिस्टर किया जाता है जिन्हें वह इस्तेमाल कर सकता है.

उदाहरण के लिए:

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Analyze the Q1 revenue data and create a slide deck.",
    environment={
        "type": "remote",
        "sources": [
            {
                "type": "inline",
                "target": ".agents/AGENTS.md",
                "content": "You are a data analyst. Always use matplotlib for charts.",
            },
            {
                "type": "inline",
                "target": ".agents/skills/slide-maker/SKILL.md",
                "content": "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks...",
            },
        ],
    },
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Analyze the Q1 revenue data and create a slide deck.",
    environment: {
        type: "remote",
        sources: [
            {
                type: "inline",
                target: ".agents/AGENTS.md",
                content: "You are a data analyst. Always use matplotlib for charts.",
            },
            {
                type: "inline",
                target: ".agents/skills/slide-maker/SKILL.md",
                content: "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks...",
            },
        ],
    },
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $API_KEY" \
-d '{
    "agent": "antigravity-preview-05-2026",
    "input": "Analyze the Q1 revenue data and create a slide deck.",
    "environment": {
        "type": "remote",
        "sources": [
            {
                "type": "inline",
                "target": ".agents/AGENTS.md",
                "content": "You are a data analyst. Always use matplotlib for charts."
            },
            {
                "type": "inline",
                "target": ".agents/skills/slide-maker/SKILL.md",
                "content": "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks..."
            }
        ]
    }
}'

एजेंट की पूरी परिभाषा के फ़ॉर्मैट और नाम वाले ऐसे एजेंटों के बारे में जानने के लिए, जिन्हें दोबारा इस्तेमाल किया जा सकता है, कस्टम एजेंट बनाना लेख पढ़ें.

एनवायरमेंट

हर कॉल से एक Linux सैंडबॉक्स बनता है या किसी मौजूदा सैंडबॉक्स का दोबारा इस्तेमाल किया जाता है. environment पैरामीटर के तीन फ़ॉर्म होते हैं:

फ़ॉर्म ब्यौरा
"remote" डिफ़ॉल्ट सेटिंग के साथ एक नया सैंडबॉक्स उपलब्ध कराएं.
"env_abc123" आईडी के हिसाब से, किसी मौजूदा एनवायरमेंट का दोबारा इस्तेमाल करें. इससे सभी फ़ाइलें और स्टेट बनी रहती हैं.
{...} कस्टम सोर्स और नेटवर्क के नियमों के साथ, पूरा EnvironmentConfig.

सोर्स (Git, GCS, इनलाइन), नेटवर्किंग, लाइफ़साइकल, और संसाधन की सीमाओं के बारे में ज़्यादा जानने के लिए, एनवायरमेंट देखें.

उपलब्धता और कीमत

Antigravity एजेंट, Google AI Studio और Gemini API में, Interactions API के ज़रिए झलक के तौर पर उपलब्ध है.

कीमत, इस्तेमाल के हिसाब से पेमेंट करने वाले मॉडल पर आधारित होती है. यह मॉडल, Gemini के मॉडल के टोकन और एजेंट के इस्तेमाल किए जाने वाले टूल पर आधारित होता है. चैट के सामान्य अनुरोध से सिर्फ़ एक आउटपुट मिलता है. हालांकि, Antigravity एजेंट के साथ इंटरैक्शन, एजेंटिक वर्कफ़्लो होता है. एक अनुरोध से, तर्क करने, टूल चलाने, कोड रन करने, और फ़ाइल मैनेजमेंट का एक ऑटोनॉमस लूप ट्रिगर होता है.

अनुमानित लागत

टास्क की जटिलता के हिसाब से लागत अलग-अलग होती है. एजेंट, अपने-आप यह तय करता है कि टूल के कितने कॉल, कोड के कितने रन, और फ़ाइल के कितने ऑपरेशन की ज़रूरत है. यहां दिए गए अनुमान, रन के आधार पर हैं.

टास्क की कैटगरी इनपुट टोकन आउटपुट टोकन औसत लागत के बराबर
रिसर्च और जानकारी को एक साथ लाना 1,00,000–5,00,000 10,000–40,000 0.30–1.00 डॉलर
दस्तावेज़ और कॉन्टेंट जनरेट करना 1,00,000–5,00,000 15,000–50,000 0.30–1.30 डॉलर
प्रोसेस और सिस्टम डिज़ाइन करना 1,00,000–4,00,000 10,000–30,000 0.25–0.80 डॉलर
डेटा प्रोसेस करना और उसका विश्लेषण करना 3,00,000–30,00,000 30,000–1,50,000 0.70–3.25 डॉलर

आम तौर पर, 50–70% इनपुट टोकन कैश किए जाते हैं. कई टूल कॉल वाले जटिल एजेंटिक वर्कफ़्लो में, एक इंटरैक्शन में 30–50 लाख टोकन इकट्ठा किए जा सकते हैं. इसकी लागत, करीब 5 डॉलर तक हो सकती है.

झलक के दौरान, एनवायरमेंट कंप्यूट (सीपीयू, मेमोरी, सैंडबॉक्स एक्ज़ीक्यूशन) के लिए कोई शुल्क नहीं लिया जाता.

सीमाएं

  • झलक की स्थिति: Antigravity एजेंट और Interactions API, झलक के तौर पर उपलब्ध हैं. इनकी सुविधाएं और स्कीमा बदल सकते हैं.
  • जनरेशन कॉन्फ़िगरेशन के साथ काम न करने वाले पैरामीटर: ये पैरामीटर काम नहीं करते. साथ ही, इनसे 400 गड़बड़ी दिखती है: temperature, top_p, top_k, stop_sequences, max_output_tokens.
  • स्ट्रक्चर्ड आउटपुट: Antigravity एजेंट, स्ट्रक्चर्ड आउटपुट के साथ काम नहीं करता.
  • उपलब्ध न होने वाले टूल: फ़िलहाल, file_search, computer_use, google_maps, function_calling, और mcp के साथ काम नहीं करता.
  • फ़ाइल सिस्टम टूल: फ़िलहाल, फ़ाइल सिस्टम टूल उपलब्ध नहीं है. यह environment का हिस्सा है.
  • बैकग्राउंड: एजेंट, background=True के साथ काम नहीं करता. इसके लिए, store=True की ज़रूरत होती है.
  • मल्टीमोडल टाइप के साथ काम न करने वाले पैरामीटर. फ़िलहाल, ऑडियो, वीडियो, और दस्तावेज़ इनपुट के साथ काम नहीं करता. सिर्फ़ टेक्स्ट और इमेज का इस्तेमाल किया जा सकता है.

आगे क्या करना है