Multi-Tenancy
GurzBrain es multi-tenant por diseño. Cada instalación tiene su propio tenant_id + api_key, con datos aislados y cuotas por plan.
Crear tenant nuevo
Via artisan:
php artisan tinker --execute="
use App\GurzBrain\Services\TenantService;
print_r(TenantService::create([
'name' => 'Acme Corp',
'owner_email' => '[email protected]',
'plan' => 'starter',
'opt_in_telemetry' => true,
]));
"
Output:
Array
(
[tenant_id] => 7
[slug] => acme-corp
[api_key] => gbr_live_[40 random chars] # mostrado 1 sola vez
[next_step] => Configurar GurzBrain client con: GURZBRAIN_API_KEY=gbr_live_...
)
Datos scope por tenant
Scoped a tenant_id:
- conversations — chats del agent
- approvals — pendientes y resueltos
- audit_log — toda acción agentic
- memory_entries — feedback/project files
Compartidos globalmente:
- web_knowledge — RAG web nutrition (opt-in sí alimenta)
- Model weights — nunca salen del infra central
Planes
| Plan | Quota mensual | Features extra |
|---|---|---|
| Free | 500 prompts | 1 persona, no fine-tune |
| Starter | 5,000 | 5 personas, basic tools |
| Pro | 50,000 | All personas, all tools, approvals UI |
| Business | 500,000 | Priority support, custom personas |
| Enterprise | Ilimitado | SLA 99.9%, dedicated model, SSO |
Revocar API key
php artisan tinker --execute="
App\GurzBrain\Services\TenantService::revokeApiKey('gbr_live_abc1');
"
Phone-home
Cliente debe llamar /v1/license/check cada 24h. Si no responde en 72h, el cliente se bloquea localmente. Esto previene uso después de revoke.