AI LEAD SCORING FOR TWENTY CRM
Lead Scoring Agent for Twenty CRM
A free, open-source Twenty app that scores every person and opportunity from 0 to 100 and says why in a sentence or two. Open the view sorted by score and work the best leads first.
Overview
Twenty has no built-in way to tell a rep which new lead deserves a call first. New people and opportunities arrive as flat rows, and the rep works them in the order they landed or opens each one to guess. That gets slower as volume grows, and the hot lead waits behind the cold ones.
The Lead Scoring Agent adds four fields to People and Opportunities: the score, a short reason, when it was scored and a status. Two ready-made views, People by Lead Score and Opportunities by Lead Score, list the highest scores at the top. The reason sits next to the number so a rep can judge whether to trust it.
I built it because the Twenty SDK documentation uses lead scoring as its example agent but ships nothing you can install. The code is on GitHub and the package is on npm.
Twenty server 2.49 or later, Cloud or self-hosted
A default AI model set in Settings, AI
Free and MIT licensed
One AI call per scored record, billed to your Twenty AI credits or your own provider
Records with nothing to judge are skipped and cost nothing
How It Works
A lead created by hand or through the API is scored inline, so the number is there by the time the rep looks. An edit that changes what matters triggers a re-score: job title, company or email for a person, and amount, stage or close date for a deal.
A CSV import of thousands of rows would otherwise fire thousands of AI calls at once. Imported records are marked queued instead, and a one-minute job scores 20 per object per run. Records that existed before install are queued the same way.
If the workspace is out of AI credits, records stay queued and are scored when credits return, instead of failing. A genuine error marks the record failed with the reason in the summary field, and the status page can re-queue it.
Fit (seniority, title, company), intent (stage, amount, recent activity) and how complete the record is. The agent is told to use only the data it was given and to score conservatively when key fields are missing.
The Lead Scoring Agent page shows how many People and Opportunities are scored, queued, skipped or failed, with a button to queue anything not yet scored.
The app reads People, Companies, Opportunities and timeline activity, and updates only People and Opportunities. It has no delete permission, holds no API keys and calls no outside service.
Install
Open Settings, Applications, Marketplace, find Lead Scoring Agent and click Install. If it is not listed, open the filter and turn on Show unlisted apps.
Make sure the workspace has a default AI model under Settings, AI. Nothing else needs configuring.
npx twenty@latest auth login --url https://<your-workspace>.twenty.com
npx twenty@latest app install \
--universal-identifier 94f2e86e-62e5-4695-b4e8-50059cd7db30Self-hosted servers pick up npm-published apps with the catalog sync. See the README for the full details.
Design Decisions
My first plan was to count how many records were created in the last few seconds and call it a bulk import above some threshold. It adds a query to every event and misjudges small imports. Every Twenty record carries a created-by source, and importing sets it to IMPORT, so the handler routes on that field instead.
Structured agent output has to be a flat schema, so several records cannot share one call. Cost is roughly one call per scorable record however you trigger it. The queue limits how fast calls happen, and the skip rule and the field-scoped triggers limit how many.
Update triggers watch business fields only. The score, summary, time and status fields are not on the list, so writing a result cannot start another scoring run.
Two bugs only showed up on a real workspace: existing records were never scored because events only fire for new data, and recent activity was silently missing after Twenty renamed a timeline field. Both are fixed and covered by tests, and the changelog lists them.
Privacy
The only thing that leaves your workspace is the scoring prompt, sent through Twenty's AI service to your default model. For a person that is name, job title, primary email, LinkedIn URL and the company's name, domain and city. For an opportunity it is name, amount, stage, close date and the company's name and domain. Both also send the event names of the 10 most recent timeline entries, such as noteLinked, and never their content.
Email bodies, notes and attachments are not sent. The score, summary, time and status live on the record in your workspace, and the app keeps no other copy. Uninstalling removes the four fields and their values.
Frequently Asked Questions
Related Projects
Notes
Lead Scoring Agent is an independent project. Twenty is a trademark of its owners, and this app is not affiliated with or endorsed by them.
Bug reports and questions go to the GitHub issue tracker. If you want this set up or adapted for your own Twenty workspace, get in touch.
Try It on Your Workspace
Install the app, let it score your existing records, then open People by Lead Score