Inspiration

We wanted to see how philosophers from different time periods would debate in real time!

What it does

Similar to the agoras of Greece and the forums of Rome, the dialectic dome is a place for Philosophical discussion and debate. We currently host Aristotle, Immanuel Kant, David Hume, John Stuart Mill, and Arthur Schopenhauer. Visitors can watch philosophers discuss a question or a topic.

How we built it

Our project consists of a React frontend and a Flask backend server, along with a PostgreSQL server with the PGVector version installed. We filled the PostgreSQL database with corpuses of the philosopher's work, and used an embedding model to generate embeddings for each sentence in the corpuses. We have a large language foundation model downloaded from the HuggingFace Hub, which processes the previous statements and generates a response in the style of each philosopher in turn. To give more credibility to the LLM, we used retrieval augmented generation, fetching relevant information from the database using Langchain, and stuffing the context window of the foundation model with the information.

We port forwarded the Flask backend server through an SSH connection, and tokens generated by the model are streamed through the SSH connection via a Socket.IO connection. These are processed by the React frontend and displayed via state update.

Challenges we ran into

We wanted to have our dedicated server contain the Large Language Models that we will be using to simulate the selected philosophers. It was hard to find such a resource, and we ended up trying to use the W&M CS lab machines as the host, which presented us with many design problems concerning security and accessibility.

We originally envisioned the LLM to also rely on a data set composed of large bodies of text from these philosopher's published works, so preparing the database took a surprisingly long time. We tried downloading their works from Project Gutenberg as .epub files, then converting the .epub files chapter by chapter into .txt files; however, the formatting would often be messed up, so there was a lot of work that was put in cleaning up the converted .txt files. In the end, that was time wasted, since we finally noticed, after all the original converted .txt files have been cleaned, that the books could be downloaded as .txt files in the first place and without formatting issues.

Context and database is messed up. We did not parse the corpus of work correctly, resulting in incomplete sentences. The W&M CS lab machine NFS is really slow, so installing Python modules took 6 hours.

Accomplishments that we're proud of

Chris learnt how to download ebooks as plain text instead of downloading them as epubs and converting them part by part into txt files.

What we learned

We learnt some basics of database.

What's next for DialecticDome

The end goal is for there to be many more philosophers available in the Dialectic Dome, and also for there to be extrapolated versions of these philosophers who can discuss topics prevalent in modern society with the knowledge of modern science.

Built With

Share this project:

Updates