This demo showcases an AI-powered news website.
- Joint play of Python/Flask, MongoDB Atlas, Vector Search, Langchain, and OpenAI.
- Allows to experiment with Personalization, Content Suggestions, Summarization, Keyword Extraction, and RAG-based News Insights. See ist.media/welcome for more information about the functionality of the demo.
First and foremost - the application is installed and ready to run in the cloud. You should only aim for installing yourself if there's a strong reason for it.
I am hosting the webapp on a NetBSD/amd64 machine with 4 GB of RAM, 2 CPUs, and a 40 GB NVMe disk, running in Frankfurt at vultr.com, and connecting to MongoDB Atlas, running an M10 at GCP/Frankfurt.
Ok, if you still want to get the demo running locally, here's the instructions.
OPENAI_API_KEY="<your token>"
MONGODB_IST_MEDIA="<your connection string>"
brew install python@3.11
export PATH="$(brew --prefix)/opt/python@3.11/libexec/bin:$PATH"
python3 -m venv <dir>
cd <dir>; source ./bin/activate
pip install -r ist.media/requirements/python-packages
They have to follow this schema:
The embedding
field is calculated by calling ist.media/scripts/vectorize.py
, the keywords
field is calculated with AI on-the-fly, so can be left alone. Finally, visit_count
and read_count
will be calculated in a later version of the demo from within application code, so these also do not need to be existing in your data model.
A vector index should then be calculated from within the Atlas web interface, using cosine
similarity and 1536
dimensions.
cd ist.media
./bin/uwsgi-debug.start
You will probably need to adapt some paths in the start script. If all goes well, you can access the app from your browser at localhost:9090.
I want to thank Steve Dalby and Boris Bialek for giving me the opportunity to build this demo - it is so much fun!