Clay Icon

Optimizing AI API Usage for Unique Company Phone Number Retrieval

ยท
ยท

Hi everyone -- I have a Find People Table where many of the contacts belong to the same companies. I'm trying to run the Claygent (AI Web Researcher) template that uses the following prompt:

Visit the website of the following company: /Company Domain and find a phone number to contact them. You might have to look at the footer or on the "Contact", "Support" or other relevant pages on website. If you are unable to find a phone number on the website, try looking at other sources on the web & Google. If a phone number is found, return just the phone number and nothing else. Otherwise, just return: "Not Found".

Because there are multiple people belonging to the same company, I only want the AI Web Researcher column to run on the first unique value of /Company Domain. The goal is to only using the AI API to find phone numbers from each unique website, rather than it running on the same website multiple times. I am trying to use the "Only Run If" formula to make this work, but even using Use AI I am unable to get a formula that allows this. Anyone experience something similar? I can't imagine I'm the only one who only wants to use API credits when necessary and not have duplicative work ๐Ÿ™‚

  • Avatar of Bruno R.
    Bruno R.
    ยท
    ยท

    Hi Josh, thanks for reaching out. If you're looking to cache your prompts, I suggest that you a lookup + write to table setup which is particularly useful for streaming setups. Here's how you can build this out: https://www.loom.com/share/c90b34abc6f04f848be32fdc861a0d86?sid=5da240cc-c774-4cec-be55-1434f9191a94 I hope this was helpful. If there's anything else I can assist you with, please let me know!

  • Avatar of Josh U.
    Josh U.
    ยท
    ยท

    Seems to be exactly what I needed! I had no idea you could use lookup + write to table in that way. I can thing of several other use cases this functionality will be helpful for. Thank you!

  • Avatar of Josh U.
    Josh U.
    ยท
    ยท

    Hi Bruno R. . In your example, the workflow seems to only be applicable when you are adding the lookup after the first successful find the AI has run. Or at least that seems to be the case? I cannot get my lookup column to generate "โœ… Record Found" to prevent the AI from running on that row for companies already in the write to table. My table is here: https://app.clay.com/workspaces/192489/tables/t_GEPdGsJYxWbV/views/gv_kj2Tj6sd2v3k What am I missing?

  • Avatar of Bruno R.
    Bruno R.
    ยท
    ยท

    Hi Josh thanks for following up on this and happy to hear this seems to be moving you in the right direction. I went ahead and modified the setup for you and it seems to be running correctly, here's a video showing you the changes I made to your workflow: https://www.loom.com/share/206a0bc7f2f840dfa439882a1768bba4?sid=f521d632-7862-4723-9141-77f2d7fcfbad I hope this was helpful. If there's anything else I can assist you with, please let me know!

  • Avatar of Channeled
    Channeled
    APP
    ยท
    ยท

    We haven't heard back from you in a bit, so we're going to go ahead and close things out here - feel free to let us know if you still need something!

  • Avatar of Channeled
    Channeled
    APP
    ยท
    ยท

    Hi Josh U.! This thread was recently closed by our Support team. If you have a moment, please share your feedback: