Unlisted
Like
leads
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.
Viewing readonly version of simplified branch: v92View latest version
AI-powered lead filtering from any data source.
- Click Remix
- Save your
OPENAI_API_KEYas an environment variable - Customize
PROMPT.txt - Get the val's HTTP endpoint from
main.ts: - Point your webhook to your val's HTTP endpoint
- That's it! You now have a growing
leadssqlite table with one column for your originalinput_dataand second column for the AI evaluator'soutput_data.
- 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's
inputDatato determine if it's a match for the criteria inPROMPT.txt. By default, the AI'soutput_dataincludes the booleanmatch, it'sreasoningalong with a normalizednamefor the lead. - The input data and agent results are saved in the
leadssqlite table. - The
main.tsdashboard shows a history of all leads, successful matches first. Clicking any lead shows the agent's reasoning and all incoming and outgoing data from the process