When to use Prompt Chains. DITCHING LangChain. ALL HAIL Claude 3.5 Sonnet

Ғылым және технология

From Prompts to Prompt Chains: When to Use Them and Why Startups Are Ditching Langchain
Are you curious about when to use prompt chains and why startups are moving away from Langchain and other LLM libraries? This video dives deep into these topics and reveals the minimalist prompt chaining method that can revolutionize your productivity.
🚀 In this video, we're breaking down the ULTIMATE guide to prompt chains using Claude 3.5 Sonnet, Anthropic's latest powerhouse LLM. Learn why startups are ditching complex libraries like Langchain and Autogen in favor of raw, unfiltered prompts.
🔥 Unlock the potential of minimalist prompt chaining and see how it can skyrocket your productivity. We'll show you:
1. A step-by-step breakdown of our minimalist chainable API
2. 4 crucial questions to determine when you should use prompt chains
3. The pitfalls of over-relying on LLM libraries and frameworks
💡 Discover why staying close to the metal with your prompts is CRITICAL in the ever-evolving AI landscape. We'll demonstrate how to build valuable prompt chains without unnecessary abstractions, giving you full control over your AI agents.
⚡️ Watch as we transform a simple factorial calculator into a powerful teaching tool using our minimalist approach. Plus, get a sneak peek at a production-level prompt chain driving a full agentic workflow!
🔧 Whether you're building AI coding assistants, research tools, or personal AI helpers, mastering prompt chains is your ticket to creating next-level agentic applications. Don't get left behind in the AI revolution!
🎓 Ready to level up your prompt engineering skills? Hit subscribe and join us on this journey to becoming an agentic engineering pro. Let's harness the true power of Claude 3.5 Sonnet and build AI agents that work tirelessly for you and your users.
💼 Remember, in the world of AI, the prompt is king. Don't give away your most valuable asset to complex libraries. Stay agile, stay close to the metal, and unlock the full potential of your AI workflows with prompt chains!
Like, subscribe, and comment with your thoughts on prompt chains and agentic workflows.
Let's COOK.
💻 Minimalist Prompt Chain Code
gist.github.com/disler/d51d7e...
🔴 Master the prompt (Top 5 Elements)
• MASTER the Prompt: TOP...
🔗 Resources:
- Octomind: www.octomind.dev/blog/why-we-...
- Langchain: www.langchain.com/
- Simonw Lightweight LLM Library: github.com/simonw/llm
📖 Chapters
00:00 From Prompts to Prompt Chains
01:23 Minimalist Chainable API for Prompt Chains
04:00 Key Benefits of Using Prompt Chains
07:29 Four Guiding Questions for Using Prompt Chains
12:55 Problems with LLM Libraries like Langchain
15:52 Octomind blog post - Libraries are OVERKILL
18:20 Why the Prompt is All That Matters in Generative AI
19:22 Building a Production-Level Agentic Workflow
21:55 Closing Thoughts: Embrace Minimalism in AI Development
#anthropic #langchain #promptengineer

Пікірлер: 77

  • @Canna_Science_and_Technology
    @Canna_Science_and_Technology20 күн бұрын

    I am anti black box solutions. I’ve written my agentic framework from scratch and the month of coding and headaches was worth it. I learned a ton and having full control over everything is priceless. It works so well, it’s almost scary. ;-)

  • @AAL3087

    @AAL3087

    20 күн бұрын

    Care to share your learnings. I'm about to dive in to do the same. Cheers

  • @Canna_Science_and_Technology

    @Canna_Science_and_Technology

    20 күн бұрын

    I restarted from scratch a couple of times because I was confident but kept forgetting things, leading to many big changes. Planning in detail and creating pseudocode is crucial. I didn’t follow any agentic framework, preferring to build from scratch, but later realized other good ideas exist. The complexity of using a state machine for flow control was a bit daunting. I ended up using a hybrid approach, which worked out. Code everything in modular steps-memory, tools, agents, departments, managers, etc. I even created a secretary to manage memory and task completion, which worked perfectly. And ChatGPT will slow you down. I got so frustrated with ChatGPT, I ended up just coding it mostly myself.

  • @AAL3087

    @AAL3087

    20 күн бұрын

    @@Canna_Science_and_Technology hey thanks! that is invaluable to know. Were there good libs, patterns etc you did retain e.g. Memgpt or others. What's a good way in hindsight to this again?

  • @flexibleaspect

    @flexibleaspect

    20 күн бұрын

    I'm a newb... what are you writing your own agentic frameworks for? Is each framework a tool to solve a specific problem, then you make another one to solve another problem... or does the latest framework replace all that came before?

  • @u.a3

    @u.a3

    20 күн бұрын

    Are you solely building for yourself or taking on client projects as well? What did you build your framework for? Like what sort of tasks

  • @itskittyme
    @itskittyme20 күн бұрын

    i entirely agree with your take when you say it's too early to use these libraries, because we are at the start of this new age of prompt engineering and these libraries force you to use patterns that have not been tested and engineered properly yet, I can only recommend everyone to try things out yourself because you may stumble upon better patterns by trial and error, at this stage of the technology

  • @jeanchindeko5477

    @jeanchindeko5477

    19 күн бұрын

    All that great and is true not just for LLM but in any programming paradigm, languages, patterns, you should learn to use the low level API. That said in corporate situations when you’re asked to build a POC, Demo, MVP in 2 weeks, you don’t have the luxury to take 1 month of trial and error learning process to deliver something to your boss. So just saying to not use libraries is not fully all time applicable.

  • @wellbishop
    @wellbishop20 күн бұрын

    Pure gold as always! Thank you so much.

  • @93cutty
    @93cutty20 күн бұрын

    Saving this til I get to work. I have been waiting to see if you release something about this :)

  • @joshualunati4105
    @joshualunati410514 күн бұрын

    Heay brudda, Just wanted to say that this has to be one of the most educational video about this subject , in quite some time. Thank you for your time.

  • @indydevdan

    @indydevdan

    10 күн бұрын

    Glad it was helpful!

  • @jaredcluff5105
    @jaredcluff510520 күн бұрын

    I appreciate this. I am working on a new project that will leverage Mixture of Agents and was looking at which framework to use. I think you have convinced me to write and manage my own simple agentic framework instead.

  • @indydevdan

    @indydevdan

    16 күн бұрын

    This is the way - you will have 100% control here and if some wrapper/library pops up that you want to use in the future, you'll likely have a much better idea of what it does having built your own.

  • @tomaszzielinski4521
    @tomaszzielinski452120 күн бұрын

    LangChain is, as name suggests, a promp chain framework. I write all the prompts from scratch, no idea where are you coming from. The only "library promp" I use is pydantic output formatting, which works flawlessly for various models. Agree about too many levels of abstractions, but I do things in my own way, anyway. Ended up with very similiar function to what you show here.

  • @viky2002

    @viky2002

    19 күн бұрын

    gpt instructor for the win

  • @the42nd
    @the42nd20 күн бұрын

    Excellent video and code. Subscribed.

  • @ScullyPopASMR
    @ScullyPopASMR18 күн бұрын

    This is so interesting. It's very complicated, but I will try to wrap my head around it.

  • @asycd_
    @asycd_18 күн бұрын

    Spot on about not needing Langchain but it gets you through the door. Especially, with the tricker methods to implement like LLM graphs!

  • @Dis-Trackted
    @Dis-Trackted19 күн бұрын

    Cool video. I'll check the detailed implementation :)

  • @larsfaye292
    @larsfaye29220 күн бұрын

    I love that you use the SynthWave '84 theme with text glow. Best theme in existence!

  • @flexibleaspect

    @flexibleaspect

    20 күн бұрын

    I hadn't heard of it, but looked it up and will have to try it. Looks cool.

  • @indydevdan

    @indydevdan

    16 күн бұрын

    my fav theme by far

  • @davieslacker
    @davieslacker19 күн бұрын

    Thanks for a very straight forward agentic workflow example without unnecessary libraries. This was what I have been looking for. I have felt like one could make a full time job simply studying langchain and seems like a level of abstraction of focus outside of the code. I want to dig straight into the models.

  • @indydevdan

    @indydevdan

    16 күн бұрын

    Reading your comment made me think: Langchain is starting to look like the Reactjs for the GenAI space. You will find work and can build a contracting career out of it 👍 but you will know there's better/easier ways to do thing X or Y 👎. Your idea to dig straight into the model is spot on.

  • @DeanRie
    @DeanRie20 күн бұрын

    Thanks for video, you are is super cool! 🙏

  • @SwaLi440
    @SwaLi44019 күн бұрын

    NIIIIIIICCCEEEE!!!!! Tring IT!

  • @valtersilva5386
    @valtersilva538620 күн бұрын

    Awesome work mate. Similar to fabric.

  • @jackbauer322
    @jackbauer32220 күн бұрын

    I am pro black box solutions. As long as the results is acceptable regarding MY TASKS and criteria, nothing else really matters

  • @gheatza
    @gheatza19 күн бұрын

    very interesting, thank you! I am a noobie that watches these kinds of videos from time to time to try and understand this tech and what I could build with them for myself. setting that aside, I hope I'm not the weird person here but I really like the way your keyboard sounds 😆

  • @ProzacgodAI
    @ProzacgodAI20 күн бұрын

    Hey, I like this, it's more my speed. I had tooling that's basically the same as you have above. The biggest differences from what I can tell, in your prompts = [] ... instead of just raw strings I was using classes to describe the 'meta' around the prompt like JSON("generate blog post title about ...."), TEXT("generate one hook for ...."), these were just factory wrappers to a Meta(prompt, returnType, ctx) where ctx could also be set explicitly, I kinda rarely did that though. The second biggest was because I knew it was supposed to be json in the return, I could retry the prompt right in the chain lib, masking some % of errors so I didn't have to deal with them high level. I mean failure cases do get through, but failing to encode in json was generally not one of them.

  • @KhalilKhamlichi-yn5wn
    @KhalilKhamlichi-yn5wn20 күн бұрын

    I like your approach, can you make a tutorial also for DSPy ?

  • @bukitsorrento
    @bukitsorrento20 күн бұрын

    I was waiting for your video.. Thank you for this. Got couple of questions. 1. For nocoders, I really like langflow, it's pure python, visual programming always help speed up everything, not dependent on Langchain although they started as their wrapper. I need your opinion. 2. Agentic workflow should work cross platform, orchestrating cloud, desktop and mobile, also be industry agnostic. 3. I want to propose a discord server for IndyDev community, it's really hard to reach you but we all want to discuss the "journey".

  • @JoshDingus

    @JoshDingus

    20 күн бұрын

    I was just thinking this as well. Dude your stuff is gold, I think it would help grow your community for sure.

  • @indydevdan

    @indydevdan

    16 күн бұрын

    1. langflow looks solid but heavy. If you're a non-coder it's a great option. At a glance I can see they expose a lot of the key functionality of llms data retrievers, etc via the ui. 2. If that's your use case then yes. Your agentic workflow really only has 1 duty: solve your problem. 3. Discords are great but have several issues. Still thinking through this stay tuned.

  • @siegeperilous9371
    @siegeperilous937120 күн бұрын

    premature abstractions.. oops I abstracted. I swear that never happens. Lolol good shit. Clear. Simple. Powerful. Appreciated, brother.

  • @DARKSXIDE
    @DARKSXIDE20 күн бұрын

    dope work and insight i found the same issue w autogen, crew ai etc.

  • @MavVRX
    @MavVRX20 күн бұрын

    Langchain is very customisable, and you can pick and choose what to use and what not to use. I was able to reduce a lot of unnecessary code when implementing a white paper for a different type of agent that uses a different parsing method.

  • @TheBestgoku
    @TheBestgoku20 күн бұрын

    I donno what it is, maybe its some kind of placebo or something. But claude sonnet 3.5 feels soo much better than even chatgpt 4o. I feel like i can actually see this as a mini AGI already.

  • @jaredcluff5105

    @jaredcluff5105

    20 күн бұрын

    It’s not placebo. It is better. I subscribe to both and now use gpt4o for the “simple stuff” to save tokens I will need with Sonnet as I have frequently exhausted them.

  • @dumb8671

    @dumb8671

    20 күн бұрын

    I thought it was great when i asked it to figure out a number sequence. It was an internet logic question. It seemingly solved it but it was from the internet. When i gave it a sequence i created it could not figure it out even after i explained it. Definitely failed because even gave clues to the point of telling it what the pattern was and it went nuts.

  • @indydevdan

    @indydevdan

    16 күн бұрын

    I agree but it won't last long. I call them the BIG 3. Anthropic, OpenAI, and Google. They will swap first place over the next year or two until someone cracks AGI. Based on rumors, GPT-5 is going to break the internet but we all know Anthorpic and Google are cooking as well.

  • @free_thinker4958
    @free_thinker495814 күн бұрын

    I think that approach will be suitable for people who wants to be spicialized in ai development and deployment, personally speaking i won't waste all that time to build that from scratch because it's better for me to focus on my online business logic rather than wasting my time reiventing the wheel.

  • @indydevdan

    @indydevdan

    10 күн бұрын

    Solid take but to be fair: writing one helpful prompt chaining method that's highly reusable is not exactly reinventing the wheel.

  • @tomtom5821
    @tomtom582120 күн бұрын

    Thank you so much! Your videos are extremely concise and impactful. I am very new to programming but I work full time as a data analyst and would love to learn more about software development so that I can offer AI agent frameworks or consulting to businesses. I just need a good personal project to start implementing and I'm having a tough time figuring out what to do.

  • @ronilevarez901

    @ronilevarez901

    20 күн бұрын

    Draw me a lamb.

  • @ibrahimsaidi7239
    @ibrahimsaidi723920 күн бұрын

    This is great material Dan. More of this please 🙏🏾

  • @pioscelina6800
    @pioscelina680020 күн бұрын

    I don’t get why people would use langchain. There are tons of much better alternatives. Personally I use Wordware where I can just create agent if workflows by writing prompt in English and then connect it via API to main product. Super simple, without unnecessary abstraction layers

  • @indydevdan

    @indydevdan

    16 күн бұрын

    Looks interesting thx for the tip and I agree w/you.

  • @jeanchindeko5477
    @jeanchindeko547719 күн бұрын

    Basically you’re rebuilding the core piece of all those libraries from scratch, right?

  • @indydevdan

    @indydevdan

    16 күн бұрын

    The idea is to rebuild the pieces of those libraries that matter for your use case in a simplistic, single purpose, reusable way. So yes and no.

  • @remsee1608
    @remsee160820 күн бұрын

    I agree always raw dawg prompts

  • @indydevdan

    @indydevdan

    16 күн бұрын

    100% raw dawging prompts for production work the foreseeable future. I think a comparison video will be interesting though langchain vs autogen vs raw dawg.

  • @cholst1
    @cholst117 күн бұрын

    Dno if youve noticed, but the API for Claude 3.5 says its knowledge cutoff is 2022, wheras the one one claude page says april 2024. Wonder why they have different models on the API.

  • @brandonwinston
    @brandonwinston20 күн бұрын

    I see your point but its not for me. I'm a developer, but I'm also a professional in another discipline, and that is the focus of my dev work. Would rather spend more of my limited time on business logic rather than trying to reinvent langchain, which I don't find hard to use or understand.

  • @dprggrmr

    @dprggrmr

    20 күн бұрын

    Well, you're trying to use langchain to reinvent development...you'll be stuck

  • @indydevdan

    @indydevdan

    16 күн бұрын

    Totally fair take. Again I'm not against langchain. If you don't have time and/or are not building out super specific use cases these libraries will get most of the value for free UP TO A POINT. The biggest risk is letting a library prompt for you. To me this would be a massive mistake.

  • @eyoo369
    @eyoo36920 күн бұрын

    Whats the benefit of splitting that task into 3 separate prompts as opposed to directly prompting for a title, hook and blog post in one shot?

  • @Damion00000

    @Damion00000

    19 күн бұрын

    You are aiming all of the resources of the model at solving one problem , rather than dividing it across three problems. This has the potential of creating a better quality output than if you said do all three. I begin all my writing tasks by prompting for outlines , and then I use each point in the outline as a prompt to produce a paragraph outline , I could go deeper and ask for sentence outlines as well - it all depends on how much control you want from the outputs .

  • @amrohendawi6007
    @amrohendawi600720 күн бұрын

    You are literally reinventing the wheel

  • @cholst1

    @cholst1

    17 күн бұрын

    Bold to assume that the general shape of an agent framework is as agreed upon as wheels being circles. As for development, we are still developing and improving wheels to this day. So your point is quite silly.

  • @indydevdan

    @indydevdan

    16 күн бұрын

    There isn't a wheel to reinvent yet. You're assuming LangChain or these other libraries are 'the wheel'. The 'wheel' doesn't exist yet, it's too early. These all rough approximations which is why it's important to stay close to the metal (prompt)

  • @vitalis
    @vitalis20 күн бұрын

    Not a programmer but this was easy to follow. Great clear video. What about the memory part? I have been doing research on all the AI terms because there is so much overlapping usage. I wanted to find out the process and tools people were leveraging to produce what are essentially ChatGPT wrappers but customised to a particular industry or user case. Agents, chain prompts, agentic flows, multi agents, vector databases, RAG, permanent memory, cache memory, context prompting, fine-tuning, user input, automation, etc

  • @teddyfulk
    @teddyfulk20 күн бұрын

    Why not use instructor?

  • @indydevdan

    @indydevdan

    16 күн бұрын

    Instructor is solid - may include in future videos.

  • @lucasssssssh
    @lucasssssssh20 күн бұрын

    Thanks brother, really underrated job you're doing here

  • @CourageToGroww
    @CourageToGroww20 күн бұрын

    why 🐍 and not 🔥 ?

  • @BenQ.-ys4kp

    @BenQ.-ys4kp

    20 күн бұрын

    What language is that

  • @CourageToGroww

    @CourageToGroww

    20 күн бұрын

    @@BenQ.-ys4kp "Mojo is designed as a superset of Python. So if you know Python, then a lot of Mojo code will look familiar. However, Mojo is-first and foremost-designed for high-performance systems programming, with features like strong type checking, memory safety, next-generation compiler technologies, and more. As such, Mojo also has a lot in common with languages like C++ and Rust. Yet, we've designed Mojo to be flexible, so you can incrementally adopt systems-programming features like strong type checking as you see fit-Mojo does not require strong type checking."

  • @Hex0dus

    @Hex0dus

    18 күн бұрын

    What do you mean by the fire emoji? I came up with PyTorch, Scala or Firebase but that doesen't make sense at all...

  • @CourageToGroww

    @CourageToGroww

    18 күн бұрын

    @@Hex0dus Mojo 🔥 - the programming language for all AI developers Mojo combines the usability of Python with the performance of C, unlocking unparalleled programmability of AI hardware and extensibility of AI models.

  • @tollington9414
    @tollington941419 күн бұрын

    The captions are really annoying- please don’t use them, YT has this function already

  • @tollington9414

    @tollington9414

    19 күн бұрын

    Ok they don’t last long ❤

  • @ronanhughes8506
    @ronanhughes850620 күн бұрын

    Very hard to follow. Speaking too fast and dark screen makes it hard to see.

  • @SR-ud2xj

    @SR-ud2xj

    20 күн бұрын

    The source code is available, you can zoom, alter playback speed, use transcript etc. if you ask nicely maybe he can write it for you personally on your machine? Imo you are being just a little picky and not objective . Many llms can help you break down this video. You could prompt them for example, “what is the main purpose of this video”, “given the main objective of the video what are the ten key take aways?” And “taking each take away in turn, expand each point to explain to a newb, exactly what is going on. For each take away state the takeaway you are on and the remaining ones to cover”, “taking each take away one at at time , create four scenarios with 6 multiple choice questions each to assess understanding. There should be four possible answers for each question and you must provide feedback for each option to explain why it is either correct or not”……..

Келесі