aws-samples / aws-genai-conversational-rag-reference

AWS Generative AI Conversational RAG Reference (Galileo)
https://aws-samples.github.io/aws-genai-conversational-rag-reference
Apache License 2.0
63 stars 20 forks source link

[BUG] Chat message error after fresh deployment without sample data #119

Open julianpitt opened 1 month ago

julianpitt commented 1 month ago

Describe the bug

Chat messages fail to send after a fresh deployment of Galileo without the Supreme Court case dataset selected in the galileo-cli deployment wizard.

Expected Behavior

Able to send and recieve messages from the LLM on a fresh install.

Current Behavior

After creating a chat, sending a message will result in a 503 error with the following payload

{
    "errorMessage": "Error: Failed to retrieve documents from https://{redacted}.lambda-url.us-west-2.on.aws//corpus/search/similarity: 502 Bad Gateway"
}

The error occurs when the LLM tries to retrieve context from the RDS instance The RDS instance doesn't contain the required index if there have been no data processing jobs.

The following error can be found in the CloudWatch logs for the CorpusNestedStackApiLambda:

ERROR   error: relation "all_mpnet_base_v2_768" does not exist

On the UI, the button shows a loader while the request is being made, then reverts back to the original state with the message still in the text area as if nothing happend.

Reproduction Steps

  1. Deploy a fresh copy of galileo with the following parameters

    AWS Profile: default AWS Region: (hit enter, the filled in region should be the correct region) Administrator email address: (enter your email address) Administrator username: admin Deploy main application stack?: Y Choose the foundation models to support: (unselect all then hit enter) Foundation model region?: us-west-2 Enable Bedrock?: Y Bedrock Region: us-west-2 Bedrock model ids: Anthropic Claude (anthropic.claude-v2) Bedrock endpoint url (optional): (hit enter, should be blank) Choose the default foundation model: bedrock::anthropic.claude-v2 Hit enter for the rest of the prompts, ensuring all options for "Deploy sample dataset?" are unselected

    ✔ Config file name? … config.json
    ✔ Application Name (stack/resource naming) … Galileo
    ✔ AWS Profile … default
    ✔ AWS Region (app) … us-west-2
    ✔ Administrator email address Enter email address to automatically create Cognito admin user, otherwise leave blank
     … {redacted}
    ✔ Administrator username … admin
    ✔ Choose the foundation models to support ›
    ✔ Foundation model region? … us-west-2
    ✔ Enable Bedrock? … yes
    ✔ Bedrock region … us-west-2
    ✔ Loading available Bedrock models
    ✔ Bedrock model ids › Anthropic Claude (anthropic.claude-v2)
    ✔ Bedrock endpoint url (optional) …
    ✔ Choose the default foundation model › bedrock::anthropic.claude-v2
    ✔ Embedding model
    Enter the model id to use for embeddings, supports any AutoML model
    
    Example: sentence-transformers/all-mpnet-base-v2, intfloat/multilingual-e5-large, sentence-transformers/all-MiniLM-L6-v2
     … sentence-transformers/all-mpnet-base-v2
    ✔ Embedding Vector Size
    Enter the vector size for the chosen embedding model
     … 768
    ✔ Embedding model instance type
    Enable autoscaling the embedding instance capacity based
    
    Recommend "ml.g4dn.xlarge" for smaller datasets, and "ml.g4dn.2xlarge" for larger datasets
     … ml.g4dn.xlarge
    ✔ Embedding model max capacity (autoscaling)
    Enable autoscaling the embedding instance capacity based
    
    Ensure adequate Service Quota limit for SageMaker > "ml.g4dn.xlarge for endpoint usage"
     … 1
    ✔ Indexing Pipeline instance type
    Instance type used for processing dataset files and indexing to vector store
     … ml.t3.large
    ✔ Indexing Pipeline max containers
    Number of containers used for indexing files to vector store
    
    Ensure adequate Service Quota limit for SageMaker > "ml.t3.large for processing job"
     … 5
    ✔ Create vector store "index"?
    If enabled, will create a database index for the data to improve search over large datasets
    
    Recommended for very large datasets
     … no
    ✔ Deploy sample dataset? ›
    ✔ Enable tooling in dev stage (SageMaker Studio, PgAdmin)? ›
    Synthesizing project repository...
    ? [CDK DEPLOY] Execute the following command in{redacted}?
    cdk deploy --require-approval never --region us-west-2 --profile default -c "configPath=config.json" Dev/Galileo
     … yes
    1. Open up Galileo and create a new chat
    2. Send a message in the newly created chat

Possible Solution

Create the required RDS index or relation on Galileo deployment

Additional Information/Context

No response

Environment details (OS name and version, etc.)

Galileo Prerequisite Check... system: Linux 6.5.0-1017-aws #17~22.04.2-Ubuntu SMP Mon Mar 25 20:28:54 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux pnpm: 8.15.7 node: v20.12.2 python: Python 3.11.0rc1 poetry: Poetry (version 1.8.2) docker: Docker version 26.0.1, build d260a54 java: openjdk 18.0.2 2022-07-19 OpenJDK Runtime Environment Corretto-18.0.2.9.1 (build 18.0.2+9-FR) OpenJDK 64-Bit Server VM Corretto-18.0.2.9.1 (build 18.0.2+9-FR, mixed mode, sharing) aws: aws-cli/2.15.40 Python/3.11.8 Linux/6.5.0-1017-aws exe/x86_64.ubuntu.22 prompt/off

sperka commented 1 month ago

This is a known issue, please add at least one doc after deployment with galileo-cli document upload