Obi

Supercharge your Laravel applications with Google Gemini. Seamlessly integrate LLM function-calling to build intelligent, conversational interfaces that can interact with your application's logic.

Obi Assistant

Online • Powered by Obi

Can you check the stock for "Laptop X"?
Calling `checkStock`...
I checked the inventory. We have 15 units of "Laptop X" available in the main warehouse.
Great, create an order for 5 units.
Calling `createOrder`...
Order #12345 created successfully for 5 units of Laptop X.

How Obi Works

Connect your Laravel app to Gemini in three simple steps.

1

Define

Create tool declarations that map your PHP classes and methods to Gemini functions.

2

Connect

Obi automatically handles the schema generation and communication with Google Gemini API.

3

Execute

Gemini intelligently calls your tools, and Obi executes the code securely within your app.

Official Integration

Powered by Google Gemini

Obi leverages the cutting-edge multimodal capabilities of Gemini 1.5 Pro and Flash to understand complex user intent, reason through problems, and execute precise actions.

1M+
Token Context
Text
& Images
Fast
Inference
JSON
Mode

Automate your workflow

Obi provides a robust engine to build powerful AI agents that can perform real actions in your system reliably and securely.

Gemini Function Calling

Seamlessly integrate Google's Gemini function-calling capabilities into your Laravel application with zero boilerplate interactions.

Typed Declarations

Define tools with type-safe parameter schemas using simple PHP classes. Obi generates definitions automatically.

Multiple Pools

Organize your declarations into multiple pools, making it perfect for modular applications and domain-driven design.

Database Registry

Declarations are built into a database registry for fast O(1) lookup and efficient execution at runtime.

Artisan Commands

Includes handy developer experience commands to scaffold, list, and build your declarations effortlessly.

Simple Facade

Interact with Gemini easily using the semantic Obi::prompt() facade interface.

What can you build with Obi?

From smart assistants to automated data entry, the possibilities are endless.

Smart Customer Support

Build a chatbot that can actually do things. Allow users to check order status, update their profile, or request refunds securely through natural conversation.

  • Check order history
  • Update shipping address
  • Answer FAQs

Admin Dashboard Assistant

Empower your admin staff to query complex data without SQL. "Show me the top selling products from last month" becomes an actionable command.

  • Generate reports
  • Search users by criteria
  • Flag suspicious activity

Automated Workflows

Trigger actions based on unstructured data. Parse incoming emails to create tickets, or analyze user reviews to tag sentiment automatically.

  • Email to Ticket conversion
  • Sentiment analysis
  • Invoice data extraction

Installation & Configuration

Get up and running with Obi in minutes.

1. Install via Composer

composer require obelaw/obi-laravel

2. Publish Config & Run Migrations

php artisan vendor:publish --tag=obi-config
php artisan migrate

3. Configure Environment

Add your Gemini API key to your .env file:

GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-2.5-flash
Developer First

Superior Developer
Experience

Obi is built by Laravel developers for Laravel developers. We prioritize clean syntax, type safety, and seamless integration with the ecosystem you love.

Native PHP Attributes

Use PHP attributes to define tool metadata directly on your classes.

Seamless Injection

Full support for Laravel's dependency injection container in your tools.

Available Commands

  • declaration:make Scaffold a new declaration class
  • declaration:build Parse pools and store in registry
  • obi:declaration:list Show discovered tools
declarations/OrderCountTool.php
use Gemini\Data\FunctionDeclaration;
use Gemini\Data\Schema;
use Gemini\Enums\DataType;
use Obelaw\Obi\Declaration;

return new class extends Declaration
{
  public ?string $tag = 'orders';

  public function declaration(): FunctionDeclaration
  {
    return new FunctionDeclaration(
      name: 'getOrderCount',
      description: 'Gets the count of orders by status.',
      parameters: new Schema(
        type: DataType::OBJECT,
        properties: [
          'status' => new Schema(
            type: DataType::STRING,
            description: 'The order status (pending, completed, cancelled)'
          ),
        ],
        required: ['status']
      )
    );
  }

  public function targetClass(): string
  {
    return \App\Services\OrderService::class;
  }

  public function targetMethod(): string
  {
    return 'getOrderCount';
  }
};
user@laravel: ~/project
user@laravel:~$ php artisan obi:prompt
Obi > Hello! How can I help you today?
You > Check the stock for "Laptop X"
[System] Calling tool: checkStock({"product": "Laptop X"})
Obi > I checked the inventory. We have 15 units of "Laptop X" available in the main warehouse.
You >

Interact via CLI

Test your agents and tools directly from the command line. The obi:prompt command provides an interactive shell to chat with your configured Gemini agent before you build your UI.

  • Instant Feedback Loop

    Iterate on your prompts and tools in real-time.

  • Debug Tool Calls

    See exactly what arguments the LLM is passing to your PHP methods.

  • Interactive Session

    Maintain conversational context during your testing session.

Professional Services

Need a tech consultant to implement Obi?

Our team of certified architects can help you design, build, and deploy complex autonomous agents tailored to your enterprise needs.

Send us a message