Building adaptive RAG from scratch with Command-R

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 เม.ย. 2024
  • Adaptive-RAG (@SoyeongJeong97 et al) is a recent paper that combines (1) query analysis and (2) iterative answer construction to seamlessly handle queries of differing complexity. We took at stab at implementing some of these ideas from scratch using LangGraph and @cohere's Command-R, a lightweight (35b parameter), open-weight, fast LLM with strong tool-use and RAG performance.
    Code and video below, showing how to use Command-R for query analysis (re-writing and routing) as well as RAG and fast in-the-loop unit tests for document relevance, hallucinations, and answer quality. Our demo will route queries between a vectorstore, web search, and fallback to LLM generations based on the question; it will also iteratively grade responses.
    LangSmith traces show that all these steps can be done in a few seconds:
    smith.langchain.com/public/57...
    Code:
    github.com/langchain-ai/langg...

ความคิดเห็น • 22

  • @chrisogonas
    @chrisogonas 2 หลายเดือนก่อน +3

    Well illustrated! Thanks for sharing.

  • @sinayagubi8805
    @sinayagubi8805 หลายเดือนก่อน +1

    Thanks for explaining it so well.

  • @octopusfinds
    @octopusfinds 2 หลายเดือนก่อน +1

    Thank you, We love Cohere!

  • @insitegd7483
    @insitegd7483 2 หลายเดือนก่อน +1

    Thank you, it is very useful.

  • @woojay
    @woojay 2 หลายเดือนก่อน

    Fantastic. Thank you.

  • @mori-hosseini
    @mori-hosseini 2 หลายเดือนก่อน

    Awesome

  • @alonsosilva
    @alonsosilva 2 หลายเดือนก่อน

    Thank you for sharing. At the end of the video, it's mentioned that you can run Command-R with Ollama but if I understand correctly "withStructuredOutput" is not yet implemented for Ollama. How do you use "withStructuredOutput" with Ollama? Thank you.

  • @arjungoalset8442
    @arjungoalset8442 2 หลายเดือนก่อน

    Hell yea

  • @jarad4621
    @jarad4621 หลายเดือนก่อน +1

    Please tell me what handwritten process flow design tool you use for those colour images

  • @SashaBaych
    @SashaBaych หลายเดือนก่อน

    Lance thank you so much for this incredibly useful tutorial!
    Guys, can somebody please clarify what would be the difference between just invoking the model with binded tools as opposed to using create_tool_calling_agent method and then running AgentExecutor? Especially in the context of the langgraph. I see so many tutorials on langgraph but only few of them use AgentExecutors. Do I even need to use AgentExecutors with langgraph at all? What is the difference?

  • @choiswimmer
    @choiswimmer 2 หลายเดือนก่อน

    Is this suppose to tie in with the command r+ release?

  • @andrybratun7064
    @andrybratun7064 2 หลายเดือนก่อน

    I do not see grade_documents after web_search. Seems after web_search it directly goes to generate. Is it expected?

  • @tharshan09
    @tharshan09 2 หลายเดือนก่อน +1

    What is used to create the illustration? They are really nice style

    • @NirantK
      @NirantK 2 หลายเดือนก่อน +1

      Excalidraw

  • @SashaBaych
    @SashaBaych หลายเดือนก่อน

    By the way, how would i make the StateGraph persistent?

  • @ukituki
    @ukituki 2 หลายเดือนก่อน +1

    Wake up, babe. Someone has just invented DSPy’s assertions and suggestions 😉

    • @Slimshady68356
      @Slimshady68356 หลายเดือนก่อน

      whats that

    • @jarad4621
      @jarad4621 หลายเดือนก่อน

      What's that

  • @andreas_bergstrom
    @andreas_bergstrom หลายเดือนก่อน

    What recording software is that? Seems pretty lightweight, except that it records its own timer…

    • @Slimshady68356
      @Slimshady68356 หลายเดือนก่อน +1

      I assume he is using loom

    • @andreas_bergstrom
      @andreas_bergstrom หลายเดือนก่อน

      @@Slimshady68356 thanks!

    • @Slimshady68356
      @Slimshady68356 หลายเดือนก่อน

      ​@@andreas_bergstromnp