AWS Machine Learning Blog 2024年09月20日
Integrate Amazon Bedrock Knowledge Bases with Microsoft SharePoint as a data source
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Amazon Bedrock Knowledge Bases 允许您将公司私有数据源中的信息整合到 Amazon Bedrock 中,以创建知识库。本文将展示如何使用 Microsoft SharePoint 作为数据源之一,为检索增强生成(RAG)提供更相关、准确和个性化的响应。

😊 **连接 SharePoint 数据源**:Amazon Bedrock Knowledge Bases 支持连接到各种数据源,包括 Microsoft SharePoint。您可以将存储在 SharePoint 中的信息整合到知识库中,以便轻松访问和检索相关内容。 Amazon Bedrock Knowledge Bases 提供了丰富的功能,例如: * **数据提取**:从 SharePoint 文档中提取结构化数据、元数据和其他信息,以提供与用户查询相关的搜索结果。 * **增量同步**:持续同步 SharePoint 内容更新,确保知识库始终保持最新。 * **来源归属**:在由基础模型生成的响应中提供来源归属,方便用户了解信息的来源。

😁 **创建知识库**:本文详细介绍了在 Amazon Bedrock 中创建知识库并连接到 SharePoint 数据源的步骤。这些步骤包括: * **创建知识库**:在 Amazon Bedrock 控制台中创建一个新的知识库,并提供名称和描述。 * **选择数据源**:选择 SharePoint 作为数据源,并提供相关信息,例如站点 URL 和域。 * **配置身份验证**:使用 OAuth 2.0 身份验证连接到 SharePoint Online 站点,并提供必要的凭据。 * **自定义设置**:根据需要自定义数据删除策略、元数据设置和内容分块设置。 * **选择嵌入模型**:选择合适的嵌入模型,例如 Titan Embeddings G1-Text,将数据转换为嵌入。 * **创建向量存储**:为嵌入创建一个新的向量存储。

😉 **测试解决方案**:创建完知识库后,您可以进行测试,确保它能够正确检索和处理 SharePoint 中的信息。您可以输入问题或查询,并验证响应是否准确且相关。 测试步骤包括: * **选择模型**:选择合适的模型进行测试。 * **输入问题**:输入与 SharePoint 内容相关的查询。 * **验证响应**:验证生成的响应是否符合预期。

😄 **总结**:Amazon Bedrock Knowledge Bases 与 SharePoint 的集成,为企业提供了强大的工具,可以轻松地访问和利用存储在 SharePoint 中的信息。这将提高员工的工作效率,促进决策制定,并促进企业内部的知识共享。

😎 **清理**:如果只是为了试验而创建了知识库,建议将其删除,以免产生不必要的费用。有关删除知识库的说明,请参考管理知识库文档。

🥳 **作者简介**:Surendar Gajavelli 和 Abhi Patlolla 分别是来自纳什维尔和纽约市的亚马逊高级解决方案架构师,他们致力于帮助客户构建创新的云解决方案。

🤯 **关于本文**:本文展示了如何将 Amazon Bedrock Knowledge Bases 与 SharePoint Online 作为数据源进行配置,以帮助企业轻松访问和利用存储在 SharePoint 中的信息。

🥳 **结论**:Amazon Bedrock Knowledge Bases 是一款强大的工具,可以帮助企业将私有数据源整合到知识库中,为检索增强生成(RAG)提供更相关、准确和个性化的响应。

🥳 **下一步**:您可以立即在 Amazon Bedrock 控制台中试用此功能,并访问 Amazon Bedrock Knowledge Bases 文档了解更多信息。

🥳 **其他参考资料**: * 如何创建和激活新的 Amazon Web Services 帐户? * 标记资源 * 管理数据源 * 在 Microsoft Azure 门户中注册新应用程序 * 创建用于 SharePoint 数据源的 Secrets Manager 密钥

Amazon Bedrock Knowledge Bases provides foundation models (FMs) and agents in Amazon Bedrock contextual information from your company’s private data sources for Retrieval Augmented Generation (RAG) to deliver more relevant, accurate, and customized responses. Amazon Bedrock Knowledge Bases offers a fully managed RAG experience.

The data sources that can be connected to as knowledge bases are continuously expanding. This post showcases how to use one of the data source connectors; Microsoft SharePoint, an integrated content management and collaboration tool that many organizations use for storing, organizing, and sharing their internal data. See Data source connectors for the full list of supported data source connectors.

Solution overview

The following are some pertinent features of the SharePoint data source within Amazon Bedrock Knowledge Bases:

In the following sections, we walk through the steps to create a knowledge base, configure your data source, and test the solution.

Prerequisites

The following are the prerequisites necessary to implement Amazon Bedrock Knowledge Bases with SharePoint as a connector:

Create a knowledge base and connect to the data source

Complete the following steps to set up a knowledge base on Amazon Bedrock and connect to a SharePoint data source:

    On the Amazon Bedrock console, choose Knowledge bases in the navigation pane. Choose Create knowledge base.

    In the Knowledge base details section, optionally change the default name and enter a description for your knowledge base. In the IAM permissions section, select an IAM role that provides Amazon Bedrock permission to access other AWS services. You can let Amazon Bedrock create the service role or choose a custom role that you have created. In the Choose data source section, select SharePoint. Optionally, add tags to your knowledge base. For more information, see Tag resources. Choose Next.

    In the Name and Description section, optionally change the default data source name and enter a description of the data source. In the Source section, provide the following information:
      For Site URLs, enter the site URLs to use for crawling and indexing the content for RAG. For Domain, enter the domain name associated with the data source. For example, if the site URL is https://deloittedasits.sharepoint.com/xyz.aspx, the domain value would be deloittedasits. Under Advanced settings, keep the default selections.

While converting your data into embeddings, Amazon Bedrock encrypts your data with a key that AWS owns and manages by default. To use your own AWS Key Management Service (AWS KMS) key, choose Customize encryption settings (Advanced) and choose a key. For more information, see Encryption of transient data storage during data ingestion.

You can also choose from the following options for the data deletion policy for your data source:

For more information on managing your knowledge base, see Manage a data source.

    In the Authentication section, the supported authentication method is set to OAuth 2.0.
      For Tenant ID, enter your tenant ID. Refer to section Register a new application in the Microsoft Azure Portal of this post to get the Tenant ID. For AWS Secrets Manager secret, enter an AWS Secrets Manager Refer to the section Create a Secrets Manager secret for the SharePoint data source of this post to get the secret.

The SharePoint data source will need credentials to connect to the SharePoint Online site using the Microsoft Graph API. To facilitate this, create a new Secrets Manager secret. These credentials will not be used in any access logs for the SharePoint Online Site.

    In the Metadata Settings section, optionally select any content types that you want to include or exclude.

    In the Content chunking and parsing section, select Default.

    Choose Next. In the Embeddings model section, select Titan Embeddings G1 – Text or another embeddings model as appropriate. In the Vector database section, select Quick create a new vector store to create a vector store for the embeddings. Choose Next.

    On the Review and create page, verify the selections you made and choose Create.

The knowledge base creation should be complete.

The knowledge base with SharePoint as the data source is now created. However, the data source needs to be synced in order to crawl the site URLs and index the associated content.

    To initiate this process, on the knowledge base details page, select your data source and choose Sync.

Register a new application in the Microsoft Azure Portal

In this section, we register a new application in the Microsoft Azure Portal. We capture the Tenant ID from this step to use when configuring the data source for Knowledge Base for Amazon Bedrock. Complete the following steps:

    Open the Azure Portal and log in with your Microsoft account. If you don’t have an account, you can create one or contact your organization’s administration team. Choose New registration. Provide the following information:
      For Name, provide the name for your application. Let’s refer to this application as TargetApp. Amazon Bedrock Knowledge Bases uses TargetApp to connect to the SharePoint site to crawl and index the data. For Who can use this application or access this API, choose Accounts in this organizational directory only (<Tenant name> only – Single tenant). Choose Register. Note down the application (client) ID and the directory (tenant) ID on the Overview You’ll need them later when asked for TargetApp-ClientId and TenantId.
    Choose API permissions in the navigation pane. Configure the permissions as follows:
      Choose Add a permission. Choose Microsoft Graph. Choose Delegated permissions. Choose Read.All in the User section. Choose Read.All in the GroupMember section. Choose FullControl.All in the Sites section. Choose Add permissions. This permission allows the app to read data in your organization’s directory about the signed-in user. On the options menu (three dots), choose Remove permission. Remove the original Read – Delegated permission. Choose Grant admin consent for the default directory.

    Choose Certificates & secrets in the navigation pane.
      Choose New client secret. For Description, enter a description, such as description of my client secret. Choose a value for Expires. In production, you’ll need to manually rotate your secret before it expires. Choose Add. Note down the value for your new secret. You’ll need it later when asked for your client secret (TargetApp-ClientSecret).
    Optionally, choose Owners to add any additional owners for the application. Owners will be able to manage permissions of the Azure AD app (TargetApp).

Create a Secrets Manager secret for the SharePoint data source

Complete the following steps to create a Secrets Manager secret to connect to the SharePoint online sites listed as site URLs within the data source:

    On the Secrets Manager console, choose Store a new secret. For Secret type, select Other type of secret. For Key/value pairs, enter the following:
      username password clientId clientSecret
    For Encryption key, choose aws/secretsmanager. Choose Next. In the Secret name and description section, enter the name of the secret and an optional description. Add any associated tags in the Tags Leave Resource permissions and Replication secret as default. Choose Next. In the Configure rotation section, leave as default or modify according to your organizational policies. Choose Next. Review the options you selected and choose Store. On the secrets detail page, note your secret ARN value to be used as the secret when creating the Knowledge Base for Amazon Bedrock.

Test the solution

Complete the following steps to test the knowledge base you created:

    On the Amazon Bedrock console, choose Knowledge bases in the navigation pane. Select the knowledge base you created and choose Test.

    Choose an appropriate model for testing and choose Apply.

    Enter your question for the content housed in the SharePoint site.

Clean up

If you created a new knowledge base to experiment using this post and don’t plan to use it further, delete the knowledge base so that your AWS account doesn’t accumulate costs. For instructions, see Manage a knowledge base.

Conclusion

In this post, we showed you how to configure Amazon Bedrock Knowledge Bases with SharePoint Online as a data source. By connecting SharePoint Online as a data source, employees can interact with the organization’s knowledge and data stored in SharePoint using natural language, making it straightforward to find relevant information, extract key points, and derive valuable insights. This can significantly improve productivity, decision-making, and knowledge sharing within the organization.

Try this feature on the Amazon Bedrock console today! See Amazon Bedrock Knowledge Bases to learn more.


About the Authors

Surendar Gajavelli is a Sr. Solutions Architect based out of Nashville, Tennessee. He is a passionate technology enthusiast who enjoys working with customers and helping them build innovative solutions.

Abhi Patlolla is a Sr. Solutions Architect based out of the New York City region, helping customers in their cloud transformation, AI/ML, and data initiatives. He is a strategic and technical leader, advising executives and engineers on cloud strategies to foster innovation and positive impact.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Amazon Bedrock 知识库 SharePoint RAG 检索增强生成
相关文章