Skip to content

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.

Notifications You must be signed in to change notification settings

juanejd/Kantify-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Kantify RAG

This module implements a Retrieval Augmented Generation (RAG) system for analyzing and querying philosophical texts, specifically focused on Kant's work.

Prerequisites

  • Python 3.13 or higher
  • An OpenAI API key
  • uv (optional)

Installation

  1. Clone the repository:
git clone https://github.com/juanejd/Kantify-app.git
cd Kantify-app/rag
  1. 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
  1. Install dependencies:
pip install -e .
  1. Set up environment variables:
    • Create a .env file in the rag folder
    • Add your OpenAI API key:
    OPENAI_API_KEY=your-api-key-here
    

Project Structure

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)

Usage

  1. Place your PDF documents in the data/ folder

  2. Run the main script:

python main.py
uv run main.py

The 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

Features

  • PDF document processing
  • Text chunking for manageable pieces
  • Embeddings using OpenAI (text-embedding-3-large)
  • Vector storage with Chroma
  • Semantic content search

Notes

  • 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

Main Dependencies

  • 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.

Opportunity Alpha

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

Kantify Competitive Advantage

  • βœ… 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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages