
In this video, I demonstrate how to use VectorShift to build AI applications and workflows. By applying ideas from Anthropic's blog post 'Building Effective Agents,' I show you how to create user learning environments without diving deep into AI mechanics. You'll learn about prompt chaining, gating functions, and conditional logic to ensure accurate code generation and validation. I'll also walk you through setting up a code generation assistant and refining its output using large language models like GPT-4.0 and Sonnet 3.5. Finally, I'll highlight VectorShift's features, including deploying applications, integrating with platforms like Google Drive, and enhancing user interfaces. If you find this tutorial useful, let me know in the comments for more such videos! Useful Links: Learn more about VectorShift: https://vectorshift.ai Discover insights on building effective agents from Anthropic: https://www.anthropic.com/research/building-effective-agents Recommended Videos: Discover the power of no-code AI with VectorShift: https://youtu.be/mGD1pRMv3T8 How to build no-code AI agents and apps using VectorShift: https://youtu.be/e1zHm5ydO4s 00:00 Introduction to Building Effective Agents 00:15 Overview of VectorShift Platform 00:32 Understanding Prompt Chaining 01:05 Programming Example: Code Generation Assistant 01:45 Validating and Refining Generated Code 02:39 Conditional Logic and Merging Responses 06:27 Running and Testing the Workflow 08:08 Deploying Your Application 09:03 Exploring More Features of VectorShift 09:41 Conclusion and Next Steps
Weekly deep dives on AI agents, coding tools, and building with LLMs - delivered to your inbox.
Free forever. No spam.
Subscribe FreeNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.
--- type: transcript date: 2025-02-24 youtube_id: KfCTBCZR1UE --- # Transcript: Building Effective AI Agents with VectorShift at the end of last year anthropic put out a great blog post called building effective agents what I wanted to do with in this video is I wanted to apply some of the examples that they had within this and show you how you can build this out within your own application what I'm going to be using within this video is Vector shift if you haven't used it before it's a platform that allows you to build out AI applications as well as workflows whether you want to build out a sophisticated workflow for particular task or if you want to build out something like a chatbot you'll be able to do all of that with in this platform I want to go through the workflow of prompt chaining the way that they describe prompt chaining is that it decomposes the task into a sequence of steps where each llm call processes the output of the previous one you can add programmatic checks on any intermediate step to ensure that the process is still on track they have this visualization where you have an input it will go and call something then we'll have a gating function the gating mechanism could be trying to validate the previous answer could be trying to determine okay does this meet a specific criteria yes or no what I'm going to do within here is we're going to have a programming example let's imagine we're one of those applications like a text app builder or something along those lines and the input is going to be the request to generate code the first thing that we're going to do is we're just going to grab an llm node and within here I can use these double curly braces to access the input I can select text I'm going to say you are a code generation assistant your mission is to produce correct concise typescript codee that fully addresses the user requirements return only valid compilable typescript in a single fence code block we have some guidelines within here but the goal with this is just to give a coherent piece of typescript so what I can do within this is I can have a second llm and I can have that llm check the work of the previous llm now within this I'll say you are a code validation assistant you receive a stamping of typescript code this is almost like acting like a QA for the previous step now there could also be an intermediate step within this where we'll actually try and compile that code as well that's an important step if you're building out these AI applications especially if you're trying to build something durable now in this case we're using an llm but you could use something where you're actually going to be sending this and having it compile as well to actually test that the code is working now within here what I can do is I'm going to sa for the prompt that's going to be the open AI input that we had from the previous node I'll select open then I'll select the response that's going to be the output from the LM now at the bottom here I'm going to indicate that I only want the output to be pass or fail that's going to allow me to have a conditional step as our next step to validate on whether it's passed with the conditional logic if it fails for instance we can respond back to the user to try again or we could try and actually send and try it again and have some sort of loop mechanism what I'm going to do within here is I'm going to select the input from the open AI 1 node and and I'm going to click the response now in this case I'm going to say if the text contains and we'll say if it passes we'll go through this path what we can do in the else condition is we can have a code fixer llm let's say we were hoping to use open AI but for whatever reason that didn't work out we're going to pull out a model that is known for being good at writing code Sonet 3.5 what I'm going to do here is I'm going to grab our system prompt within our system promp for this I'm going to indicate that you are a code refinement assistant your task is to correct the typescript code that failed validation we're going to use two different inputs now the first thing that I'm going to do is I'm going to wrap the response for the first one in XML text now what I'm going to use within this is I'm going to have those two curly braces and I'm going to reference that first node and that response from open AI That's our code response and then we also have our failure reason and then within here I can use those double curly braces and I can reference open AI as well as response so now we can connect this to our outs condition and it's only going to perform that if it fails if it does pass all that we really care about is actually returning that result to the user now next since we did use this conditional node what we also have to use when we use a conditional node is a merge node so that's going to allow us to handle and triage those different responses that we had from the conditional with in here we're going to first select if it is successful what do we care about if it's successful all that we care about returning to the user is I'm going to use those curly braces again here and what we care about is that successfully generated piece of code from that first node from open AI because we know that second piece of code was just checking to see if it was validated and if it was validated we don't care about anything else within our graph we just care about that successfully generated piece of code at least in terms of that gating function that we had and mind you your gating function can be way more sophisticated there could be a bunch of different gates to validate whatever you might be doing especially in coding context there probably are going to be a number of different checks to make your application more robust here I'm going to select the response from open Ai and then I'm going to select the next PATH here and this is going to be where I get our anthropic response and I'm going to select for anthropic here and that's going to be the two paths that we merge and the way that this is going to work is we're going to use this pick first function whichever node gets there first that's going to be what we ultimately send to our output I'm going to grab our output node and then finally I can go and I can connect this and that's going to be the output that we generate for the user now if I just zoom out here so we did quite a bit here but if we look at the reference chart on the bottom here and if I just go over it quickly one more time we have the input this is going to be a query to generate a piece of code we're going to have the code generated in this case from gp40 then from there we have our gating function and that's going to try and test to validate that our code is finished that there's not syntaxing errors and all of those types of things then from there we're going to have this condition on if the text begins with pass like we indicated from the previous step here we're going to go and continue on to send that response to the user otherwise we're going to send in the response to anthropic to fix our code finally we're going to merge those responses and we're going to pick the first one that is sent and that's going to be what gets outputed to the user now what I can do with in Vector shift is I can go and I can run this and I can say something like generate a hello world Express server and here we go here is our output of our codes we have the import we have Express and we have our Hollow world and this looks great in this case it was a successful generation but now let's go and dive into what is happening within Vector shift the thing that I love with the platform if I just expand this here we have all the visualizations across the nodes here we can see how long everything took I can take a look here I can look at the response within here and the cool thing with this is let's say okay maybe a second's too long let's just say I toggle this over to gp4 mini and I try and run this again now I have a response that's under 1 second and I also see that it is a successful response but let's try and emulate a failing case let's say I'm a user and I ask for a syntax error now that we asked it to fail just to emulate this case here if I go over to the validator that gating function that we have fail and then we also also have the reason like we asked for we see that it's failed and it's missing the closing parenthesis for app. list method since it did fail what it's going to do is it's going to go down this case where it's going to send that response to anthropic and if we take a look here we see that Sonet saved the day and generated the correct code for us here and by the end of it now we see this working code here so now that was just one example from the blog post there are a ton of different examples within here if you're interested in seeing these types of videos again just let me know in the comments below I'd love to build out more demonstrations like this over the coming months the other thing that's great with this is it's really easy to deploy this as an application so you can go click deploy you can go and run the code from here like you saw me do but if we click this export button and I click chatbot I'll call this code gen Wizard or something like that we'll generate it here then within here you can specify how you want your chat interface to look like and then once you've set up you can change out all of the different aspects of your chat interface you can change out the logo whether you want a welcome message all of the styling you can do all of that within here if I just go to export this you have the ability to add this on your site with a script tag or an iframe alternatively you can open it within this chat bot here directly from this link so now if I say generate me an Express server we see it's processing the request and there we go we have our piece of code just like you saw so that's just one quick demonstration on how you can leverage Vector shift but there is a ton within here I have a number of other videos on the platform as well if you're interested I'll leave those within the description of the video you can leverage all of the state-of-the-art large language models you can use knowledge bases within here there's a ton of different Integrations within here so if you want to have something that you integrate within slack or Salesforce or Google Drive and accesses all of the different documents that you have within there you will definitely be able to build out a ton of useful stuff within here you can also set it up with particular triggers as well which is a great use case there are data loaders within here there's multimodal capabilities so if you want to generate audio or if you want to generate images you can do all of that within here but overall it's a platform with a ton of different features that I encourage you to check out otherwise if you're interested in seeing overviews of the platform I'll link those within the description of the video alternatively if you're interested in these types of videos where you can see how to build out these common patterns whether it's with workflows or agentic flows just let me know in the comments below but otherwise that's pretty much it for this video if you found this video useful please like comment share and subscribe otherwise until the next one
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.