Looking for Advice on Designing an API-Oriented Workflow

Hey everyone! I’m trying to make a design decision and would love input from anyone who’s worked with AIP Logic, Agent Studio, or Automate.

Context:

  • When a user uploads a PDF, a Resume object is created via a pipeline.
  • When the user enters a prompt through the frontend, an Intent object is created.

Goal:

I want to build a workflow where—when both the Resume and Intent objects become available—a set of APIs (like LinkedIn job search or others) are automatically selected and triggered, depending on the context of those objects.

Design Option 1:

Use AIP Logic or Agent Studio , combined with Automate :

  • Use Automate to trigger a workflow when both the Resume and Intent objects are created.
  • Based on their combined context, the workflow would dynamically decide which APIs to call (e.g., LinkedIn job search) via webhook connections to external data sources.
  • The response would then be stored in a Search Result object type in the Ontology.

Design Option 2:

Do it mostly in the frontend:

  • When the user submits their query, the frontend directly calls the appropriate external APIs via fetch, using the context they’ve input.
  • Once results are returned, the app creates a Search Result object type (containing ~50 results).
  • Then, Agent Studio is triggered, where the agent takes in the resume, the search results, and the user query, and runs semantic search over the result objects to return the top 5 matches.

Design Option 3:

Use Automate + AIP Logic :

  • Automate watches for Resume and Intent object creation.
  • AIP Logic is triggered to perform the API calls and write the search results to the ontology.
  • You can follow up with a semantic ranking step using a separate function or agent.

Curious to hear:

  • Has anyone built something similar?
  • Is Agent Studio capable of dynamically selecting which external API to call based on Ontology object context?
  • Would you recommend frontend-based API calls over Logic workflows for this type of chaining?

Thanks in advance for any insights! :folded_hands:

1 Like

Hey! I haven’t built a similar workflow but I think design option 3 would be a good path forward.

To execute a function upon object creation, I definitely think AIP Automate would be your best bet. For creating Search Result objects, I suggest setting up an AIP Logic function that uses an LLM block to analyze the unstructured content of the Resume and Intent objects. This LLM block can be prompted to generate a query that would then be processed by a TypeScript function which hits the LinkedIn external API. Based on the LinkedIn API results, a series of actions can be triggered from the Logic function to create the Search Result objects.

Once the Search Result objects are created, an AIP Agent can be used to perform a semantic search on these objects in response to a given user query. You can design an AIP Agent that accepts a set of Search Result objects as an application state variable, which can serve as the input for the Agent’s ontology context. What’s great about this setup is that you can publish your Agent as a function, allowing it to run automatically right after the Search Result objects are created for a specific candidate. This function will not only generate a response to the user query based on the search results but also create a session that the user can access if they wish to continue the conversation and drill down deeper into the search results returned for a given candidate.

Let me know if that helps! Once you get started on it, feel free to reach out if you have any questions. Excited to see what you build!

Ok, since the LinkedInAPI endpoints take very specific results, I find it easier just to call the api myself. I created a data connection source with the api endpoint and a webhook for specific requests. I plan on using the user input from my custom frontend, to call the webhooks and create the search result objects in my Ontology through the OSDK.

However for the AIP agent workflow 3 things.

How do you recommend I pass in the user query into the Agent. This is a prompt that the user inputs in my frontend like “I want to find an internship for Palantir for the Fall”?

How should I trigger the AIP agent function to start once my search objects are created?

Is it possible to embed this session into my custom frontend?