• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
project logo

valdottown

leads

AI-powered lead qualifying from any data source
Unlisted
Like
leads
Home
Code
7
PROMPT.txt
README.md
agent.ts
dashboard.tsx
db.ts
H
main.ts
testing.ts
Branches
3
Pull requests
Remixes
1
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of simplified branch: v97
View latest version
README.md

Leads

AI-powered lead filtering from any data source.

Getting started

  1. Click Remix
  2. Save your OPENAI_API_KEY as an environment variable
  3. Customize PROMPT.txt
  4. Get the val's HTTP endpoint from main.ts: image.png
  5. Forward leads to the val's HTTP endpoint as a POST request.
  6. That's it! You now have a growing leads sqlite table with one column for your original input_data and second column for the AI evaluator's output_data.

How it works

  • When a new lead comes in via POST, it is sent to the OpenAI agent in agent.ts.
  • The agent uses web search and the lead data from your POST request to determine if it's a match for the criteria in PROMPT.txt. By default, the AI's output_data includes match (true or false), it's reasoning, and a normalized name for the lead.
  • The input_data and agent output_data each get a clolumn in the leads sqlite table.
  • The main.ts dashboard shows a history of all lead assessments, successful matches first. Clicking any lead shows the full inbound and output data from the assessment.

Options

  • You can add any number of fields to the AI's output instructions in PROMPT.txt and they'll be added to the output_data json in the sqlite table and be viewable in the dashboard. This can be used to add more colr to the AI's assessments or simply normalize data from different sources.
  • You can also add query parameters to the end of your val endpoint. (ex: yourval.val.run?source=singup-page). They'll be bundled in the _query object of 'input_data.' This can be useful for tracking where a lead came from.
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.