Chatbot for Biodata Catalyst
Clone the BDC website repo to a directory with the same parent directory as this repo.
Clone the BDC gitbook repo to a directory with the same parent directory as this repo.
Copy .env_example to .env and make any necessary changes
pip install -r requirements.txt
# OR
pip install langchain_chroma langchain_core langchain_openai langchain-community langchain langchain-ollama langserve[all] langchain-cli flashrank chroma-hnswlib langchain-google-genai rank_bm25 nemoguardrails streamlit streamlit_d3graph fastapi[standard] scikit-learn nltk beautifulsoup4 Babel python-dotenvkubectl -n ner port-forward svc/vllm-server 8080:80 # vLLM port-forward
kubectl -n ner port-forward svc/ollama 11434:11434 # Ollama port-forwardEdit .env to match
python -m utils.preproc_doc # preprocess BDC website repo
python -m utils.prepare_chromadb # create chroma dbstreamlit run app.py # run streamlit appfastapi dev server.py # run langserve backend
streamlit run client.py # run streamlit frontend{
"input": user query,
"chat_history": chat history,
"context": retrieved docs,
"topic": query topic (for predefined response),
"response": predefined response,
"flag": predefined response flag,
"answer": chatbot answer,
"display_answer": chatbot answer with predefined response,
"bdcbot_response": bdcbot answer (empty if not called),
"dugbot_response": dugbot answer (empty if not called)
}Warning
- If you see
ValueError: Received disallowed comparator ninwhen running the chatbot app, addComparator.IN, Comparator.NINtolangchain_community\query_constructors\chroma.pyunderallowed_comparators
Important
- To use
${\color{orange}\text{vLLM}}$ API for chat completion, removeparallel_tool_calls=Falsefromlangchain_openai\chat_models\base.py - Chroma DB initialization might quit without error or warning, might be caused by compatibility issue with Windows.