Coder Social home page Coder Social logo

sjy / btp-cap-genai-rag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sap-samples/btp-cap-genai-rag

0.0 0.0 0.0 34.74 MB

Explore this repository for GenAI samples on SAP Business Technology Platform (SAP BTP). We provide examples for single and multitenant versions, showcasing integration of LLMs via SAP AI Core, LangChain in SAP CAP, and advanced techniques like Retrieval Augmented Generation (RAG).

Home Page: https://discovery-center.cloud.sap/refArchDetail/ref-arch-open-ai

License: Apache License 2.0

JavaScript 12.61% TypeScript 67.53% HTML 2.31% Smarty 15.06% Dockerfile 0.18% CAP CDS 2.32%

btp-cap-genai-rag's Introduction

GenAI Mail Insights - Develop a CAP-based (multitenant) application using GenAI and RAG on SAP BTP

REUSE status

Important

SAP HANA Cloud Vector Engine General Availability Q1/2024

Welcome to our dedicated GitHub repository, designed to provide valuable support to developers, partners and customers aiming to create advanced GenAI solutions on SAP Business Technology Platform (SAP BTP) following the Reference Architecture. Inside, you'll find a carefully crafted example that follows SAP BTP's respected Golden Path development approach. We've covered both single-tenant and multitenant (Software as a Service, SaaS) versions to suit different needs. Discover how to smoothly integrate different Large Language Models (LLMs) via SAP AI Core (generative AI hub), make the most of LangChain in CAP and use advanced techniques like output parsing according a custom schema or Retrieval Augmented Generation (RAG) through embeddings and a vector database to achieve even higher value for your use case. Notably, our repository supports two runtimes, Cloud Foundry and Kyma, offering flexibility in your journey to harness GenAI on SAP BTP.

We encourage you to check out our accompanying Discovery Center Mission Develop a CAP-based (multitenant) application using GenAI and RAG along with the corresponding reference architecture guidance for Retrieval Augmented Generation with GenAI on SAP BTP. To learn more about Generative AI at SAP, we highly recommend to visit this openSAP course.


Target Architecture Architecture: Multitenant GenAI application with RAG on SAP BTP

Single Tenant Architecture

Target Singletenant Architecture Architecture: Single-tenant GenAI application with RAG on SAP BTP

Business Use Case of the Reference Application

The provided code sample presents a multitenant application crafted by a potential SAP partner or customer, tailored for SAP Business Technology Platform (SAP BTP). This scenario presents a comprehensive SaaS solution for enhancing customer support within a travel agency, utilizing advanced email insights and automation. The system analyzes incoming emails using Large Language Models (LLMs) to offer core insights such as categorization, sentiment analysis and urgency assessment. It goes beyond basic analysis by extracting key facts and customizable fields like location, managed through a dedicated configuration page.

One innovative feature involves utilizing email embeddings to identify similar historical emails, aiding in understanding how similar requests were handled previously. This fosters consistent and efficient customer service. The code also demonstrates the capabilities of summarizing and translating both email subject and body, enabling streamlined comprehension across languages.

Furthermore, the system takes automation to the next level by generating potential responses for customer inquiries. This response generation is influenced by configurable actions and services, enhancing response accuracy and speed. The flexibility to connect with SAP systems like SAP Concur adds an enterprise dimension, allowing seamless integration of processes and data.

Though initially tailored for a travel agency, the code can be adapted to suit various industries, making it a versatile solution for augmenting customer support with data-driven insights and automation.

The business scenario is also available as single-tenant version in the respective directory of this repository.

Impressions of the Reference Application

Getting started

This sample scenario comes with a step-by-step tutorial for a deployment in your own SAP BTP landscape. Check the following chapters and setup the scenario step-by-step in your own environment. The guide covers the deployment of the single-tenant as well as the multitenant version of the application.

  1. Scenario Introduction
  2. Landscape Setup
  3. Scenario Deployment
  4. Application Testing
  5. Extend the solution

Depending on your scenario (single- vs multitenant), please ensure to skip steps which are only relevant for multitenant setups. This will be mentioned in the documentation accordingly.

How to obtain support

Create an issue in this repository if you find a bug or have questions about the content.

For additional support, ask a question in SAP Community.

Known Issues, Open Tasks and Additional Details

  • Error during paketo build process
    • Description: The cap-js/sqlite package is currently not part of the dependencies as it causes issues during the paketo build process.
    • Workaround: Install the cap-js/sqlite package manually without saving it in your package dependencies by running - npm i @cap-js/sqlite --no-save in the /(multi/single)-tenant/code directory.

Contributing

Thanks to all collaborators to make this application real!

If you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.

License

Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.

btp-cap-genai-rag's People

Contributors

kay-schmitteckert avatar martinfrick avatar

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.