Self-hosting AgentLasso
AgentLasso's core is Apache-2.0: you can run it on your own infrastructure. This guide covers what you need, what works without which keys, and what doesn't work outside the hosted service yet.
Just want to look around?
npm run demoruns the whole app locally on fixed mock data, with no accounts, keys or database. Everything below is for a real install.
What you need
- Node.js ≥ 20.19 or ≥ 22.12. Older versions fail at runtime with a
util.styleTexterror rather than at install time. - A Supabase project (the free tier is fine): Postgres, auth and the API layer.
- Optional: an Anthropic API key for AI intent classification. Traces are processed as they arrive (live or imported); a scheduler is only useful at high volume (see step 4).
1. Install
2. Create the database
- Create a project at supabase.com.
- Apply the migrations in
supabase/migrations/in filename order. With the Supabase CLI: Or paste each file into the Supabase SQL editor, oldest first. - Fill in the Supabase section of
.env(Settings → API in Supabase). KeepSUPABASE_SERVICE_ROLE_KEYsecret: it bypasses row-level security. - In Supabase → Authentication → URL Configuration, add your app's URL
(e.g.
http://localhost:8080, the dev server's default) to the redirect URLs, so email confirmation links come back to your install.
The migrations create a demo template project ("Acme Support Agent"). Every new account gets an empty workspace of its own plus a copy of the template as a separate Sample project, so a first-time user can explore a populated app without the example data mixing into their numbers. The template's API key is randomized by a migration, so the key that appears in the repo's history doesn't work on your install.
3. Run it
Sign up with email and password, then open Settings for your project's
API key and a ready-to-run curl command to send your first trace.
Which features need what
Without ANTHROPIC_API_KEY, traces the rules can't place wait (marked
awaiting_llm), and the Semantic Agent Map shows how many. Add a key later and
the next run classifies them.
4. Background processing (no scheduler needed)
Traces are classified and embedded when traffic arrives: after the telemetry endpoint responds, it processes the project's waiting traces in the background. One request per project at a time does the work (a short database lease), so parallel traffic doesn't classify the same traces twice. Small backlogs go to Claude right away; large ones (50+ waiting) go through the cheaper Batch API, and later traffic collects the results.
So there's nothing to schedule. Optionally, at high volume, or to process
waiting traces when no new traffic is coming in, call
POST /api/v1/sync-cluster with Authorization: Bearer <LOVABLE_CRON_SECRET>,
by hand or on a schedule. If your fork is on GitHub, the included
.github/workflows/sync-cluster.yml can do this; set the AGENTLASSO_APP_URL
and LOVABLE_CRON_SECRET repository secrets.
Deploying
npm run build produces a Cloudflare Workers build (the build config's
cloudflare-module preset). Set the variables from .env as Worker
environment variables and secrets.
Other targets (a plain Node server, Docker) aren't supported out of the box yet: the build configuration only offers Cloudflare and a Lovable-internal format. Contributions welcome.
Not available self-hosted (yet)
- AI test generation calls Lovable's AI gateway (
LOVABLE_API_KEY), which only exists on Lovable-hosted deployments. Self-hosted, it shows an explanation instead. - "Continue with Google" goes through Lovable's OAuth broker, so it's hidden on self-hosted installs. Email sign-in works.
Security checklist
- Never commit
.env; it's in.gitignore. SUPABASE_SERVICE_ROLE_KEY,ANTHROPIC_API_KEYandLOVABLE_CRON_SECRETare secrets: set them server-side only.- Leave
AGENT_ENDPOINT_ALLOW_PRIVATEunset if untrusted users can sign up: it lets them make your server call addresses on its own network. - Found a vulnerability? See SECURITY.md.