Miet (rent) + Shield (protection) — An AI-powered tenant rights assistant for Germany.
MietShield helps tenants — especially international students and expats — understand their rights under German rental law (Mietrecht). It is powered by a multi-agent AI system built with LangGraph and served via FastAPI, with a zero-friction ChatGPT-style interface.
⚡ RAG Feature Branch: A more advanced version using a FAISS Vector Database + HuggingFace sentence-transformers for semantic law retrieval is available on the eat/rag-search branch. The main deployment uses a simpler approach for Vercel serverless compatibility.
- 💬 Conversational AI: Ask questions about your rights, notice periods, and deposit rules.
- 📄 Lease Analysis: Attach a PDF lease directly in the chat. The AI will extract clauses, flag illegal terms (Red Flags 🔴), and summarize everything natively in the chat feed.
- 🧠 Context-Aware Memory: Built on LangGraph's
SqliteSaver, the AI remembers the lease you uploaded and the context of the entire conversation for seamless follow-up questions. - 🔒 Privacy-First Processing: Leases are processed entirely in memory (RAM). Files are never saved to disk or a database, ensuring maximum tenant privacy.
- ⚡ Zero-Friction "Guest Mode": Session management uses Local Storage, allowing users to interact with the app instantly without signing up.
- Frontend: Vanilla HTML, CSS (Glassmorphism UI), and JavaScript.
- Backend: Python, FastAPI.
- AI Orchestration: LangGraph, LangChain.
- LLM Provider: OpenRouter (Supports Llama 3.3 70B & Gemini 2.0 Flash).
- Document Parsing: PyMuPDF (
fitz). - Deployment: Optimized for Vercel Serverless (Python).
Ensure you have Python 3.10+ installed.
git clone https://github.com/ZiadXI/MietShield.git
cd MietShield
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows use: .\.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the root directory and add your OpenRouter API key:
openai_api_key=sk-or-v1-YOUR_OPENROUTER_KEY_HEREYou will need two terminal windows.
Terminal 1 (Backend):
uvicorn backend.main:app --reloadTerminal 2 (Frontend):
python -m http.server 5500 --directory frontendNavigate to http://127.0.0.1:5500 in your browser to start chatting!
MietShield is architected to be deployed for free on Vercel, bypassing CORS issues by hosting both the frontend and backend on the same domain.
- The project includes a
vercel.jsonandapi/index.py. - Push your code to GitHub.
- Import the repository into Vercel.
- Add your
openai_api_keyin the Vercel Environment Variables. - Vercel will automatically build the static frontend and route
/api/*traffic to the Python Serverless functions.
Note: Vercel's free tier has a 10-second timeout. Ensure you are using a fast model (like Gemini Flash) in
state.pyto prevent504 Gateway Timeouterrors.
Disclaimer: MietShield AI can make mistakes and hallucinate. It is not a substitute for official legal counsel (Mieterverein or Rechtsanwalt).
