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 😉

  • @andreas_bergstrom
    @andreas_bergstrom Місяць тому

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