Skip to content

is it possible to tweak the metadata field created by a Bedrock knowledgebase and stored on an Opensearch Serverless collection?

0

Hello, basically I have a pipeline that creates an index on AOSS out of a website(by crawling) and a pdf. My question is, is it possible for new files/wesbites I would like to add to this index to have a 'tweaked' metadata, according to tags of my choosing? If so, how do I implement this programmatically? Is there an API for this or do I programmatically open the metadata field and add the tags of my choosing?

Thank you very much.

1 Answer
0

Hi,

I think what you want to do is to add a Lambda in the data ingestion KB as per https://docs.aws.amazon.com/bedrock/latest/userguide/kb-custom-transformation.html

As you can see the output format of this Lambda allows you to customize the metadata to adapt them to our use case

{
    "outputFiles": [{
        "originalFileLocation": {
            "type": "S3",
            "s3_location": {
                "uri": "string"
            }
        },
        "fileMetadata": {
            "key1": "value1",
            "key2": "value2"
        },
        "contentBatches": [{
            "key": "string"
        }]
    }]
}

Best,

Didier

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.