This is currently a Work in Progress, it is basically an implementation plan.
To see a working version that uses OpenAI and open source, see chat-with-confluence
The intention of this repo is to use Embedded Vector Store and an LLM to chat with your confluence docs while assuming that you only have an AWS license - no OpenAI, no other vector store service, nothing else.
- Create an embedding vector store of the Confluence docs
- use langchain.document_loaders.ConfluenceLoader to load the Confluence docs
- use langchain.text_splitter.CharacterTextSplitter and langchain.text_splitter.TokenTextSplitter to break up the docs into
documentsfor processing - use HuggingFace sentance transformers embeddings
- use postgres/pg_vector in RDS as the vector store
- use the embedding vector store to get relevant texts from the store
- Create an embedding of the question (also using HuggingFace)
- Perform similarity search in the vector store using the question embedding to get relevant texts from the store
- provide the llm with the received texts + question as a prompt to answer the question
- Use llama-2, which is available in AWS Sagemaker
- use langchain.chains.RetrievalQA
Amazon Bedrock is under "Limited Beta Preview" and it's super hard to get into the beta. I suspect this soution would be better. Here is how I would do it. The main differences are bolded
- Create an embedding vector store of the Confluence docs
- use langchain.document_loaders.ConfluenceLoader to load the Confluence docs
- use langchain.text_splitter.CharacterTextSplitter and langchain.text_splitter.TokenTextSplitter to break up the docs into
documentsfor processing - (different) use langchain.embedddings.BedrockEmbeddings
- (different) use AWS OpenSearch (which is basically ElasticSearch) via langchain.vectorstores.OpenSearchVectorSearch as a vector store, following these resources:
- langchain's docs on how to use it with Amazon OpenSearch Service Serverles
- this announcement from AWS, which also states that more info on how to use it via langchain is forthcoming.
- the recommendations of this guy
- use the embedding vector store to get relevant texts from the store
- (different) Create an embedding of the question (also using langchain.embedddings.BedrockEmbeddings)
- Perform similarity search in the vector store using the question embedding to get relevant texts from the store
- provide the llm with the received texts + question as a prompt to answer the question
- (different) use Claude 2 (recetly made available) on langchain.llms.Bedrock
- use langchain.chains.RetrievalQA