ercogx/filament-openai-assistant
Filament plugin that adds an OpenAI Assistant chat page to your admin panel. Supports multiple assistants and threads, dark mode, configurable env settings, and customizable pages and views.
The package is a small Filament plugin that registers a chat page backed by OpenAI Assistants. The setup path is short, but you should treat it as a vendored snippet rather than an actively maintained dependency — it is archived, so read the source after installing.
Install and publish everything in one pass:
composer require ercogx/filament-openai-assistant
php artisan vendor:publish --tag="filament-openai-assistant-migrations"
php artisan vendor:publish --tag="filament-openai-assistant-config"
Publish the migration before running php artisan migrate, and adjust the user foreign key in the migration first if your auth model is not \App\Models\User.
Configure credentials: set OPENAI_API_KEY, OPENAI_ASSISTANT_ID, and OPENAI_ASSISTANT_NAME in .env. The assistant ID comes from the OpenAI dashboard (asst_...), not the assistant's display name — getting these swapped is the most common first-run failure.
Register the plugin on your panel in the panel provider's panel() method, following the README's snippet. Then php artisan filament:optimize-clear or hard-refresh; the chat page appears as a navigation item.
Where to look first:
config/filament-openai-assistant.php — the assistants array is the real extension point.vendor/ercogx/filament-openai-assistant/src — because it's archived, the source is the documentation for anything the README omits.First use case: an internal admin-panel assistant for staff. It is a good fit for a single-tenant, low-traffic back office where the chat lives behind Filament auth and the assistant answers questions about your own documented processes. It is a poor fit for anything customer-facing or high-volume.
Multiple assistants as named personas. The assistants array in the config is the cleanest surface for differentiating behaviour. Define one entry per OpenAI assistant ID with its own display name, e.g. a "Support" assistant and a "Docs" assistant. Each entry maps to a distinct OpenAI assistant, so prompt engineering and file/RAG setup happen in OpenAI, not in Laravel. Keep the config reading from env (OPENAI_ASSISTANT_ID_SUPPORT, etc.) so different environments can point at sandbox assistants.
Multi-panel registration. Register the plugin only on the panels that need it rather than globally. Registering on an admin panel and a separate staff panel gives you independent access control through Filament's existing authorization, which is a better pattern than building a permission layer inside the plugin.
Per-user thread isolation. The persisted threads are keyed to the authenticated user. The natural workflow is: let the migration own thread storage, and query it (via the package's models or your own read-only queries) when you need audit or export. Do not duplicate thread state in your own tables — you will desync from OpenAI's own thread state.
Overriding the auth model. If you use a non-default user model, change the foreign key in the migration and the relevant reference in the published config before the first migrate. Doing this after the fact means a follow-up migration; doing it after real data exists means a data migration.
Composing with existing Filament pages. Treat the chat page as a supplementary tool: pair it with your resource pages rather than replacing them. The most durable pattern is a "help" assistant scoped to documentation, sitting alongside the CRUD pages — not an assistant expected to take actions. The plugin does not expose tool-calling or function workflows, so don't design around write operations.
Cost and usage control. Because there is no built-in throttling visible in the README, wrap usage in Filament's existing access control: restrict the page to specific roles, and consider adding a rate limiter at the middleware or canAccess() level. Log token usage from the OpenAI dashboard side rather than assuming the plugin surfaces it.
The package is archived — budget for ownership. No upstream fixes, no Filament major-version compatibility work, no security patches. Before adopting, verify it installs against your Filament version. If it doesn't, the realistic path is copying the plugin's page and models into your app as first-party code rather than fighting a dead dependency.
Pin the dependency. Use an explicit version constraint in composer.json. An unconstrained ^1.0 on an abandoned package is a latent breakage when someone runs composer update months later.
Migration ordering is a real trap. Publishing the migration and running migrate before editing the user foreign key produces a schema that references the wrong model. If you catch it late, publish the migration again under a modified filename and edit it, or write a corrective migration — don't hand-edit a migration that has already run in shared environments.
Assistant ID vs. name confusion. OPENAI_ASSISTANT_NAME is decorative; only the asst_... ID matters to the API. A wrong name is a cosmetic bug; a wrong ID produces an authentication/not-found error from OpenAI that reads as a credentials problem.
Thread storage is your data. Conversations are persisted per user, which means OpenAI prompts and responses live in your database. Check this against your privacy obligations before pointing it at anything containing customer data, and include the table in your retention/cleanup policy.
Dark mode and styling. Dark mode is supported out of the box, but if you have a custom Filament theme with overridden CSS variables, verify the chat view renders correctly. This is a visual check, not a config one — there's no theme option to toggle.
Config caching. After changing the assistants array, run php artisan config:clear in local development. With config cached in production, an env change appears to do nothing — a classic false-negative when debugging "the wrong assistant responded."
Debugging strategy. Errors surface either as Filament exceptions or as OpenAI API errors; distinguish them early by checking storage/logs/laravel.log for the HTTP response body. A 401 is the API key, a 404 is a bad assistant ID, and a 429 is quota or rate limiting — the third is the one you cannot fix in code.
Don't build on undocumented internals. With no changelog entries beyond the initial release and no maintainer, treat any class or method not mentioned in the README as private. If you need behaviour the plugin doesn't expose, fork the page into your own Filament page and call the OpenAI API directly — you'll end up with less coupling and a maintainable surface.
How can I help you explore Laravel packages today?