agent-setup

Configure the @adonis-agora/agent module in an AdonisJS app with stores, quotas, pricing, and sinks.

1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/DavideCarvalho/adonis-agora-agent --skill agent-setup-davidecarvalho
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-setup
Source: https://github.com/DavideCarvalho/adonis-agora-agent/tree/main/packages/adonis/skills/agent-setup
Command: npx skills add https://github.com/DavideCarvalho/adonis-agora-agent --skill agent-setup-davidecarvalho

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up a governed AI agent in AdonisJS involves many fail-closed defaults — a missing actorResolver turns every route into a 401, an omitted quota silently disables budgeting, and unpriced models make spend rollups read as $0.00. This Skill walks through the full config/agent.ts setup so the agent loop, persistence, budgeting, and /agent/* routes work correctly on the first deploy. ## Core Features & Use Cases - Guided installation and configuration: Runs node ace configure, wires defineConfig with aiSdkModel, Lucid or memory stores, and the AuthActorResolver identity seam. - Governance patterns: Enforces daily token budgets with quotas.ledger, prices turns via pricingStore plus seedModelPrices or the models.dev catalog, and enables multi-replica SSE with tokenSinks.redis. - Common mistake fixes: Diagnoses 401s from the default UnconfiguredActorResolver, fail-open quotas, double-counted usage in custom QuotaStore bump methods, and attachment content-type replacement pitfalls. - Use Case: You installed @adonis-agora/agent and every /agent route returns 401 — the Skill identifies the missing actorResolver and provides the corrected config. ## Quick Start Set up @adonis-agora/agent in my AdonisJS app with a Lucid store, a daily token quota, and seeded model prices for gpt-4o-mini.

Frequently Asked Questions about agent-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up @adonis-agora/agent in an AdonisJS app?▼

Install the package, run node ace configure @adonis-agora/agent, then write config/agent.ts using defineConfig with a model via aiSdkModel, a store such as stores.lucid(), and an AuthActorResolver. Run node ace migration:run or rely on autoCreateTables.

Why do all my AdonisJS agent routes return 401?▼

Every route returns 401 because no actorResolver is configured. The provider installs UnconfiguredActorResolver by default, whose resolve() throws on every request, so add actorResolver: new AuthActorResolver() to your config.

How do I enforce a daily token budget for an AI agent?▼

Configure quota: quotas.ledger({ limitTokens }) in defineConfig. Quotas are opt-in and fail-open when omitted; once set, check() runs before the first model call and over-budget turns throw QuotaExceededError.

Why does my agent spend rollup show $0.00 for a paid model?▼

A $0.00 rollup means no prices were seeded: usage rows persist costUsd as null, but SUM rollups count unpriced rows as zero. Seed rates with seedModelPrices or seedPricesFromModelsDev so estimates fold into costUsd.

Does the agent SSE stream work across multiple replicas?▼

The default sink buffers streams in process memory, so re-attachment only works on the originating pod. Switch to tokenSinks.redis({ ttlSeconds }) with @adonisjs/redis configured, and pair it with durable: true for cross-instance resume.

Do I need to run the agent migration manually?▼

No, the migration is optional. The Lucid store auto-creates its six agent tables on first use since autoCreateTables defaults to true, and the published migration delegates to the same createAgentTables helper so schemas cannot drift.