Skip to content

agi-inc/agisdk-js

Repository files navigation

πŸš€ AGI SDK (JavaScript/TypeScript)

npm version License CI Status TypeScript Node.js

πŸ“„ Paper β€’ πŸ“ Blog β€’ 🏒 AGI Inc β€’ πŸ† Leaderboard β€’ πŸ“š API Docs β€’ πŸ’‘ Examples

Build, evaluate, and level up your AI agents for the real web.


✨ What is AGI SDK?

AGI SDK is a production-ready toolkit for building and evaluating AI browser agents in real-world environments.

It powers REAL Bench: a high-fidelity benchmark for AI agents navigating modern websites like Amazon, DoorDash, Airbnb, and more.

πŸ”Ή Train agents to browse and interact with real apps πŸ”Ή Benchmark agents with robust, standardized tasks πŸ”Ή Submit to the leaderboard and see how your agents stack up!

Features:

  • βœ… Full TypeScript support with complete type definitions
  • βœ… Built-in LLM agent (OpenAI, Anthropic, OpenRouter)
  • βœ… 140+ bundled real-world tasks across 11 website clones
  • βœ… Flexible custom agent API
  • βœ… Production-ready with comprehensive documentation
  • βœ… Leaderboard integration for benchmarking

πŸ› οΈ Installation

# Install the SDK
npm install @theagicompany/agisdk

# Install Playwright browser dependencies
npx playwright install --force

# Set your LLM API key (for LLM-based agents)
export OPENAI_API_KEY="your-api-key"   # or ANTHROPIC_API_KEY, etc.

βœ… Supports OpenAI, Anthropic, OpenRouter, and custom models!

⚑ Quick Start

Using the Built-in Agent

import { REAL } from '@theagicompany/agisdk';

// Set your API key
process.env.OPENAI_API_KEY = 'your-api-key';

// Create agent with built-in LLM
const agent = new REAL.DemoAgent({
    modelName: 'gpt-4o',
    useAxtree: true,
    useScreenshot: true,
});

// Create harness
const harness = new REAL.Harness({
    agent,
    taskName: 'v2.omnizon-1',
    headless: false,
});

// Run task
const results = await harness.run();
console.log(results);

Building a Custom Agent

import { REAL } from '@theagicompany/agisdk';

class MyAgent implements REAL.Agent {
    async getAction(obs: REAL.Observation): Promise<string> {
        // Your custom logic here
        if (obs.url?.includes('product')) {
            return "click('add-to-cart')";
        }
        return "send_msg_to_user('Task complete')";
    }
}

const harness = new REAL.Harness({
    agent: new MyAgent(),
    taskName: 'v2.omnizon-1',
});

const results = await harness.run();

See examples/ for more detailed examples.

πŸ”₯ Features

  • Full-stack web replicas of top real-world apps (Amazon, Uber, Gmail, Airbnb, etc.)
  • Robust agent API: Observations, Actions, Memory, Errors
  • Built-in LLM agent supporting OpenAI, Anthropic, and OpenRouter
  • Customizable harness: plug your own agents
  • TypeScript support: Full type definitions included
  • Bundled tasks: All tasks included in package (no external dependencies)

🌐 Available Tasks

The AGI SDK includes high-fidelity, fully-deterministic websites for agents to explore:

App Clone Task Prefix Example Use Case
πŸ›’ Amazon β†’ Omnizon v2.omnizon-* Buy a laptop, find a gift
πŸ” DoorDash β†’ DashDish v2.dashdish-* Order dinner
✈️ United β†’ FlyUnified v2.flyunified-* Book a flight
🏑 Airbnb β†’ Staynb v2.staynb-* Reserve accommodation
πŸ“… Google Calendar β†’ GoCalendar v2.gocalendar-* Schedule a meeting
πŸ“¬ Gmail β†’ GoMail v2.gomail-* Compose an email
🍽️ OpenTable β†’ OpenDining v2.opendining-* Book a restaurant
πŸ‘” LinkedIn β†’ NetworkIn v2.networkin-* Accept a connection
πŸš— Uber β†’ Udriver v2.udriver-* Book a ride
πŸ’Ό UpWork β†’ TopWork v2.topwork-* Find a freelance gig
🏠 Zillow β†’ Zilloft v2.zilloft-* Browse houses

πŸ“š Documentation

Comprehensive documentation is available:

  • API Reference - Complete API documentation for all classes and methods
  • Task Guide - Understanding tasks, evaluation, and task configuration
  • Agent Guide - Building custom agents and understanding DemoAgent
  • Examples - Working examples with detailed explanations
  • Contributing - Guidelines for contributing to the project
  • Changelog - Version history and release notes

πŸ“– Learning Resources

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Ways to contribute:

  • πŸ“’ Feature requests and ideas
  • πŸ› Bug reports and fixes
  • πŸ“ Documentation improvements
  • πŸ’‘ New examples and tutorials
  • πŸ§ͺ Test coverage improvements

Development setup:

git clone https://github.com/agi-inc/agisdk-js.git
cd agisdk-js
npm install
npm run build

See CONTRIBUTING.md for detailed guidelines.

πŸ’¬ Community & Support

🌟 Show Your Support

If you find this project useful, please consider:

  • ⭐ Starring the repository
  • 🐦 Sharing on social media
  • πŸ“ Writing about your experience
  • 🀝 Contributing to the project

πŸ“„ License

Apache 2.0 - see LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •