filagora / filagora-ai
AI chat, usage records and provider plumbing for Filagora applications.
Requires
- php: ^8.4
- filagora/filagora-core: ^0.2.2
- filament/filament: ^5.0
Requires (Dev)
- filagora/filagora-entitlements: ^0.2.1
- filagora/filagora-search: ^0.2.1
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- orchestra/testbench: ^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
Suggests
- filagora/filagora-entitlements: Answers the access check from entitlement grants. Without it, bind Filagora\Core\Contracts\AccessChecker.
- filagora/filagora-search: Lets the AI features index their content for search by meaning, and fills those indexes with VectorBackfill.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-06 16:47:12 UTC
README
AI plumbing for Filagora applications: chat and embedding providers (Anthropic, OpenAI and OpenAI-compatible endpoints), records of what each call cost and who made it, a usage report, and a member chat that answers from sources the host registers.
Status: early. The API may still change before 1.0.
Install
composer require filagora/filagora-ai php artisan vendor:publish --tag=filagora-ai-config
Register the plugin on a Filament panel:
->plugin(\Filagora\Ai\FilagoraAiPlugin::make())
What it provides today
ChatProviderandEmbeddingProvidercontracts, bound fromfilagora-ai.chat.driverandfilagora-ai.embeddings.driver.- A record of every chat and embedding call (
ai_chat_usages,ai_embedding_usages), costed from the prices in config. php artisan ai:usage-report [--days=30] [--top=15]: spend by feature and by user.- The chat's engine:
AiChatService,ChatRetrievalover registeredRetrievalSources,GroundingPrompt,ChatReplyStreamand a conversation policy. Routes, views and throttles belong to the host. - The ability
filagora.ai.chat(entitlementai_chat.access).
Configuration
config/filagora-ai.php is merged with the host's copy, so list only what differs. Environment variable names (AI_CHAT_DRIVER, ANTHROPIC_API_KEY, AI_EMBEDDINGS_DRIVER and so on) are listed in the file.
Extending
Extend through documented contracts, events and registries. Anything not documented
is @internal.
Testing
composer test