Skip to content

AndrMoura/streamlit-chatbot-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streamlit Chatbot Application

This repository contains a Streamlit-based chatbot application that leverages Ollama with Langchain library and integrates PostHog-LLM for analytics and monitoring.

My Animation

Features

  • AI Chatbot: Uses Ollama with Langchain.
  • Integration with PostHog-LLM: Enables detailed monitoring of chatbot interactions.
  • Simple UI: Built with Streamlit for an easy-to-navigate user interface.

Installation

Clone the Repository

Clone this repository to your local machine:

git clone https://github.com/AndrMoura/streamlit-chatbot-analytics.git
cd streamlit-chatbot-analytics

Create a Virtual Environment

Create a new virtual environment using venv:

python -m venv venv

Activate the virtual environment:

For Windows:

venv\Scripts\activate

For macOS and Linux:

source venv/bin/activate

Install Dependencies

Install the necessary Python packages in requirements.txt:

pip install -r requirements.txt

Install PostHog-LLM

Run the following command to install PostHog-LLM for monitoring:

sudo  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/postlang/posthog-llm/HEAD/bin/deploy-hobby)"

After a few minutes your PostHog-LLM instance will be available at https://localhost. Create your account and project grab your API key and export the following environment variables:

export POSTHOG_HOST='http://localhost'
export POSTHOG_API_KEY='UNDER_SETTINGS_PAGE'

Install Ollama and download Llama3 model

Go to Ollama website and install for your OS. After installation, download the Llama3 8b model:

ollama run llama3

Running the ChatBot Application

Run the application using Streamlit:

streamlit run streamlit/app.py

Usage

After starting the application, navigate to the provided local URL (http://localhost:8501) in your web browser to interact with the chatbot.

Check the PostHog-LLM instance in the activity page to monitor the chatbot interactions.

About

Streamlit-based chatbot leveraging Ollama via LangChain and PostHog-LLM for advanced logging and monitoring

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages