# GenAI Mail Insights

A sample CAP-based application on SAP Business Technology Platform that demonstrates retrieval-augmented generation and LLM-based email analysis using SAP AI Core and SAP HANA Cloud's vector engine.

GenAI Mail Insights is a reference sample for building a generative AI application on SAP Business Technology Platform following SAP's Golden Path development approach. It shows how to integrate large language models through SAP AI Core's Generative AI Hub, use LangChain inside SAP's CAP framework, and perform retrieval-augmented generation with embeddings stored in SAP HANA Cloud's vector engine.

The example use case analyzes incoming customer support emails for a travel agency, using an LLM to categorize messages and assess sentiment and urgency, extract key facts and configurable custom fields such as location, and find similar historical emails through embeddings to show how comparable requests were handled before.

A separate, lighter branch provides a backend-only sample of the same architecture without the full application. It is written in TypeScript and licensed under Apache-2.0.

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