Obi gives you the power to build intelligent, conversational agents in your Laravel application using Google's Gemini models. No complex boilerplate, just elegant PHP.
use Gemini\Data\FunctionDeclaration;
use Obelaw\Obi\Declaration;
return new class extends Declaration
{
public function declaration(): FunctionDeclaration
{
return FunctionDeclaration::create(
'checkStock',
'Check availability of a product',
Schema::object([
'sku' => Schema::string('Product SKU to check')
])
);
}
public function targetClass(): string
{
return InventoryService::class;
}
public function targetMethod(): string
{
return 'check';
}
}; Connect your Laravel app to Gemini in three simple steps.
Create tool declarations that map your PHP classes and methods to Gemini functions.
Obi automatically handles the schema generation and communication with Google Gemini API.
Gemini intelligently calls your tools, and Obi executes the code securely within your app.
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.
Obi provides a robust engine to build powerful AI agents that can perform real actions in your system reliably and securely.
Seamlessly integrate Google's Gemini function-calling capabilities into your Laravel application with zero boilerplate interactions.
Define tools with type-safe parameter schemas using simple PHP classes. Obi generates definitions automatically.
Organize your declarations into multiple pools, making it perfect for modular applications and domain-driven design.
Declarations are built into a database registry for fast O(1) lookup and efficient execution at runtime.
Includes handy developer experience commands to scaffold, list, and build your declarations effortlessly.
Interact with Gemini easily using the semantic Obi::prompt()
facade interface.
From smart assistants to automated data entry, the possibilities are endless.
Build a chatbot that can actually do things. Allow users to check order status, update their profile, or request refunds securely through natural conversation.
Empower your admin staff to query complex data without SQL. "Show me the top selling products from last month" becomes an actionable command.
Trigger actions based on unstructured data. Parse incoming emails to create tickets, or analyze user reviews to tag sentiment automatically.
Get up and running with Obi in minutes.
Add your Gemini API key to your .env file:
Obi is built by Laravel developers for Laravel developers. We prioritize clean syntax, type safety, and seamless integration with the ecosystem you love.
Use PHP attributes to define tool metadata directly on your classes.
Full support for Laravel's dependency injection container in your tools.
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.
Iterate on your prompts and tools in real-time.
See exactly what arguments the LLM is passing to your PHP methods.
Maintain conversational context during your testing session.
Our team of certified architects can help you design, build, and deploy complex autonomous agents tailored to your enterprise needs.