Here's your updated README.md with all the new sections added:
A multilingual Retrieval-Augmented Generation (RAG) system that helps craftspeople and small businesses understand GDPR compliance requirements through natural language conversations.
This project creates an intelligent assistant that can answer data protection questions specifically tailored for craftspeople and small businesses. The system uses German GDPR guidelines and can handle questions in both English and German.
Primary Datasets:
-
ZDH Data Protection Guide for Crafts Businesses (Download PDF)
- Description: Comprehensive GDPR guidelines specifically designed for craftspeople and small businesses in Germany. Covers practical implementation of data protection rules with sector-specific examples and recommendations.
- Author: Dr. Markus Peifer, Head of Organization and Law Department, ZDH (Zentralverband des Deutschen Handwerks - Central Association of German Skilled Trades)
-
BITKOM AI & Data Protection - Practical Guide 2.0 (Download PDF)
- Description: The second edition of the "AI & Data Protection" practical guide serves as a comprehensive reference for companies and organizations that want to use and implement AI technologies in compliance with data protection regulations. It provides practical instructions, legal foundations, and concrete tools to ensure that the processing of personal data is in line with GDPR and other relevant regulations.
- Key Features: Contains definitions, instructions, and practice-oriented checklists. Specifically addresses data protection requirements and ethical questions when using AI systems. Includes detailed examples and implementation tips for data protection-compliant AI implementation.
- Organization: BITKOM is Germany's most important digital association and largest European think tank for digital topics, with over 2,200 member companies including SMEs, tech startups, and DAX corporations.
Key Topics Covered:
- Basic data protection principles for small businesses
- Customer data handling requirements
- Employee data management
- Data retention periods
- Marketing and consent rules
- Data breach procedures
- AI-specific data protection requirements
- Ethical AI implementation
- Practical implementation guidance
- POC 1 β : Ask questions in German, receive answers in German
- POC 2 β : Ask questions in English or German, receive answers in the same language
- MVP 1 β
: Web interface with chatbot functionality - Live at: (
Streamlit Cloud) - MVP 2 β : Enhanced knowledge base with AI & Data Protection guidelines - BITKOM guide integrated
- β LangSmith Integration: Real-time tracing and monitoring
- β Performance Evaluation: Automated testing and metrics
- β Enhanced UI: Improved user experience with expandable sections
- Framework: LangChain
- Vector Database: Pinecone
- Embeddings: "text-embedding-3-small" Sentence Transformers (multilingual)
- Language Model: OpenAI "gpt-3.5-turbo"
- Web Interface: Streamlit
- Monitoring: LangSmith for tracing and evaluation
- Language Support: Multilingual: tested in German & English
gdpr_compliance_assistant/
βββ notebooks/ # Jupyter notebooks for development
β βββ 01_text_pdf_processing_document-2.ipynb # Process PDF β chunks
β βββ 02_pinecone_upload.ipynb # Upload to Pinecone (run once)
β βββ 03a_rag_chain.ipynb # Build RAG (uses existing index)
β βββ 03b_rag_agent_tests.ipynb # Experiments with Agent & RAG
β βββ 04_pinecone_upload_new_documents.ipynb # Modular PDF processing
β βββ 05_evaluate_gdpr_chatbot.ipynb # LangSmith evaluation
βββ data/
β βββ raw/ # Original PDF documents
β βββ processed/ # Processed chunks and vector database
βββ pages/ # Streamlit app pages
β βββ 1_π‘οΈ_GDPR_AI_Compliance_Assistant.py # Main chatbot interface
β βββ 2_About_the_app.py # About page
βββ home_app.py # Streamlit app launcher
βββ backend.py # Core RAG logic and LangSmith setup
βββ utils.py # Utility functions
βββ docs/ # Documentation, sample chats, evaluation results and test questions
β βββ german_experiment_results.csv # Evaluation results
βββ img/ # Screenshots and images of LangSmith monitorin
βββ src/ # Source helper functions for the notebooks
βββ requirements.txt # Dependencies
- Multilingual Support: Questions and answers tested mainly in German and English
- Context-Aware Answers: Based on official craftspeople and AI guidelines
- Live Web Interface: Accessible via Streamlit deployment
- Dual Knowledge Base: Combines traditional GDPR and AI-specific data protection
- Conversation Memory: Maintains context across multiple questions
- Source Transparency: Shows which documents were used for answers
The system processes PDF documents through:
- Text Extraction: Automatic extraction from German PDFs
- Intelligent Chunking: Semantic splitting with meaningful metadata
- Multilingual Embeddings: Vector representations for semantic search
- RAG Pipeline: Combines retrieval with generative AI
The app features a modern multi-page structure:
home_app.py- Main launcher that initializes the apppages/1_π‘οΈ_GDPR_AI_Compliance_Assistant.py- Primary chatbot interfacepages/2_About_the_app.py- Information and documentation pagebackend.py- Core RAG logic with LangSmith integration
- Sidebar Navigation: Easy switching between chat and about pages
- Expandable Welcome Section: Guided introduction for new users
- Real-time Chat Interface: Interactive Q&A with source citations
- Responsive Design: Optimized for both desktop and mobile
Live Demo: multilingual-gdpr-rag-germany.streamlit.app
The app is fully integrated with LangSmith for comprehensive monitoring:
- Automatic Trace Collection: Every user interaction is logged
- Performance Metrics: Response times, token usage, and quality metrics
- EU Data Residency: All data processed through EU endpoints for compliance
- Dashboard Analytics: Real-time insights into app usage and performance
LangSmith monitoring dashboard showing real-time traces and performance metrics
# LangSmith setup in backend.py
os.environ["LANGSMITH_TRACING"] = "true"
os.environ["LANGSMITH_API_KEY"] = "your_api_key"
os.environ["LANGSMITH_ENDPOINT"] = "https://eu.api.smith.langchain.com"
os.environ["LANGSMITH_PROJECT"] = "GDPR-Compliance-Assistant"The chatbot has been evaluated using LangSmith's evaluation framework:
- Test Dataset: 10 English / German questions covering various GDPR topics
- Evaluation Metrics:
- Groundedness: 0.8 (Answers based on source documents)
- Relevance: 0.8 (Answers directly address questions)
- Results File:
docs/german_experiment_results.csv
- Dataset Creation: Curated English / German test questions with expected answers
- Automated Testing: LangSmith runs the chatbot against all test cases
- LLM-as-Judge: GPT-4 evaluates answer quality and accuracy
- Performance Tracking: Continuous monitoring of improvement over time
LangSmith evaluation dashboard showing Experiments that measure the quality of your applications.
The project includes comprehensive test materials to evaluate chatbot performance:
-
docs/sample_questions_1_test_questions.md- Diverse test questions covering:- Basic GDPR principles and compliance
- AI-specific data protection requirements
- Multilingual capabilities (German/English)
- Edge cases and complex scenarios
-
docs/sample_questions_2_memory-test.md- Conversation sequences testing:- Follow-up question understanding
- Context retention across multiple exchanges
- Progressive topic exploration
Real conversation examples demonstrating the chatbot's capabilities:
docs/sample_chats/Bakery_20251017_090204.txt- Fundamental GDPR compliance queriesdocs/sample_chats/chatbot-wrong-information_20251017_084723.txt- AI-specific data protection discussionsdocs/sample_chats/IT_Violazione_Dati_IA_20251016_095600.txt- Chat in Italian about data protection violations
These test materials serve as both quality assurance tools and demonstration of the chatbot's knowledge range and conversational abilities.
- Human Feedback Integration: π/π rating system connected to LangSmith for continuous improvement
- LangGraph Migration: Update to current LangChain code system for better agent orchestration
- Enhanced Tooling: Additional tools for document analysis and compliance checking
- Model Toggle: Switch between different LLMs (OpenAI/Hugging Face) and embedding models
- Advanced Analytics: Deeper insights into user behavior and common question patterns
This project is developed as part of a data science learning journey. Contributions and suggestions are welcome!
This assistant provides general guidance based on official documentation but does not constitute legal advice. For specific legal questions, consult with qualified legal professionals or local trade organizations (Handwerkskammern, Innungen, FachverbΓ€nde).
This project is for educational purposes. The source documents are property of their respective organizations (ZDH, BITKOM).
For questions about this project or suggestions for improvement, please open an issue in the repository.
Built with β€οΈ for craftspeople and other businesses navigating data protection regulations in Germany