This version of the project loads and indexes the Ivorian Nationality Code into a Weaviate vector database and enables contextual search with RAG (Retrieval-Augmented Generation) using Cohere.
- Streamlit – Web interface
- Weaviate Cloud – Vector database (WCS cluster)
- Cohere – Text generation API (RAG)
- Docling – PDF extraction and hierarchical chunking
- Google Colab – Cloud-based runtime with GPU support
- Ngrok – Temporary public URL for the app
law/
├── main.py # Main Streamlit app script
├── code.pdf # Legal document to index (Ivorian Nationality Code)
├── requirements.txt # Required Python packages
├── README.md # Project description and instructions (this file)
- Upload your
code.pdf
file into/content/law
- Set the following credentials inside
main.py
:cohere_api_key
: your Cohere API keyAuthApiKey
: your Weaviate API keycluster_url
: your Weaviate Cloud REST endpoint
- Run
main.py
to:- Extract and chunk the PDF
- Index data in Weaviate
- Launch the Streamlit app
- A public URL will be displayed via Ngrok
You can enter natural language queries such as:
"nationalité par filiation"
"perte de nationalité"
"mariage"
This project is for research and educational purposes. License terms depend on the original repository policy.