This module implements a Retrieval Augmented Generation (RAG) system for analyzing and querying philosophical texts, specifically focused on Kant's work.
- Python 3.13 or higher
- An OpenAI API key
- uv (optional)
- Clone the repository:
git clone https://github.com/juanejd/Kantify-app.git
cd Kantify-app/rag- Create and activate a virtual environment:
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On Unix/MacOS
source .venv/bin/activate
# Using uv
uv .venv- Install dependencies:
pip install -e .- Set up environment variables:
- Create a
.envfile in theragfolder - Add your OpenAI API key:
OPENAI_API_KEY=your-api-key-here - Create a
rag/
βββ data/ # Folder for PDF documents
βββ chroma/ # Vector database (git-ignored)
βββ main.py # Main script
βββ charge_data.py # Document loading and processing functions
βββ chroma_db.py # Vector database management functions
βββ .env # Environment variables (git-ignored)
-
Place your PDF documents in the
data/folder -
Run the main script:
python main.py
uv run main.pyThe script will:
- Load and process the documents
- Create embeddings using OpenAI's model
- Store the embeddings in a vector database
- Perform a similarity search with the predefined query
- PDF document processing
- Text chunking for manageable pieces
- Embeddings using OpenAI (text-embedding-3-large)
- Vector storage with Chroma
- Semantic content search
- The
chroma/folder contains the vector database and is git-ignored - The database is recreated each time you run the script
- Ensure you have enough disk space for the embeddings
- chromadb>=1.0.9
- langchain>=0.3.25
- langchain-openai>=0.3.17
- pypdf>=5.5.0
- python-dotenv>=1.0.0
=======
Kantify is an interactive web application that, using the Kantian ethics of universalization, helps you reflect deeply on the global ethical consequences of your everyday decisions.
It does not judge whether your actions are βgood or badβ, but generates simulations that allow you to clearly see what would happen if everyone acted as you do.
It uses sliders for nuanced responses, Bayesian network analysis, and dynamic generation of ethical questions and scenarios using artificial intelligence.
Today's society is looking for accessible tools that allow for ethical reflection on daily decisions, connecting the individual with the collective.
Existing tools are often limited to static or generic dilemmas, while Kantify offers:
- Deep interactivity
- Guaranteed anonymity
- Dynamic ethical learning
- β Adaptive interactivity based on rigorous philosophical theories
- π€ Questions dynamically generated by generative AI, based on curated knowledge bases
- π Use of robust and free Python technology tools