This project demonstrates a Document Grounding (RAG) pipeline with built-in Data Masking using the SAP AI SDK and Groq API (OpenAI compatible).
Watch the step-by-step tutorial on YouTube:
Accelerate your career by mastering AI development in the SAP ecosystem.
Enroll in the Course Here (Special Discount Included)
Get the RAG pipeline running in 1 minute! 🚀
- Node.js 18+
- Groq API key (free from https://console.groq.com/keys)
# Set your Groq API key
export GROQ_API_KEY="your-groq-api-key-here"
# Install dependencies
npm install
# Run demo
npm run start1(Note: npm run start1 executes start_demo.ts)
- Grounding (RAG): Connect your LLM to local documentation for accurate, context-aware answers.
- Data Masking: Automatically identify and mask PII (Emails, Names, IDs) before sending data to the LLM.
- SAP AI SDK: Built using the foundational capabilities of the SAP AI SDK.
- Groq Integration: Leverages Groq's ultra-fast, OpenAI-compatible API.
knowledge-base/: Contains the source documents (courses.md) used for grounding.vector-store.ts: Simple vector-based retrieval logic.data-masking-layer.ts: Logic for protecting sensitive data.grounding-pipeline.ts: Orchestrates the flow between masking, retrieval, and the LLM.start_demo.ts: The main entry point to see everything in action.
You can add or modify content in knowledge-base/courses.md. Use the following format for chunks:
## chunk_id_001
**Component:** Subject Name
**Category:** Category Name
**Content:**
Your detailed documentation content here...Built with ❤️ for the SAP Developer Community.

