JellyChat is a project that aims to create a chatbot that can answer questions about DeFiChain and its ecosystem.
❗ There are many people which want to learn more about DeFiChain and its ecosystem. However, it is not always easy to find the right information. Also, many people struggle to take in information from various articles in a wiki.
✨ JellyChat aims to solve this by providing the ability for users to interactively ask questions and have an ongoing conversation.
- Make learning about DeFiChain fun.
- Be able to answer general questions about DeFiChain and its ecosystem.
- Be able to answer questions involving on-chain data.
- Behave like Jelly (the DeFiChain mascot).
- Feel like a friend that you can ask anything.
This gives a high-level overview of the architecture. For more details, please refer to the individual components.
Identification of accounts is done with a user_token
which the client needs to store. The client then posts this user_token
to /history
and gets the history back if the account exists. If the account does not exist, a new one is created automatically.
The client posts a user message and a user_token
to /user_message
. A LangChain agent will be created for the specific user_token
and the memory is filled from the history. The agent will then analyze the user's message and return an answer. The answer is then returned to the client and also added to the history.
The Repository contains the following key components.
The backend is a Flask API that receives questions and returns answers. It uses a LangChain agent to analyze the question and then uses various tools to best answer the question.
We use Supabase to store:
- Users
- Messages
- QA data
- Embeddings
Contains a script that is executed daily at 02:45 UTC via a GitHub action. However, it only runs if there have been changes to the /docs
directory within 0ptim/DeFiChainWiki in the past 24 hours. If changes are detected, the script scrapes the DeFiChainWiki to generate new embeddings. These embeddings are then stored in Supabase in the table embeddings
.
The main
branch resembles the production code. When a feature is ready, a pull request is created onto main
. This will trigger the staging actions so the changes can be tested on the staging environment.
- 💽 Staging Database
- Endpoint: https://iajfqvpslzrtmvekqwpv.supabase.co
- 🌐 Staging Backend
- Endpoint: https://jellychat-staging.fly.dev
When the pull request is merged (changes are pushed to main
), the production action will be triggered and the changes will be deployed to production.