Skip to content

sjsu-library/kingbotgpt

Repository files navigation

KingbotGPT

KingbotGPT is SJSU Library's chatbot. The chatbot is capable of answering questions about the library and its services. It uses a retrieval-augemented generation (RAG) model, and relies on information from the library's website and a local dataset of questions and answers.

Architecture

In production, KingbotGPT includes the following components:

  • User Interface:Streamlit
  • Chatbot Control: LlamaIndex
  • Vector Database: ChromaDB
  • Web Scraper: Scrapy
  • Usage Data: MySQL
  • LLM: ChatGPT API kingbot 2025

Limitations of this distribution

In packaging this shareable code, we are currently choosing to prioritize the ability to run the shared code immediately on Streamlit Community Cloud or any other Streamlit environment. For this reason, the shared code includes only the user interface, chatbot control, and connection to the LLM. Because both the process for creating the local vector database and the usage statistics are hosted outside of the Streamlit environment, we have omitted them from this distribution of the code.

For an example of a RAG chatbot where the vector database is generated and stored within the Streamlit environment, consider our "workshop chatbot" which we use when teaching RAG chatbot development within the library.

If you are interested in the other components of KingbotGPT, please reach out! We are interested in sharing this code with other libraries in the format that would be most useful to you!

Quick Start

To make your own copy of KingbotGPT, you will need:

Quick Start Steps

  1. Fork this repository on GitHub
  2. Deploy your app on Streamlit Community Cloud. For the main file path, enter "llamainchatbot.py".
  3. Before running your app, add your OpenAI API key to the app's secrets file. The app expects the key as "openai.key". You can manage secrects in Streamlit's user interface. DO NOT create a secrets.toml file in your forked repository!

That's it! From there, you can modify the chatbot prompt and other elements in the file llamainchatbot.py.

More Information

You can read about the development of KingbotGPT in Library-Led AI: Building a Library Chatbot as Service and Strategy in the ACRL 2025 Conference Proceedings. Please feel free to contact the Kingbot team at kingbot@sjsu.edu.

About

Shareable code for SJSU Library's KingbotGPT Chatbot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages