Session-based Custom ChatGPT Model for Website Content Utilizing OpenAI GPT-4 LLM, Langchain ConversationalRetrievalChain, and MongoDB Conversational Memory

Happy LLM

(λx.x)eranga
Effectz.AI
26 min readDec 29, 2023

--

Background

In my previous post, I detailed the development of a customized ChatGPT, leveraging the OpenAI GPT-3.5 LLM, Langchain, and LlamaIndex, with a special emphasis on integrating a unique dataset. This article explores the creation of a session-based custom ChatGPT model(Chatbot), utilizing the more advanced capabilities of the OpenAI GPT-4 LLM and Langchain’s ConversationalRetrievalChain. The ConversationalRetrievalChain combines the capabilities of a language model with an external information retrieval system(e.g document, database data, website data etc). The aim is to enhance the language model’s responses with up-to-date, external information. It processes a user’s input by first using an information retrieval system to gather relevant information from external sources. Then, this information is passed to a language model, which incorporates it into the response.

Leveraging the functionalities of the ConversationalRetrievalChain, the Chatbot incorporates a custom-made dataset, which is dynamically scraped from an online website using Langchain’s RecursiveUrlLoader. Users can interact with the website’s data through the Chatbot, which is powered by OpenAI’s GPT-4 LLM. For demonstration purposes, I’ve selected the Open5GS documentation website (Open5GS is a C-language implementation of the 5G Core). The data from the Open5GS documentation is scraped using Langchain’s RecursiveUrlLoader, split, and then stored in the Chroma vector database as vector embeddings. Consequently, users can seamlessly interact with the content of the Open5GS documentation via the Chatbot, which is built with the GPT-4 LLM. The GPT-4 LLM provides answers to user questions based on the content in the Open5GS documentation.

A key feature of this API is its capability to simultaneously handle requests from multiple users while effectively managing their individual sessions. This functionality is anchored in the integration of MongoDB for chat conversational memory management. This setup ensures that all user chat histories are persistently stored in MongoDB, facilitating the retrieval of past interactions. Such a memory system is crucial for maintaining a rich, context-aware dialogue history, enhancing the chatbot’s capacity for engaging in more meaningful and contextually relevant discussions, informed by knowledge of previous interactions.

Functionality

The following section discusses the main functionalities of the Chatbot. A comprehensive functional architecture, encompassing these various components, is detailed in the figure below.

1. Scrape Web Data

Langchain provide different types of document loaders to load data from different source as Document's. RecursiveUrlLoader is one such document loader that can be used to load the data in web url into documents. This step employs Langchain’s RecursiveUrlLoader to scrape data from the web as documents. RecursiveUrlLoader scrapes the given url recursively in to given max_depth and read the data on the web. This data used to create vector embedding and answer questions of the user.

2. Split Documents

When handling lengthy pieces of text, it’s essential to divide the text into smaller segments. Although this task seems straightforward, it can encompass considerable complexity. The goal is to ensure that semantically related segments of text remain together. The Langchain text splitter accomplishes this task effectively. Essentially, it divides the text into small, semantically meaningful units (often sentences). These smaller segments are then combined to form larger chunks until they reach a certain size, determined by a specific function. Upon reaching this size, the chunk is designated as an individual piece of text, and the process begins anew with some overlap. For this particular scenario, I have employed the RecursiveCharacterTextSplitter to split the scraped documents into manageable chunks.

3. Create Vector Embedding

Once the data is collected and split, the next step involves converting this textual information into vector embeddings. These embeddings are then created from the split data. Text embeddings are crucial to the functioning of LLM operations. While it’s technically feasible to work with language models using natural language, storing and retrieving such data is highly inefficient. To enhance efficiency, it’s necessary to transform text data into vector form. There are dedicated machine learning models specifically designed for creating embeddings from text. In this case, I have utilized OpenAIEmbeddings to generate vector embeddings. The text is thereby converted into multidimensional vectors, which are essentially high-dimensional numerical representations capturing semantic meanings and contextual nuances. Once embedded, these data can be grouped, sorted, searched, and more. We can calculate the distance between two sentences to determine their degree of relatedness. Importantly, these operations transcend traditional database searches that rely on keywords, capturing instead the semantic closeness between sentences.

4. Store Vector Embedding in Chroma

The generated vector embeddings are then stored in the Chroma vector database. Chroma(commonly referred to as ChromaDB) is an open-source embedding database that makes it easy to build LLM apps by storing and retrieving embeddings and their metadata, as well as documents and queries. Chroma efficiently handles these embeddings, allowing for quick retrieval and comparison of text-based data. Traditional databases work well for exact queries but fall short when it comes to understanding the nuances of human language. Enter Vector Databases, a game-changer in handling semantic search. Unlike traditional text matching, which relies on exact words or phrases, vector databases like Postgres with pgvector process information semantically. This database is a cornerstone of the system’s ability to match user queries with the most relevant information from the scraped content, enabling fast and accurate responses.

5. User Ask Question

The system provides an API through which users can submit their questions. In this use case, users can ask any question related to the content of the Open5GS documentation. This API serves as the primary interface for interactions between the user and the chatbot. The API takes a parameter, user_id, which is used to identify different user sessions. This user_id is used for demonstration purposes. In real-world scenarios, it could be managed with an Authorization header (e.g., JWT Bearer token) in the HTTP request. The API is designed to be intuitive and accessible, enabling users to easily input their queries and receive responses.

6. Create Vector Embedding of Question

When a user submits a question through the API, the system converts this question into a vector embedding. The generation of the embedding is automatically handled by the ConversationalRetrievalChain. This facilitates the semantic search of documents related to the question within the vector database.

7. Semantic Search Vector Database

Once the vector embedding for the question is created, the system employs semantic search to scan through the vector database, identifying content most relevant to the user’s query. By comparing the vector embedding of the question with those of the stored data, the system can accurately pinpoint information that is contextually similar or related to the query. In this scenario, I have utilized the ConversationalRetrievalChain, which automatically handles semantic searches based on the input query. The results of the semantic search are then identified as context for the LLM.

8. Generate Prompt

Next, the ConversationalRetrievalChain generates a custom prompt with the user’s question and the semantic search result (context). A prompt for a language model is a set of instructions or input provided by the user to guide the model’s response. This helps the model understand the context and generate relevant and coherent language-based outputs, such as answering questions, completing sentences, or engaging in a conversation.

9. Post Prompt to LLM

After generating the prompt, it is posted to the LLM (in our case, the OpenAI GPT-4 LLM). The LLM then finds the answer to the question based on the provided context. The ConversationalRetrievalChain handles this function of posting the query to the LLM (behind the scenes, it uses OpenAI APIs to submit the question).

10. LLM Generate Answer

The LLM, utilizing the advanced capabilities of OpenAI GPT-4, processes the question within the context of the provided content. It then generates a response and sends it back.

11. Save Query and Response in MongoDB Chat History

Langchain provides a variety of components for managing conversational memory. In this chatbot, MongoDB has been employed for the management of conversational memory. At this stage, both the user’s question and the chatbot’s response are recorded in MongoDB storage as part of the chat history. This approach ensures that all user chat histories are persistently stored in MongoDB, thus enabling the retrieval of previous interactions. The data is stored in MongoDB on a per-user-session basis. To distinguish between user sessions, the API utilizes the user_id parameter, as previously mentioned. This historical data is pivotal in shaping future interactions. When the same user poses subsequent questions, the chat history, along with the new semantic search results (context), is relayed to the LLM. This process guarantees that the chatbot can maintain context throughout a conversation, resulting in more precise and tailored responses.

12. Send Answer Back to User

Finally, the answer received from the LLM is forwarded to the user via the HTTP API. Users can continue to ask different questions in subsequent requests by providing the same user_id. The system then recognizes the user’s chat history and includes it in the information sent to the LLM, along with the new semantic search results. This process ensures a seamless and contextually aware conversation, enriching the user experience with each interaction.

Implementation

The complete implementation of this ChatBot is detailed below. The full source code of the ChatBot agent is available for access and review on GitLab.

1. Configurations

In the config.py file, I have defined various configurations used in the ChatBot. These configurations are read through environment variables in adherence to the principles of 12-factor apps.

import os

# openai api key
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY', '')

# define init index
INIT_INDEX = os.getenv('INIT_INDEX', 'false').lower() == 'true'

# vector index persist directory
INDEX_PERSIST_DIRECTORY = os.getenv('INDEX_PERSIST_DIRECTORY', "./data/chromadb")

# target url to scrape
TARGET_URL = os.getenv('TARGET_URL', "https://open5gs.org/open5gs/docs/")

# http api port
HTTP_PORT = os.getenv('HTTP_PORT', 7654)

# mongodb config host, username, password
MONGO_HOST = os.getenv('MONGO_HOST', 'localhost')
MONGO_PORT = os.getenv('MONGO_PORT', 27017)
MONGO_USER = os.getenv('MONGO_USER', 'testuser')
MONGO_PASS = os.getenv('MONGO_PASS', 'testpass')

2. HTTP API

The HTTP API implementation is carried out in api.py. This API includes an HTTP POST endpoint api/question, which accepts a JSON object containing a question and user_id. The user_id is utilized for demonstration purposes. In a real-world application, this could be managed with an Authorization header (e.g., JWT Bearer token) in the HTTP request. When a question request is received from the user, it is forwarded to the chat function in the ChatBot model.

from flask import Flask
from flask import jsonify
from flask import request
from flask_cors import CORS
import logging
import sys
from model import init_index
from model import init_conversation
from model import chat
from config import *

app = Flask(__name__)
CORS(app)

logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

@app.route('/api/question', methods=['POST'])
def post_question():
json = request.get_json(silent=True)
question = json['question']
user_id = json['user_id']
logging.info("post question `%s` for user `%s`", question, user_id)

resp = chat(question, user_id)
data = {'answer':resp}

return jsonify(data), 200

if __name__ == '__main__':
init_index()
init_conversation()
app.run(host='0.0.0.0', port=HTTP_PORT, debug=True)

3. ChatBot Model

Below is the implementation of the ChatBot Model. It includes a function, init_index, which scrapes data from a given web URL and creates the vector store. An environment variable, INIT_INDEX, is used to determine whether to create the index. The init_conversation function initializes the ConversationalRetrievalChain, while the chat function is responsible for posting questions to the LLM.

import os
from langchain.chat_models import ChatOpenAI
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from langchain.chains import ConversationalRetrievalChain
from langchain.memory import ConversationBufferMemory
from langchain.llms import OpenAI
from langchain.memory import MongoDBChatMessageHistory
from langchain.document_loaders.recursive_url_loader import RecursiveUrlLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from bs4 import BeautifulSoup as Soup
from langchain.utils.html import (PREFIXES_TO_IGNORE_REGEX,
SUFFIXES_TO_IGNORE_REGEX)
import logging
import sys
from config import *

logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

global conversation
global vectordb
conversation = None
vectordb = None

def init_index():
if not INIT_INDEX:
logging.info("continue without initializing index")
return

logging.info("initializing index from `%s`", TARGET_URL)

# scrape data from web
documents = RecursiveUrlLoader(
TARGET_URL,
max_depth=4,
extractor=lambda x: Soup(x, "html.parser").text,
prevent_outside=True,
use_async=True,
timeout=600,
check_response_status=True,
# drop trailing / to avoid duplicate pages.
link_regex=(
f"href=[\"']{PREFIXES_TO_IGNORE_REGEX}((?:{SUFFIXES_TO_IGNORE_REGEX}.)*?)"
r"(?:[\#'\"]|\/[\#'\"])"
),
).load()

logging.info("index created with `%d` documents", len(documents))

# split text
text_splitter = RecursiveCharacterTextSplitter(chunk_size=4000, chunk_overlap=200)
spllited_documents = text_splitter.split_documents(documents)

# create embedding and persist on vector db
embeddings = OpenAIEmbeddings()
vectordb = Chroma.from_documents(
documents=spllited_documents,
embedding=embeddings,
persist_directory=INDEX_PERSIST_DIRECTORY
)
vectordb.persist()

def init_conversation():
global vectordb
global conversation

# load index
embeddings = OpenAIEmbeddings()
vectordb = Chroma(persist_directory=INDEX_PERSIST_DIRECTORY,embedding_function=embeddings)

# create conversation with gpt-4 llm
# max_tokens - define maximum output token limit from gpt
# max_tokens_limit - defines maximum input token limit to gpt
conversation = ConversationalRetrievalChain.from_llm(
ChatOpenAI(temperature=0.7, model_name="gpt-4", max_tokens=1024),
vectordb.as_retriever(),
max_tokens_limit=8192,
return_source_documents=True,
verbose=True,
)

return conversation

def chat(question, user_id):
global conversation

# constrct chat history with mongodb
# session_id is the user_id which comes through http request
# mongo connection string (e.g mongodb://localhost:27017/)
connection_string = f"mongodb://{MONGO_HOST}:{MONGO_PORT}/"
history = MongoDBChatMessageHistory(
connection_string=connection_string, session_id=user_id
)

# gpt conversation
result = conversation({"question": question, "chat_history": history.messages})
answer = result['answer']

logging.info("got response from llm - %s", answer)

# save history
history.add_user_message(question)
history.add_ai_message(answer)

return answer

Run Application

Below are the main steps to operate the ChatBot application and interact with it. Questions can be submitted using the HTTP API, and responses will be received accordingly.

1. Install Dependencies

In this application, I have utilized a number of Python packages that need to be installed using Python’s pip package manager before running the application. The requirements.txt file lists all the necessary packages. These packages can be easily installed by executing the command pip install -r requirements.txt.

Flask==2.0.1
Werkzeug==2.2.2
flask-cors
pymongo
seaborn
openai
langchain==0.0.352
BeautifulSoup4
chromadb==0.3.29
Cython
tiktoken

2. Run MongoDB

As previously mentioned, MongoDB has been utilized as the conversational memory for the ChatBot application. To begin, it is necessary to first start running MongoDB.

# run mongodb with docker
❯❯ docker run -d -p 27017:27017 --name test-mongo mongo:latest

# running container
❯❯ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ba66af3866b1 docker.io/library/mongo:latest mongod 24 hours ago Up 24 hours 0.0.0.0:27017->27017/tcp test-mongo

3. Run ChatBot

The ChatBot can be initiated through api.py as outlined below. Prior to running it, it's necessary to set a few configurations via environment variables. Once app.py is executed, it will start the HTTP API, enabling users to post their questions.

# set openai API key
❯❯ export OPENAI_API_KEY=<add openai api key here>

# init index determine weather needs to create the index
❯❯ export INIT_INDEX=true

# mongo db host(local machine ip in this case)
❯❯ export MONGO_HOST=10.13.40.29

# run the chatbot application
❯❯ python api.py
2023-12-28 11:19:19,796 - INFO - initializing index from `https://open5gs.org/open5gs/docs/`
2023-12-28 11:19:20,515 - INFO - index created with `18` documents
2023-12-28 11:19:20,614 - INFO - Note: NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2023-12-28 11:19:20,614 - INFO - NumExpr defaulting to 8 threads.
2023-12-28 11:19:20,725 - INFO - Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
2023-12-28 11:19:20,825 - INFO - loaded in 258 embeddings
2023-12-28 11:19:20,827 - INFO - loaded in 1 collections
2023-12-28 11:19:20,829 - INFO - collection with name langchain already exists, returning existing collection
2023-12-28 11:19:24,212 - INFO - Persisting DB to disk, putting it in the save folder: ./data/chromadb
2023-12-28 11:19:24,248 - INFO - Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
2023-12-28 11:19:24,272 - INFO - loaded in 344 embeddings
2023-12-28 11:19:24,272 - INFO - loaded in 1 collections
2023-12-28 11:19:24,273 - INFO - collection with name langchain already exists, returning existing collection
* Serving Flask app 'api' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
2023-12-28 11:19:24,468 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:7654
* Running on http://10.13.40.29:7654
2023-12-28 11:19:24,469 - INFO - Press CTRL+C to quit
2023-12-28 11:19:24,469 - INFO - * Restarting with stat
2023-12-28 11:19:25,127 - INFO - initializing index from `https://open5gs.org/open5gs/docs/`
2023-12-28 11:19:25,481 - INFO - index created with `18` documents
2023-12-28 11:19:25,578 - INFO - Note: NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2023-12-28 11:19:25,578 - INFO - NumExpr defaulting to 8 threads.
2023-12-28 11:19:25,705 - INFO - Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
2023-12-28 11:19:25,825 - INFO - loaded in 344 embeddings
2023-12-28 11:19:25,828 - INFO - loaded in 1 collections
2023-12-28 11:19:25,831 - INFO - collection with name langchain already exists, returning existing collection
2023-12-28 11:19:28,608 - INFO - Persisting DB to disk, putting it in the save folder: ./data/chromadb
2023-12-28 11:19:28,652 - INFO - Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
2023-12-28 11:19:28,680 - INFO - loaded in 430 embeddings
2023-12-28 11:19:28,680 - INFO - loaded in 1 collections
2023-12-28 11:19:28,681 - INFO - collection with name langchain already exists, returning existing collection
2023-12-28 11:19:28,684 - WARNING - * Debugger is active!
2023-12-28 11:19:28,694 - INFO - * Debugger PIN: 973-611-562

4. Post Question

Once the ChatBot application is running, I can submit questions related to the Open5GS documentation via the HTTP API.

# ask question
❯❯ curl -i -XPOST "http://localhost:7654/api/question" \
--header "Content-Type: application/json" \
--data '
{
"question": "what is open5gs",
"user_id": "bassa"
}
'


# ConversationalRetrievalChain generate following prompt with question, semantic seach result and send to llm
> Entering new LLMChain chain...
Prompt after formatting:
System: Use the following pieces of context to answer the users question.
If you don't know the answer, just say that you don't know, don't try to make up an answer.
----------------
Documentation | Open5GS Open5GS Documentation Features Support CLA OSS Notice GitHub Documentation User's Guide
Quickstart Building Open5GS from Sources Tutorials Your First LTE 5G SA COTS UE from SRS Metrics with Prometheus VoLTE
Setup with Kamailio IMS and Open5GS Dockerized VoLTE Setup Roaming Inside Source Code UPF Code Explanation SMF Code
Explanation Troubleshooting Simple Issues Now in Github Issues Platform Specific Notes Debian/Ubuntu CentOS Fedora
MacOSX(Apple Silicon) MacOSX(Intel) FreeBSD Alpine Hardware Specific Notes eNodeBs/gNodeBs tested on Open5GS
@infinitydon Open5GS on Amazon Elastic Kubernetes Service Kubernetes Open5GS Deployment 5G Core SBI mTLS Using External
Certificate PKI 5G Frame Routing 5G SCTP LoadBalancer Using LoxiLB(Video Link) 5G Roaming With Mutual TLS
@nickvsnetworking My first 5G Core : Open5GS and UERANSIM Sending SMS in Open5GS LTE Networks using the SGs Interface
and OsmoMSC OsmoMSC and Open5GS MME – SGs Interface for CSCF / InterRAT Handover Static IPs for UEs Open5GS without NAT
Basics of EPC/LTE Online Charging (OCS) Backing up and Restoring Open5GS Diameter Routing Agents - Part 1, Part 2, Part
3 @s5uishida Open5GS EPC & OpenAirInterface UE/RAN Sample configuration Open5GS 5GC & UERANSIM UE/RAN Sample
Configuration Open5GS & UERANSIM - Select nearby UPF according to the connected gNodeB VoLTE and SMS Configuration for
docker_open5gs Select nearby UPF(PGW-U) according to the connected eNodeB Select UPF based on S-NSSAI SCP Indirect
communication Model C Monitoring Metrics with Prometheus Frame Routing VPP-UPF with DPDK UERANSIM with eUPF(eBPF/XDP
UPF) srsRAN with eUPF(eBPF/XDP UPF) Measurement of UPF Performance @gradiant helm charts Open5GS EPC and SRS LTE in
kubernetes Open5GS NGC and UERANSIM in kubernetes Open5GS NGC and OpenAirInterface GNB with ettus USRP in kubernetes
Open5GS EPC and SRS ENB with ettus USRP in kubernetes Open5GS with Service Communication Proxy in kubernetes Open5GS
Sukchan Lee acetcom@gmail.com GitHub open5gs Open5GS is a C-language implementation of 5G Core and EPC, i.e. the core
network of NR/LTE network (Release-17)

Documentation | Open5GS Open5GS Documentation Features Support CLA OSS Notice GitHub Documentation User's Guide
Quickstart Building Open5GS from Sources Tutorials Your First LTE 5G SA COTS UE from SRS Metrics with Prometheus VoLTE
Setup with Kamailio IMS and Open5GS Dockerized VoLTE Setup Roaming Inside Source Code UPF Code Explanation SMF Code
Explanation Troubleshooting Simple Issues Now in Github Issues Platform Specific Notes Debian/Ubuntu CentOS Fedora
MacOSX(Apple Silicon) MacOSX(Intel) FreeBSD Alpine Hardware Specific Notes eNodeBs/gNodeBs tested on Open5GS
@infinitydon Open5GS on Amazon Elastic Kubernetes Service Kubernetes Open5GS Deployment 5G Core SBI mTLS Using External
Certificate PKI 5G Frame Routing 5G SCTP LoadBalancer Using LoxiLB(Video Link) 5G Roaming With Mutual TLS
@nickvsnetworking My first 5G Core : Open5GS and UERANSIM Sending SMS in Open5GS LTE Networks using the SGs Interface
and OsmoMSC OsmoMSC and Open5GS MME – SGs Interface for CSCF / InterRAT Handover Static IPs for UEs Open5GS without NAT
Basics of EPC/LTE Online Charging (OCS) Backing up and Restoring Open5GS Diameter Routing Agents - Part 1, Part 2, Part
3 @s5uishida Open5GS EPC & OpenAirInterface UE/RAN Sample configuration Open5GS 5GC & UERANSIM UE/RAN Sample
Configuration Open5GS & UERANSIM - Select nearby UPF according to the connected gNodeB VoLTE and SMS Configuration for
docker_open5gs Select nearby UPF(PGW-U) according to the connected eNodeB Select UPF based on S-NSSAI SCP Indirect
communication Model C Monitoring Metrics with Prometheus Frame Routing VPP-UPF with DPDK UERANSIM with eUPF(eBPF/XDP
UPF) srsRAN with eUPF(eBPF/XDP UPF) Measurement of UPF Performance @gradiant helm charts Open5GS EPC and SRS LTE in
kubernetes Open5GS NGC and UERANSIM in kubernetes Open5GS NGC and OpenAirInterface GNB with ettus USRP in kubernetes
Open5GS EPC and SRS ENB with ettus USRP in kubernetes Open5GS with Service Communication Proxy in kubernetes Open5GS
Sukchan Lee acetcom@gmail.com GitHub open5gs Open5GS is a C-language implementation of 5G Core and EPC, i.e. the core
network of NR/LTE network (Release-17)
Human: what is open5gs


# response status
HTTP/1.1 200 OK
Server: Werkzeug/2.3.7 Python/3.11.2
Date: Thu, 28 Dec 2023 17:12:29 GMT
Content-Type: application/json
Content-Length: 131
Access-Control-Allow-Origin: *
Connection: close


# response
{
"answer": "Open5GS is a C-language implementation of 5G Core and EPC, i.e. the core network of NR/LTE network (Release-17)."
}



---



# ask next question
❯❯ curl -i -XPOST "http://localhost:7654/api/question" \
--header "Content-Type: application/json" \
--data '
{
"question": "what are the enodebs and gnodebs tested in open5gs",
"user_id": "bassa"
}
'


# ConversationalRetrievalChain generate following prompt with question, semantic seach result chat history and send to llm
> Entering new LLMChain chain...
Prompt after formatting:
System: Use the following pieces of context to answer the users question.
If you don't know the answer, just say that you don't know, don't try to make up an answer.
----------------
eNodeBs / gNodeBs tested on Open5GS | Open5GS Open5GS Documentation Features Support CLA OSS Notice GitHub eNodeBs /
gNodeBs tested on Open5GS 2023-12-27 21:59 This page lists Radio hardware that has been tested by members of the Open5GS
community, If you have tested radio hardware from a vendor not listed with Open5GS, please add it to this page by
creating a PR on GitHub. Commercial 5G Airfill S5G AFBU-SL14CN (DU + CU) + AFRU-352-I Indoor Radio (n77 and n78) Airspan
5G OpenRange vCU + Airspan 5G OpenRange vDU + Airspan 5G OpenRANGE06 AirVelocity 2700 RU Airspan AirSpeed 2900 Airspan
AirStrand 2200 ASKEY SCE2200 5G SUB-6 SMALL CELL BTI Wireless nCELL-F2240 5G NR Femtocell (n78) CableFree Small Cell
Outdoor radios (5G n77, n78 and other bands) CableFree Small Cell Indoor radios (5G n77, n78 and other bands) CableFree
Macro (BBU+RRH) radios (4G and 5G, various bands) Ericsson Baseband 6630 (21.Q3 Software) + Radio 2217, Radio 2219 (4G
and 5G, various bands) Ericsson StreetMacro 6701 (21.Q3 Software) (5G mmWave, n261) (Baseband 6318 and AIR 1281 packaged
together) Huawei BTS5900 LIONS RANathon O-CU and O-DU + RANathon RS8601 Indoor O-RU + RANathon XG8600 Fronthaul Gateway
NOKIA AEQE (SW: 5G20A) NOKIA AEQD (SW: 5G20A) NOKIA AEQP (SW: 5G21A) Commercial 4G Accelleran E1010 (LTE TDD B42)
AirHarmony 4000 AirHarmony 4200 AirHarmony 4400 Airspan AirSpeed 1030 Airspan AirHarmony 1000 Baicells Neutrino Baicells
Nova 243 Baicells Nova 246 Baicells Nova 249 Baicells Nova 436Q Baicells Nova 227 (EBS & CBRS) Baicells Nova 233
Ericsson Baseband 6630 (21Q1 Software) Ericsson RBS 6402 (18.Q1 software, B2 B25 B4 B7 B252 B255) Ericsson RBS 6601 +
DUL 20 01 + RUS 01 B8 Gemtek WLTGFC-101 (S/W version 2.1.1746.1116) Huawei BTS3900 (S/W version V100R011C10SPC230)
Huawei BBU5900 with RRU5304W Band 7 FDD 2600Mhz 40W Version V100R016C10 Klas VoyagerCell Duo 4GAP1000/4GAP1000X Nokia
FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power Nokia FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600
MHz Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0 Nokia FW2FA Flexi Zone
Mini-Macro Outdoor BTS, 2x20w Band 39 Nokia FWGR Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 1 Ruckus Q710 and Q910
4G/5G Software Stacks + SDRs Amarisoft + LimeSDR, USRP, Amarisoft PCI Express Card Open Air Interface 5G (
NR_SA_F1AP_5GRECORDS branch) + USRP B210 srsLTE / srsENB + LimeSDR, USRP, BladeRF x40 (BladeRF Not stable) Misc Radio
Hardware OpenAirInterface v1.0.3 4G RAN Simulator OsmoBTS controlled ip.access NanoBTS (Used for CSFB with Osmocom)
UERANSIM 5G RAN Simulator Open5GS Sukchan Lee acetcom@gmail.com GitHub open5gs Open5GS is a C-language implementation of
5G Core and EPC, i.e. the core network of NR/LTE network (Release-17)

eNodeBs / gNodeBs tested on Open5GS | Open5GS Open5GS Documentation Features Support CLA OSS Notice GitHub eNodeBs /
gNodeBs tested on Open5GS 2023-12-27 21:59 This page lists Radio hardware that has been tested by members of the Open5GS
community, If you have tested radio hardware from a vendor not listed with Open5GS, please add it to this page by
creating a PR on GitHub. Commercial 5G Airfill S5G AFBU-SL14CN (DU + CU) + AFRU-352-I Indoor Radio (n77 and n78) Airspan
5G OpenRange vCU + Airspan 5G OpenRange vDU + Airspan 5G OpenRANGE06 AirVelocity 2700 RU Airspan AirSpeed 2900 Airspan
AirStrand 2200 ASKEY SCE2200 5G SUB-6 SMALL CELL BTI Wireless nCELL-F2240 5G NR Femtocell (n78) CableFree Small Cell
Outdoor radios (5G n77, n78 and other bands) CableFree Small Cell Indoor radios (5G n77, n78 and other bands) CableFree
Macro (BBU+RRH) radios (4G and 5G, various bands) Ericsson Baseband 6630 (21.Q3 Software) + Radio 2217, Radio 2219 (4G
and 5G, various bands) Ericsson StreetMacro 6701 (21.Q3 Software) (5G mmWave, n261) (Baseband 6318 and AIR 1281 packaged
together) Huawei BTS5900 LIONS RANathon O-CU and O-DU + RANathon RS8601 Indoor O-RU + RANathon XG8600 Fronthaul Gateway
NOKIA AEQE (SW: 5G20A) NOKIA AEQD (SW: 5G20A) NOKIA AEQP (SW: 5G21A) Commercial 4G Accelleran E1010 (LTE TDD B42)
AirHarmony 4000 AirHarmony 4200 AirHarmony 4400 Airspan AirSpeed 1030 Airspan AirHarmony 1000 Baicells Neutrino Baicells
Nova 243 Baicells Nova 246 Baicells Nova 249 Baicells Nova 436Q Baicells Nova 227 (EBS & CBRS) Baicells Nova 233
Ericsson Baseband 6630 (21Q1 Software) Ericsson RBS 6402 (18.Q1 software, B2 B25 B4 B7 B252 B255) Ericsson RBS 6601 +
DUL 20 01 + RUS 01 B8 Gemtek WLTGFC-101 (S/W version 2.1.1746.1116) Huawei BTS3900 (S/W version V100R011C10SPC230)
Huawei BBU5900 with RRU5304W Band 7 FDD 2600Mhz 40W Version V100R016C10 Klas VoyagerCell Duo 4GAP1000/4GAP1000X Nokia
FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power Nokia FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600
MHz Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0 Nokia FW2FA Flexi Zone
Mini-Macro Outdoor BTS, 2x20w Band 39 Nokia FWGR Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 1 Ruckus Q710 and Q910
4G/5G Software Stacks + SDRs Amarisoft + LimeSDR, USRP, Amarisoft PCI Express Card Open Air Interface 5G (
NR_SA_F1AP_5GRECORDS branch) + USRP B210 srsLTE / srsENB + LimeSDR, USRP, BladeRF x40 (BladeRF Not stable) Misc Radio
Hardware OpenAirInterface v1.0.3 4G RAN Simulator OsmoBTS controlled ip.access NanoBTS (Used for CSFB with Osmocom)
UERANSIM 5G RAN Simulator Open5GS Sukchan Lee acetcom@gmail.com GitHub open5gs Open5GS is a C-language implementation of
5G Core and EPC, i.e. the core network of NR/LTE network (Release-17)
Human: What are the eNodeBs and gNodeBs that are tested in the Open5GS implementation?

# response status
HTTP/1.1 200 OK
Server: Werkzeug/2.3.7 Python/3.11.2
Date: Thu, 28 Dec 2023 17:14:29 GMT
Content-Type: application/json
Content-Length: 2477
Access-Control-Allow-Origin: *
Connection: close


# response
{
"answer": "The eNodeBs and gNodeBs that have been tested on Open5GS include:\n\nCommercial 5G:\n- Airfill S5G AFBU-SL14CN (DU + CU) + AFRU-352-I Indoor Radio (n77 and n78)\n- Airspan 5G OpenRange vCU + Airspan 5G OpenRange vDU + Airspan 5G OpenRANGE06\n- AirVelocity 2700 RU\n- Airspan AirSpeed 2900\n- Airspan AirStrand 2200\n- ASKEY SCE2200 5G SUB-6 SMALL CELL\n- BTI Wireless nCELL-F2240 5G NR Femtocell (n78)\n- CableFree Small Cell Outdoor radios (5G n77, n78 and other bands)\n- CableFree Small Cell Indoor radios (5G n77, n78 and other bands)\n- CableFree Macro (BBU+RRH) radios (4G and 5G, various bands)\n- Ericsson Baseband 6630 (21.Q3 Software) + Radio 2217, Radio 2219 (4G and 5G, various bands)\n- Ericsson StreetMacro 6701 (21.Q3 Software) (5G mmWave, n261) (Baseband 6318 and AIR 1281 packaged together)\n- Huawei BTS5900\n- LIONS RANathon O-CU and O-DU + RANathon RS8601 Indoor O-RU + RANathon XG8600 Fronthaul Gateway\n- NOKIA AEQE (SW: 5G20A)\n- NOKIA AEQD (SW: 5G20A)\n- NOKIA AEQP (SW: 5G21A)\n\nCommercial 4G:\n- Accelleran E1010 (LTE TDD B42)\n- AirHarmony 4000\n- AirHarmony 4200\n- AirHarmony 4400\n- Airspan AirSpeed 1030\n- Airspan AirHarmony 1000\n- Baicells Neutrino\n- Baicells Nova 243\n- Baicells Nova 246\n- Baicells Nova 249\n- Baicells Nova 436Q\n- Baicells Nova 227 (EBS & CBRS)\n- Baicells Nova 233\n- Ericsson Baseband 6630 (21Q1 Software)\n- Ericsson RBS 6402 (18.Q1 software, B2 B25 B4 B7 B252 B255)\n- Ericsson RBS 6601 + DUL 20 01 + RUS 01 B8\n- Gemtek WLTGFC-101 (S/W version 2.1.1746.1116)\n- Huawei BTS3900 (S/W version V100R011C10SPC230)\n- Huawei BBU5900 with RRU5304W Band 7 FDD 2600Mhz 40W Version V100R016C10\n- Klas VoyagerCell Duo 4GAP1000/4GAP1000X\n- Nokia FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power\n- Nokia FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz\n- Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0\n- Nokia FW2FA Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 39\n- Nokia FWGR Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 1\n- Ruckus Q710 and Q910\n\n4G/5G Software Stacks + SDRs:\n- Amarisoft + LimeSDR, USRP, Amarisoft PCI Express Card\n- Open Air Interface 5G (NR_SA_F1AP_5GRECORDS branch) + USRP B210\n- srsLTE / srsENB + LimeSDR, USRP, BladeRF x40 (BladeRF Not stable)\n\nMisc Radio Hardware:\n- OpenAirInterface v1.0.3 4G RAN Simulator\n- OsmoBTS controlled ip.access NanoBTS (Used for CSFB with Osmocom)\n- UERANSIM 5G RAN Simulator"
}



---



# ask question with previous context
❯❯ curl -i -XPOST "http://localhost:7654/api/question" \
--header "Content-Type: application/json" \
--data '
{
"question": "give more information about it",
"user_id": "bassa"
}
'


# ConversationalRetrievalChain generate following prompt with question, semantic seach result and chat history and send to llm
> Entering new LLMChain chain...
Prompt after formatting:
Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question, in its original language.

Chat History:

Human: what is open5gs
Assistant: Open5GS is a C-language implementation of 5G Core and EPC, i.e. the core network of NR/LTE network (Release-17).
Human: what are the enodebs and gnodebs tested in open5gs
Assistant: The eNodeBs and gNodeBs that have been tested on Open5GS include:

Commercial 5G:
- Airfill S5G AFBU-SL14CN (DU + CU) + AFRU-352-I Indoor Radio (n77 and n78)
- Airspan 5G OpenRange vCU + Airspan 5G OpenRange vDU + Airspan 5G OpenRANGE06
- AirVelocity 2700 RU
- Airspan AirSpeed 2900
- Airspan AirStrand 2200
- ASKEY SCE2200 5G SUB-6 SMALL CELL
- BTI Wireless nCELL-F2240 5G NR Femtocell (n78)
- CableFree Small Cell Outdoor radios (5G n77, n78 and other bands)
- CableFree Small Cell Indoor radios (5G n77, n78 and other bands)
- CableFree Macro (BBU+RRH) radios (4G and 5G, various bands)
- Ericsson Baseband 6630 (21.Q3 Software) + Radio 2217, Radio 2219 (4G and 5G, various bands)
- Ericsson StreetMacro 6701 (21.Q3 Software) (5G mmWave, n261) (Baseband 6318 and AIR 1281 packaged together)
- Huawei BTS5900
- LIONS RANathon O-CU and O-DU + RANathon RS8601 Indoor O-RU + RANathon XG8600 Fronthaul Gateway
- NOKIA AEQE (SW: 5G20A)
- NOKIA AEQD (SW: 5G20A)
- NOKIA AEQP (SW: 5G21A)

Commercial 4G:
- Accelleran E1010 (LTE TDD B42)
- AirHarmony 4000
- AirHarmony 4200
- AirHarmony 4400
- Airspan AirSpeed 1030
- Airspan AirHarmony 1000
- Baicells Neutrino
- Baicells Nova 243
- Baicells Nova 246
- Baicells Nova 249
- Baicells Nova 436Q
- Baicells Nova 227 (EBS & CBRS)
- Baicells Nova 233
- Ericsson Baseband 6630 (21Q1 Software)
- Ericsson RBS 6402 (18.Q1 software, B2 B25 B4 B7 B252 B255)
- Ericsson RBS 6601 + DUL 20 01 + RUS 01 B8
- Gemtek WLTGFC-101 (S/W version 2.1.1746.1116)
- Huawei BTS3900 (S/W version V100R011C10SPC230)
- Huawei BBU5900 with RRU5304W Band 7 FDD 2600Mhz 40W Version V100R016C10
- Klas VoyagerCell Duo 4GAP1000/4GAP1000X
- Nokia FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power
- Nokia FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz
- Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0
- Nokia FW2FA Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 39
- Nokia FWGR Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 1
- Ruckus Q710 and Q910

4G/5G Software Stacks + SDRs:
- Amarisoft + LimeSDR, USRP, Amarisoft PCI Express Card
- Open Air Interface 5G (NR_SA_F1AP_5GRECORDS branch) + USRP B210
- srsLTE / srsENB + LimeSDR, USRP, BladeRF x40 (BladeRF Not stable)

Misc Radio Hardware:
- OpenAirInterface v1.0.3 4G RAN Simulator
- OsmoBTS controlled ip.access NanoBTS (Used for CSFB with Osmocom)
- UERANSIM 5G RAN Simulator
Follow Up Input: give more information about it
Standalone question:


# response status
HTTP/1.1 200 OK
Server: Werkzeug/2.3.7 Python/3.11.2
Date: Thu, 28 Dec 2023 17:16:02 GMT
Content-Type: application/json
Content-Length: 870
Access-Control-Allow-Origin: *
Connection: close


# response
{
"answer": "Open5GS is a C-language implementation of the 5G Core and EPC, which stands for Evolved Packet Core. This is the core network of the NR/LTE network (Release-17). The Open5GS project provides extensive documentation including a user's guide, tutorials, information on building Open5GS from sources, and specific notes for different platforms and hardware. Topics covered in the documentation include setting up your first LTE 5G SA COTS UE from SRS, metrics with Prometheus, VoLTE setup, and others. The project also provides troubleshooting guides and specific tutorials by contributors in the community. It's possible to deploy Open5GS on various platforms like Amazon Elastic Kubernetes Service and it can work with other software like UERANSIM, OsmoMSC, and more. The project is maintained by Sukchan Lee and its source code is available on GitHub."
}

5. Inspect Chat Storage

Now, all user questions and responses from the LLM are stored in MongoDB’s conversational memory. I can connect to MongoDB to inspect and review the chat history saved within the collection.

# mongod run with docker and no password(means no auth)
❯❯ docker run -d -p 27017:27017 --name test-mongo mongo:latest

# connect to mongo container
❯❯ docker exec -it test-mongo bash

# connect to mongodb shell
mongosh

# show dbs
# `chat_history` is the db created by langchain
test> show dbs
admin 40.00 KiB
chat_history 116.00 KiB
config 72.00 KiB
local 40.00 KiB

# connect to `chat_history` db
test> use chat_history
switched to db chat_history

# show collections
# `message_store` is the collection created by langchain to store chat history
chat_history> show collections
message_store

# find all in `message_store`
chat_history> db.message_store.find()
[
{
_id: ObjectId('658dac7d7cf286cb7d588726'),
SessionId: 'bassa',
History: '{"type": "human", "data": {"content": "what is open5gs", "additional_kwargs": {}, "type": "human", "example": false}}'
},
{
_id: ObjectId('658dac7d7cf286cb7d588727'),
SessionId: 'bassa',
History: '{"type": "ai", "data": {"content": "Open5GS is a C-language implementation of 5G Core and EPC, i.e. the core network of NR/LTE network (Release-17).", "additional_kwargs": {}, "type": "ai", "example": false}}'
},
{
_id: ObjectId('658dacf57cf286cb7d588729'),
SessionId: 'bassa',
History: '{"type": "human", "data": {"content": "what are the enodebs and gnodebs tested in open5gs", "additional_kwargs": {}, "type": "human", "example": false}}'
},
{
_id: ObjectId('658dacf57cf286cb7d58872a'),
SessionId: 'bassa',
History: '{"type": "ai", "data": {"content": "The eNodeBs and gNodeBs that have been tested on Open5GS include:\\n\\nCommercial 5G:\\n- Airfill S5G AFBU-SL14CN (DU + CU) + AFRU-352-I Indoor Radio (n77 and n78)\\n- Airspan 5G OpenRange vCU + Airspan 5G OpenRange vDU + Airspan 5G OpenRANGE06\\n- AirVelocity 2700 RU\\n- Airspan AirSpeed 2900\\n- Airspan AirStrand 2200\\n- ASKEY SCE2200 5G SUB-6 SMALL CELL\\n- BTI Wireless nCELL-F2240 5G NR Femtocell (n78)\\n- CableFree Small Cell Outdoor radios (5G n77, n78 and other bands)\\n- CableFree Small Cell Indoor radios (5G n77, n78 and other bands)\\n- CableFree Macro (BBU+RRH) radios (4G and 5G, various bands)\\n- Ericsson Baseband 6630 (21.Q3 Software) + Radio 2217, Radio 2219 (4G and 5G, various bands)\\n- Ericsson StreetMacro 6701 (21.Q3 Software) (5G mmWave, n261) (Baseband 6318 and AIR 1281 packaged together)\\n- Huawei BTS5900\\n- LIONS RANathon O-CU and O-DU + RANathon RS8601 Indoor O-RU + RANathon XG8600 Fronthaul Gateway\\n- NOKIA AEQE (SW: 5G20A)\\n- NOKIA AEQD (SW: 5G20A)\\n- NOKIA AEQP (SW: 5G21A)\\n\\nCommercial 4G:\\n- Accelleran E1010 (LTE TDD B42)\\n- AirHarmony 4000\\n- AirHarmony 4200\\n- AirHarmony 4400\\n- Airspan AirSpeed 1030\\n- Airspan AirHarmony 1000\\n- Baicells Neutrino\\n- Baicells Nova 243\\n- Baicells Nova 246\\n- Baicells Nova 249\\n- Baicells Nova 436Q\\n- Baicells Nova 227 (EBS & CBRS)\\n- Baicells Nova 233\\n- Ericsson Baseband 6630 (21Q1 Software)\\n- Ericsson RBS 6402 (18.Q1 software, B2 B25 B4 B7 B252 B255)\\n- Ericsson RBS 6601 + DUL 20 01 + RUS 01 B8\\n- Gemtek WLTGFC-101 (S/W version 2.1.1746.1116)\\n- Huawei BTS3900 (S/W version V100R011C10SPC230)\\n- Huawei BBU5900 with RRU5304W Band 7 FDD 2600Mhz 40W Version V100R016C10\\n- Klas VoyagerCell Duo 4GAP1000/4GAP1000X\\n- Nokia FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power\\n- Nokia FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz\\n- Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0\\n- Nokia FW2FA Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 39\\n- Nokia FWGR Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 1\\n- Ruckus Q710 and Q910\\n\\n4G/5G Software Stacks + SDRs:\\n- Amarisoft + LimeSDR, USRP, Amarisoft PCI Express Card\\n- Open Air Interface 5G (NR_SA_F1AP_5GRECORDS branch) + USRP B210\\n- srsLTE / srsENB + LimeSDR, USRP, BladeRF x40 (BladeRF Not stable)\\n\\nMisc Radio Hardware:\\n- OpenAirInterface v1.0.3 4G RAN Simulator\\n- OsmoBTS controlled ip.access NanoBTS (Used for CSFB with Osmocom)\\n- UERANSIM 5G RAN Simulator", "additional_kwargs": {}, "type": "ai", "example": false}}'
},
{
_id: ObjectId('658dad527cf286cb7d58872c'),
SessionId: 'bassa',
History: '{"type": "human", "data": {"content": "give more information about it", "additional_kwargs": {}, "type": "human", "example": false}}'
},
{
_id: ObjectId('658dad527cf286cb7d58872d'),
SessionId: 'bassa',
History: `{"type": "ai", "data": {"content": "Open5GS is a C-language implementation of the 5G Core and EPC, which stands for Evolved Packet Core. This is the core network of the NR/LTE network (Release-17). The Open5GS project provides extensive documentation including a user's guide, tutorials, information on building Open5GS from sources, and specific notes for different platforms and hardware. Topics covered in the documentation include setting up your first LTE 5G SA COTS UE from SRS, metrics with Prometheus, VoLTE setup, and others. The project also provides troubleshooting guides and specific tutorials by contributors in the community. It's possible to deploy Open5GS on various platforms like Amazon Elastic Kubernetes Service and it can work with other software like UERANSIM, OsmoMSC, and more. The project is maintained by Sukchan Lee and its source code is available on GitHub.", "additional_kwargs": {}, "type": "ai", "example": false}}`
}
]

# count entries in `message_store`
chat_history> db.message_store.count()
4

What’s Next

In next post, I have discussed the implementation of the same Chatbot model model but using LLMChain with a Custom Prompt instead of ConversationalRetrievalChain. Session-based Custom ChatGPT Model for Website Content Utilizing OpenAI GPT-4 LLM, Langchain LLMChain, and MongoDB Conversational Memory. Happy reading :)

Reference

  1. https://medium.com/rahasak/creating-custom-chatgpt-with-your-own-dataset-using-openai-gpt-3-5-model-llamaindex-and-langchain-5d5837bf9d56
  2. https://medium.com/rahasak/session-based-custom-chatgpt-model-for-website-content-utilizing-openai-gpt-4-llm-langchain-f7e9d76f6866
  3. https://realpython.com/chromadb-vector-database/
  4. https://www.gettingstarted.ai/tutorial-chroma-db-best-vector-database-for-langchain-store-embeddings/
  5. https://www.linkedin.com/pulse/how-ship-llms-production-william-phetsinorath
  6. https://blog.futuresmart.ai/langchain-memory-with-llms-for-advanced-conversational-ai-and-chatbots
  7. https://hexacluster.ai/machine_learning/integrating-langchain-openai-pgvector-ai-chatbots/
  8. https://www.hacksoft.io/blog/chatting-with-django-documentation-using-langchain-chroma-and-openai-apis
  9. https://community.intersystems.com/post/step-step-guide-create-personalized-ai-chatgpt-using-langchain
  10. https://medium.com/@nageshmashette32/building-a-document-based-question-answering-system-with-langchain-using-llm-model-fb22e47a965c

--

--