Giter VIP home page Giter VIP logo

Comments (2)

MichaelWalker-git avatar MichaelWalker-git commented on May 28, 2024 1

Reiterating the problem

The construct currently employs a long context window approach for document processing when a document name is specified. This means it likely uses the entirety of the document's content or a significant part of it as context for generating responses.

Potential Solution

A potential solution involves adding a new parameter to the GraphQL schema that allows users to select the method (long context window or RAG). This parameter could be something like responseGenerationMethod with possible values longContext and RAG.

Plan

  1. Schema Update:
    a. Modify the GraphQL schema to include the new parameter.
  2. Handling the Parameter in Lambda Functions:
    a. Update the AWS Lambda function logic to handle this new parameter. This will involve:
  • Implementing a conditional logic to choose between the long context window approach and the RAG approach based on the parameter's value.
  • For the RAG approach, you might need to implement or integrate a mechanism to fetch relevant document snippets based on the query, which are then used as context for the response generation.
  1. Testing:
    a. Ensure thorough testing for both paths (long context and RAG) to confirm that the system behaves as expected in each case.
  2. Update the documentation
    a. to include information about the new parameter, and provide examples of how to use it.

from generative-ai-cdk-constructs.

krokoko avatar krokoko commented on May 28, 2024

Perfect, thanks @MichaelWalker-git ! Just one comment: "For the RAG approach, you might need to implement or integrate a mechanism to fetch relevant document snippets based on the query, which are then used as context for the response generation." -> this is already there, need only the conditional logic :)

from generative-ai-cdk-constructs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.