Juris-Cape is a multimodal AI legal assistant that uses Google Gemini to analyze crime scene photos, surveillance videos, and legal documents. It answers legal questions by cross-referencing valid laws (like the Bharatiya Nyaya Sanhita - BNS).
Follow these instructions to set up the project on your Windows machine.
- Install Python 3.10 or higher (Download Here).
- Get a Google Gemini API Key (Get it for free here).
- Create a
.envfile:- Look for a file named
.envin the project folder. - If it doesn't exist, create a new text file named
.env. - Open it and add your key like this:
GEMINI_API_KEY=your_actual_api_key_here
- Save the file.
- Look for a file named
Open your terminal (PowerShell or Command Prompt) in the juris- cape folder and run:
pip install -r requirements.txt(If you are using a virtual environment, make sure it is activated or use the full path to python as shown in recent attempts).
Before running the server, run the verification script to test Image, Document, and Video analysis.
python verify_multimodal.py- It will verify your API key is working.
- It will test image analysis on a generated red square.
- You can optionally paste a path to a video file to test video analysis.
Run the backend server:
python -m uvicorn app.main:app --reloadYou should see output saying Application startup complete.
Open your browser and verify the API at: 👉 http://127.0.0.1:8000/docs
You can use the Try it out button on endpoints like /gemini/chat to ask legal questions.
app/services/gemini_service.py: The brain of the operation. Handles all interactions with Google Gemini.app/api/endpoints/gemini_routes.py: The API links used by the web interface.data/vector_db: Detailed storage for legal precedents (RAG).
- "Module not found" error?
Try running with
python -m pip install -r requirements.txtagain. - "Quota exceeded" error? We are using the free tier of Gemini. If you hit limits, wait a minute and try again.
- "Unicode/Emoji" errors? Your terminal might not support emojis. The script is designed to handle this, but if it crashes, try using a modern terminal like Windows Terminal.