How robel-dev/ecowissen works
Project type and purpose
• This is a full-stack Retrieval-Augmented Generation (RAG) system named “EcoWissen Freiburg” that answers sustainability and environmental questions about Freiburg by combining vector-based document retrieval with a large language model.
• It consists of three logical subsystems:
a. A Flask-based backend (RAG-backend/) exposing REST endpoints for document ingestion and query handling.
b. A Streamlit-based frontend (RAG-frontend/) providing a bilingual chat UI with carbon-footprint tracking and export functionality.
c. A fine-tuning pipeline (finetune/) that prepares data and trains a custom model on sustainability Q&A pairs.
File structure
• Top-level:
• RAG-backend/
– chatbot.py: Flask server main
– utils.py: text cleaning, formatting
– database/: Chroma vector-store files
– dataset/: raw PDFs & JSONs used to populate Chroma
– energy-measurement.py: carbon-footprint tracking
• RAG-frontend/
– streamlit-chat.py: UI entry point
– model.py: wrappers around the LLM API
– translations.py: bilingual label dictionary
• finetune/
– prepare_training_data.py & notebooks: JSON Q&A prep
– configs/: YAML for fine-tuning
– models/: output folder for saved fine-tuned LLM
• requirements.txt
• Patterns & configs:
• Separation of concerns (ingest vs query vs UI)
• Chroma vector database as retrieval layer
• LangChain or similar for document embedding & querying
• PyTorch/Transformers for model fine-tuning
README for additional insights
• Confirms the three main modules: Backend, Frontend, Fine-tuning Pipeline
• Technical stack: Flask, Streamlit, ChromaDB, LangChain, Meta-Llama-3, OpenLlama 3B
• Special features: bilingual UI, carbon footprint visualization, PDF export